On 2014-07-02 22:13, Apoorva Gaurav wrote:
> Hello All,
>
> I'm just started evaluating Galera so just a novice here. I've spawned
> a 3
> node Galera cluster on AWS EC2 instances and accessing it via HAProxy.
> These are *c3.large* instances running *CentOS 5.10*, mysql rpm I've
> used
> is *MySQL-server-5.5.34_wsrep_25.9-1.rhel5.x86_64.rpm *and Galera rpm
> is
> *galera-25.2.9-1.rhel5.x86_64.rpm* haven't installed xtrabackup as
> yet. Running some tests on this setup, one of them being :-
> Created a table having auto generated primary key and three integer
> columns.
>
> *CREATE TABLE `table1` (*
> * `id` int(11) NOT NULL AUTO_INCREMENT,*
> * `col1` int(11) DEFAULT NULL,*
> * `col2` int(11) DEFAULT NULL,*
> * `col3` int(11) DEFAULT NULL,*
> * PRIMARY KEY (`id`)*
> *)*
>
> 10 threads are running the following in loop
> -Connect
> -Insert a new row with random numbers *rand1, rand2 *and
> *r**a**n**d**3* for
> *col1, col2 *and* col3*. get the auto generated id for the same.
> -Disconnect
> -Connect
> -Update *col3* for same *id *with another random number *rand3b*
At this point you're hitting the issue
https://bugs.launchpad.net/codership-mysql/+bug/1277053.
wsrep_causal_reads does not affect autocommit writes.
However if you wrap it in BEGIN/COMMIT clauses, you should see 100%
synchronous results.
> -Disconnect
> -Connect
> -Select row for same *id*
> -Disconnect
> -Check values of *col1, col2, **col3*
>
> Close to 1% updates are failing because the data is not synced and
> around 1% times value of *col3 *comes to *r**a**n**d**3* instead of
> *rand3b
> *which indicates that there is some lag. If I check wsrep% status on
> mysql
> instances its always in Synced. Is such behaviour expected or there
> might
> be some errors in my configuration. /etc/my.cnf look like this :-
> *[mysqld]*
> *datadir=/var/lib/mysql*
> *socket=/var/lib/mysql/mysql.sock*
> *user=mysql*
> *# Default to using old password format for compatibility with mysql
> 3.x*
> *# clients (those using the mysqlclient10 compatibility package).*
> *old_passwords=1*
>
> *query_cache_size=0*
> *binlog_format=ROW*
> *default_storage_engine=innodb*
> *innodb_autoinc_lock_mode=2*
>
> *wsrep_provider=/usr/lib64/galera/libgalera_smm.so*
> *wsrep_provider_options="gcache.size=2G; gcache.page_size=1G"*
> *wsrep_cluster_address=gcomm://IP2,IP3*
> *wsrep_cluster_name='my_galera_cluster'*
> *wsrep_node_address='IP1'*
> *wsrep_node_name='node1'*
>
> *# Disabling symbolic-links is recommended to prevent assorted security
> risks;*
> *# to do so, uncomment this line:*
> *# symbolic-links=0*
>
> *[mysqld_safe]*
> *log-error=/var/log/mysqld.log*
> *pid-file=/var/run/mysqld/mysqld.pid*