Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel increment on key #22

Open
baltazorbest opened this issue Jul 31, 2016 · 2 comments
Open

Parallel increment on key #22

baltazorbest opened this issue Jul 31, 2016 · 2 comments
Labels
bug Something isn't working

Comments

@baltazorbest
Copy link

baltazorbest commented Jul 31, 2016

Hello.
OS: Centos 6.8 x86_64 with latest updates.
I have 2 node Tarantool 1.7.1.117 with master-master replication for testing and plugin memcached 0.1.0.
When I try at the same time the increment for a single key with two running script on two different masters, the first script updates the key on one master, another script updates the key on another master, I do not get the correct value of the key. It should be 2000000 and get for example 882 392 or 892 956.

PHP script:
$mc = new Memcache; $mc->pconnect("ip_master_1_or_2", 11211); $key = "COUNTER"; $mc->set($key, 1, 0, 7200); for($i=0;$i<1000000;$i++) { $mc->increment($key); }

I try this method with tarantool php client, and everything works correctly, the result: 2000000, and I try this method for Memcached, and everything works correctly, result: 200001.

@bigbes
Copy link
Contributor

bigbes commented Aug 1, 2016

Is there any error messages in tarantool log file? Maybe it has become inconsistent? I think that I need to rewrite INC/DEC operation using CRDT with Upsert.

and I try this method for Memcached, and everything works correctly, result: 200001.

As i've guessed, you've setup client-side replication for Memcached? And for Tarantool you've set up server-side replication?

I try this method with tarantool php client, and everything works correctly, the result: 2000000

Why results are different there? I suppose it's because initial values are different?

@bigbes bigbes self-assigned this Aug 1, 2016
@bigbes bigbes added the bug Something isn't working label Aug 1, 2016
@baltazorbest
Copy link
Author

baltazorbest commented Aug 1, 2016

Is there any error messages in tarantool log file? Maybe it has become inconsistent? I think that I need to rewrite INC/DEC operation using CRDT with Upsert.

No error. When I get values from master one and master two, values are the same.

As i've guessed, you've setup client-side replication for Memcached? And for Tarantool you've set up server-side replication?

Server memcached without replication, Tarantool with replication master-master.

Why results are different there? I suppose it's because initial values are different?

Yes, initial values are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants