Sorry for the long delay,
this was a bug on our side and is fixed by r7316. Apparently, there is no unit
test for this (yet) :(
How far is your Go binding going? We'd be happy to include it into the
official code base if you like.
Regards
Nico Kruber
On Wednesday 17 Dec 2014 10:08:02 Alexandre Beslic wrote:
> Hi,
>
> I'm a bit confused about the test_and_set operation.
>
> I'm writing a Go binding to Scalaris but I fail to succeed at atomically
> incrementing a value doing a *test_and_set* operation.
>
> For testing purpose using curl I first *write* the value inside a
> Transaction:
>
> *$* curl -H "Content-Type: application/json" -d
> '{"id":1,"method":"req_list","params":[[{"write":{"genId":{"type":"as_is","v
> alue":1}}},{"commit":""}]]}'
http://192.168.42.100:8000/api/tx.yaws
> {"result":{"tlog":"g2o=","results":[{"status":"ok"},{"status":"ok"}]},"id":1
> ,"jsonrpc":"2.0"}
>
> If I *read* the value back I get the right result:
>
> *$* curl -H "Content-Type: application/json" -d
> '{"jsonrpc":"2.0","method":"read","params":["genId"],"id":1}'
>
http://192.168.42.100:8000/api/tx.yaws
> {"result":{"status":"ok","value":{"type":"as_is","value":1}},"id":1,"jsonrpc
> ":"2.0"}
>
> But if I try to do a *test_and_set* operation inside a Transaction to
> increment the counter I get the *key_changed error*:
>
> *$* curl -H "Content-Type: application/json" -d