NDB tables with character primary key replicate only partially

NDB tables with character primary key replicate only partially

am 13.10.2004 14:07:31 von Giuseppe Maxia

I was testing transactions in NDB tables, and I came across this problem.

Bug observed using MySQL 4.1.4-max, with the simple configuration shown in MySQL manual
(http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_quick.html)

Summary: With two MySQL nodes open, create one table in the first node, giving it
a primary key of type CHAR.
In the second node, the table is replicated.
Then open a transaction, and insert two records in the table.
When the transaction is committed, the second node will only see one record.

If you close the second session and reopen it, then all the records are shown.

To repeat, follow this timeline, issuing the commands in node1 and node2
in the same order they are shown.

(NODE 1) (NODE 2)

mysql1> set autocommit = 0; mysql2> set autocommit = 0;
Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec)

mysql1> create table uno (c char(10)
-> not null primary key)
-> engine=ndb;
Query OK, 0 rows affected (0.55 sec)
mysql2> show create table uno\G
************* 1. row *************
Table: uno
Create Table: CREATE TABLE `uno` (
`c` char(10) NOT NULL default '',
PRIMARY KEY (`c`)
) ENGINE=ndbcluster
DEFAULT CHARSET=latin1
1 row in set (0.01 sec)

mysql1> begin;
Query OK, 0 rows affected (0.00 sec)

mysql1> insert into uno values
-> ('aaa'), ('bbb');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql2> select * from uno;
Empty set (0.00 sec)
mysql1> commit;
Query OK, 0 rows affected (0.00 sec)

mysql1> select * from uno; mysql2> select * from uno;
+-----+ +-----+
| c | | c |
+-----+ +-----+
| bbb | | bbb |
| aaa | +-----+
+-----+ 1 row in set (0.01 sec)
2 rows in set (0.00 sec)



--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially

am 13.10.2004 21:15:06 von Jonas Oreland

Hi,

I've tried to reproduce you problem, but I can't.

How long time does pass between mysql1-commit and mysql2-select?

/Jonas

Giuseppe Maxia wrote:
> I was testing transactions in NDB tables, and I came across this problem.
>
> Bug observed using MySQL 4.1.4-max, with the simple configuration shown
> in MySQL manual
> (http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_quick.html)
>
> Summary: With two MySQL nodes open, create one table in the first node,
> giving it
> a primary key of type CHAR.
> In the second node, the table is replicated.
> Then open a transaction, and insert two records in the table.
> When the transaction is committed, the second node will only see one
> record.
>
> If you close the second session and reopen it, then all the records are
> shown.
>
> To repeat, follow this timeline, issuing the commands in node1 and node2
> in the same order they are shown.
>
> (NODE 1) (NODE 2)
>
> mysql1> set autocommit = 0; mysql2> set autocommit = 0;
> Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00
> sec)
>
> mysql1> create table uno (c char(10)
> -> not null primary key)
> -> engine=ndb;
> Query OK, 0 rows affected (0.55 sec)
> mysql2> show create table uno\G
> ************* 1. row *************
> Table: uno
> Create Table: CREATE TABLE `uno` (
> `c` char(10) NOT NULL default '',
> PRIMARY KEY (`c`)
> ) ENGINE=ndbcluster
> DEFAULT CHARSET=latin1
> 1 row in set (0.01 sec)
>
> mysql1> begin;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql1> insert into uno values
> -> ('aaa'), ('bbb');
> Query OK, 2 rows affected (0.00 sec)
> Records: 2 Duplicates: 0 Warnings: 0
>
> mysql2> select * from uno;
> Empty set (0.00 sec)
> mysql1> commit;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql1> select * from uno; mysql2> select * from uno;
> +-----+ +-----+
> | c | | c |
> +-----+ +-----+
> | bbb | | bbb |
> | aaa | +-----+
> +-----+ 1 row in set (0.01 sec)
> 2 rows in set (0.00 sec)
>
>
>


--
Jonas Oreland, Software Engineer
MySQL AB, www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially

am 13.10.2004 21:45:50 von Giuseppe Maxia

Jonas Oreland wrote:
> Hi,
>
> I've tried to reproduce you problem, but I can't.
>
> How long time does pass between mysql1-commit and mysql2-select?
>

just a few seconds. Only the time needed to switch from one terminal window
to the next and press the ENTER key.

Anyway, I made further inquiries, and I found out that this bug does show
ONLY if both clients had autocommit=0 before the steps I described.

Actually, if I turn autocommit ON (instead of disconnecting and restarting)
in the second client, then I can see the records correctly.

Just to be sure, I removed everything, reinstalled all the cluster
from scratch, and the problem is repeatable.


Cheers

Giuseppe


> /Jonas
>
> Giuseppe Maxia wrote:
>
>> I was testing transactions in NDB tables, and I came across this problem.
>>
>> Bug observed using MySQL 4.1.4-max, with the simple configuration
>> shown in MySQL manual
>> (http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_quick.html)
>>
>> Summary: With two MySQL nodes open, create one table in the first
>> node, giving it
>> a primary key of type CHAR.
>> In the second node, the table is replicated.
>> Then open a transaction, and insert two records in the table.
>> When the transaction is committed, the second node will only see one
>> record.
>>
>> If you close the second session and reopen it, then all the records
>> are shown.
>>
>> To repeat, follow this timeline, issuing the commands in node1 and node2
>> in the same order they are shown.
>>
>> (NODE 1) (NODE 2)
>>
>> mysql1> set autocommit = 0; mysql2> set autocommit = 0;
>> Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected
>> (0.00 sec)
>>
>> mysql1> create table uno (c char(10)
>> -> not null primary key)
>> -> engine=ndb;
>> Query OK, 0 rows affected (0.55 sec)
>> mysql2> show create table uno\G
>> ************* 1. row
>> *************
>> Table: uno
>> Create Table: CREATE TABLE
>> `uno` (
>> `c` char(10) NOT NULL
>> default '',
>> PRIMARY KEY (`c`)
>> ) ENGINE=ndbcluster
>> DEFAULT CHARSET=latin1
>> 1 row in set (0.01 sec)
>>
>> mysql1> begin;
>> Query OK, 0 rows affected (0.00 sec)
>>
>> mysql1> insert into uno values
>> -> ('aaa'), ('bbb');
>> Query OK, 2 rows affected (0.00 sec)
>> Records: 2 Duplicates: 0 Warnings: 0
>>
>> mysql2> select * from uno;
>> Empty set (0.00 sec)
>> mysql1> commit;
>> Query OK, 0 rows affected (0.00 sec)
>>
>> mysql1> select * from uno; mysql2> select * from uno;
>> +-----+ +-----+
>> | c | | c |
>> +-----+ +-----+
>> | bbb | | bbb |
>> | aaa | +-----+
>> +-----+ 1 row in set (0.01 sec)
>> 2 rows in set (0.00 sec)
>>
>>
>>
>
>

--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 14.10.2004 07:02:45 von Giuseppe Maxia

Jonas Oreland wrote:
> Hi,
>
> I've tried to reproduce you problem, but I can't.
>
> How long time does pass between mysql1-commit and mysql2-select?
>
> /Jonas
>
> Giuseppe Maxia wrote:
>


Some more info to set the record straight:
Node1 and Node2 are NOT two clients of the same MySQL server, but
two clients of two different MySQL servers using the same NDB data node.

Using the config.ini as listed in the documentation, I started two
instances of the (MySQLL) server listening to two different ports.

Then, after a slight addition to the configuration file,
I repeated the experiment with two MySQL servers in two separate machines
and the bug works as I said in my first message.

Giuseppe

--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 14.10.2004 09:30:06 von Jonas Oreland

Giuseppe Maxia wrote:
> Jonas Oreland wrote:
>
>> Hi,
>>
>> I've tried to reproduce you problem, but I can't.
>>
>> How long time does pass between mysql1-commit and mysql2-select?
>>
>> /Jonas
>>
>> Giuseppe Maxia wrote:
>>
>
>
> Some more info to set the record straight:
> Node1 and Node2 are NOT two clients of the same MySQL server, but
> two clients of two different MySQL servers using the same NDB data node.
>
> Using the config.ini as listed in the documentation, I started two
> instances of the (MySQLL) server listening to two different ports.
>
> Then, after a slight addition to the configuration file,
> I repeated the experiment with two MySQL servers in two separate machines
> and the bug works as I said in my first message.

hmm...I guessed that it was two mysql servers.
But, I still can't repeat the bug (also using auto commit=0) :-(

I'm using the latest bk-source (soon to be released as 4.1.6).

Could you try this using a nightly snapshot?

/Jonas


--
Jonas Oreland, Software Engineer
MySQL AB, www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 14.10.2004 11:00:20 von Giuseppe Maxia

Jonas Oreland wrote:
> Giuseppe Maxia wrote:
>
>> Jonas Oreland wrote:
>>
>>> Hi,
>>>
>>> I've tried to reproduce you problem, but I can't.
>>>
>>> How long time does pass between mysql1-commit and mysql2-select?
>>>
>>> /Jonas
>>>
>>> Giuseppe Maxia wrote:
>>>
>>
>>
>> Some more info to set the record straight:
>> Node1 and Node2 are NOT two clients of the same MySQL server, but
>> two clients of two different MySQL servers using the same NDB data node.
>>
>> Using the config.ini as listed in the documentation, I started two
>> instances of the (MySQLL) server listening to two different ports.
>>
>> Then, after a slight addition to the configuration file,
>> I repeated the experiment with two MySQL servers in two separate machines
>> and the bug works as I said in my first message.
>
>
> hmm...I guessed that it was two mysql servers.
> But, I still can't repeat the bug (also using auto commit=0) :-(
>
> I'm using the latest bk-source (soon to be released as 4.1.6).
>
> Could you try this using a nightly snapshot?
>
> /Jonas
>
>

I just did that. I compiled 4.1.6 and I got another surprise.
It seems that it does not like the configuration that worked fine with 4.1.5

-- NDB Cluster -- Management Client --
Connecting to Management Server: localhost:2200
NDB> show
Cluster Configuration
---------------------
Could not get configuration
* 1006: Illegal reply from server

And in the error log:

Date/Time: Thursday 14 October 2004 - 10:35:51
Type of error: error
Message: Invalid Configuration fetched from Management Server
Fault ID: 2350
Problem data: Could not fetch configuration/invalid configuration
Object of reference:
ProgramName: NDB Kernel
ProcessID: 3954
TraceFile: ./ndb_2_trace.log.1


Curious, though. I have been experimenting with the cluster since June,
and the format of the configuration file has already changed three times.

Giuseppe


--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 14.10.2004 11:12:00 von Jonas Oreland

Giuseppe Maxia wrote:
> Jonas Oreland wrote:
>
>> Giuseppe Maxia wrote:
>>
>>> Jonas Oreland wrote:
>>>
>>>> Hi,
>>>>
>>>> I've tried to reproduce you problem, but I can't.
>>>>
>>>> How long time does pass between mysql1-commit and mysql2-select?
>>>>
>>>> /Jonas
>>>>
>>>> Giuseppe Maxia wrote:
>>>>
>>>
>>>
>>> Some more info to set the record straight:
>>> Node1 and Node2 are NOT two clients of the same MySQL server, but
>>> two clients of two different MySQL servers using the same NDB data node.
>>>
>>> Using the config.ini as listed in the documentation, I started two
>>> instances of the (MySQLL) server listening to two different ports.
>>>
>>> Then, after a slight addition to the configuration file,
>>> I repeated the experiment with two MySQL servers in two separate
>>> machines
>>> and the bug works as I said in my first message.
>>
>>
>>
>> hmm...I guessed that it was two mysql servers.
>> But, I still can't repeat the bug (also using auto commit=0) :-(
>>
>> I'm using the latest bk-source (soon to be released as 4.1.6).
>>
>> Could you try this using a nightly snapshot?
>>
>> /Jonas
>>
>>
>
> I just did that. I compiled 4.1.6 and I got another surprise.
> It seems that it does not like the configuration that worked fine with
> 4.1.5
>
> -- NDB Cluster -- Management Client --
> Connecting to Management Server: localhost:2200
> NDB> show
> Cluster Configuration
> ---------------------
> Could not get configuration
> * 1006: Illegal reply from server
>
> And in the error log:
>
> Date/Time: Thursday 14 October 2004 - 10:35:51
> Type of error: error
> Message: Invalid Configuration fetched from Management Server
> Fault ID: 2350
> Problem data: Could not fetch configuration/invalid configuration
> Object of reference:
> ProgramName: NDB Kernel
> ProcessID: 3954
> TraceFile: ./ndb_2_trace.log.1
>
>
> Curious, though. I have been experimenting with the cluster since June,
> and the format of the configuration file has already changed three times.

:-)

But, please correct me if I'm wrong.
This does not mean that the actual format changed, but that you need to
restart the mgm server.

We have currently made the decision not to allow _any_ different version
binaries connecting to each other.

This decision was made to reduce load on testing organization and takes
into account that 4.1* is the _first_ release of mysql cluster.

For 5.0 there will probably be a upgrade path.
Example: you can upgrade from 4.1.3->4.1.8->5.0
but not from 4.1.2->5.0.

(note that this is guesses, and that version numbers are _only_ examples)

/Jonas

ps.
How did the select go?
ds.

--
Jonas Oreland, Software Engineer
MySQL AB, www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 14.10.2004 12:15:45 von Giuseppe Maxia

Jonas Oreland wrote:
> Giuseppe Maxia wrote:
>
>> Jonas Oreland wrote:
>>
>>> Giuseppe Maxia wrote:
>>>
>>>> Jonas Oreland wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I've tried to reproduce you problem, but I can't.
>>>>>
>>>>> How long time does pass between mysql1-commit and mysql2-select?
>>>>>
>>>>> /Jonas
>>>>>
>>>>> Giuseppe Maxia wrote:
>>>>>
>>>>
>>>>
>>>> Some more info to set the record straight:
>>>> Node1 and Node2 are NOT two clients of the same MySQL server, but
>>>> two clients of two different MySQL servers using the same NDB data
>>>> node.
>>>>
>>>> Using the config.ini as listed in the documentation, I started two
>>>> instances of the (MySQLL) server listening to two different ports.
>>>>
>>>> Then, after a slight addition to the configuration file,
>>>> I repeated the experiment with two MySQL servers in two separate
>>>> machines
>>>> and the bug works as I said in my first message.
>>>
>>>
>>>
>>>
>>> hmm...I guessed that it was two mysql servers.
>>> But, I still can't repeat the bug (also using auto commit=0) :-(
>>>
>>> I'm using the latest bk-source (soon to be released as 4.1.6).
>>>
>>> Could you try this using a nightly snapshot?
>>>
>>> /Jonas
>>>
>>>
>>
>> I just did that. I compiled 4.1.6 and I got another surprise.
>> It seems that it does not like the configuration that worked fine with
>> 4.1.5
>>
>> -- NDB Cluster -- Management Client --
>> Connecting to Management Server: localhost:2200
>> NDB> show
>> Cluster Configuration
>> ---------------------
>> Could not get configuration
>> * 1006: Illegal reply from server
>>
>> And in the error log:
>>
>> Date/Time: Thursday 14 October 2004 - 10:35:51
>> Type of error: error
>> Message: Invalid Configuration fetched from Management Server
>> Fault ID: 2350
>> Problem data: Could not fetch configuration/invalid configuration
>> Object of reference:
>> ProgramName: NDB Kernel
>> ProcessID: 3954
>> TraceFile: ./ndb_2_trace.log.1
>>
>>
>> Curious, though. I have been experimenting with the cluster since June,
>> and the format of the configuration file has already changed three times.
>
> :-)
>
> But, please correct me if I'm wrong.
> This does not mean that the actual format changed, but that you need to
> restart the mgm server.

But I did it.

1) I shut down the whole cluster.

2) I replaced 4.1.5 with 4.1.6

3) I made a clean directory for the data node.

4) I started the management server

# ndb_mgmd

5) I started the data server

# ndbd --initial

6) ... And I got an error. :-(

>
> We have currently made the decision not to allow _any_ different version
> binaries connecting to each other.
>

I made sure that the only binaries in view were the ones from 4.1.6.
Now I am back to 4.1.5, because I have a bunch of tests still in my schedule.

> This decision was made to reduce load on testing organization and takes
> into account that 4.1* is the _first_ release of mysql cluster.
>
> For 5.0 there will probably be a upgrade path.
> Example: you can upgrade from 4.1.3->4.1.8->5.0
> but not from 4.1.2->5.0.
>
> (note that this is guesses, and that version numbers are _only_ examples)
>
> /Jonas
>
> ps.
> How did the select go?

No SELECTs with the latest version. I couldn't go past the configuration phase.

> ds.
>

Cheers

Giuseppe


--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: NDB tables with character primary key replicate only partially(2)

am 17.10.2004 12:36:20 von Giuseppe Maxia

Jonas,
I finally managed to get 4.1.6 up and running.
The bug has gone away.
Thanks for your time.

Cheers

Giuseppe



--
Giuseppe Maxia
CTO
http://www.StarData.it
MySQL Certified Professional
__ __ __
___ / /____ ________/ /__ _/ /____ _
(_- /___/\__/\_,_/_/ \_,_/\_,_/\__/\_,_/
Database is our business

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org