-
Notifications
You must be signed in to change notification settings - Fork 189
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
RFC - DO NOT MERGE - Test deletion of object version (i.e. vclock) corresponding to CRDT version (i.e. context) #317
Conversation
Comment taken from 4557759.
... by running Riak. Excerpt from https://docs.travis-ci.com/user/database-setup/#Riak : > Riak uses the default configuration apart from the storage backend, > which is LevelDB. Riak Search is enabled.
TODO Make extraction of context from Riak KV client-side CRDT representation part of behaviour `riakc_datatype` - not only of `riakc_set`.
Sample output of relevant tests (not from the Travis CI run of this PR):
(I had to comment |
I see that So mapreduce looks like the only option currently still. |
(It looks like the part that sets up Riak in this PR will soon be obsoleted by #319 - that is good.) |
I am currently rebasing this PR on current development code and I plan to open new PR.
|
Closing and opening new PR. |
The
riakc_pb_socket:fetch_type/{3,4}
function appears not to return the vclock of the Riak KV object hence the user cannot (naively) delete the object at the vclock corresponding to a specific CRDT context being therefore induced to delete the object using the unsaferiakc_pb_socket:delete/3
rather thanriakc_pb_socket:delete_vclock/4
- safer as catering for concurrent writes. In order to delete the Riak KV object corresponding to a certain CRDT context the user has the only option of retrieving the server-side representation of the object via mapreduce, compare CRDT contexts (between the one to-be-deleted and the one retrieved server-side) and - if equal - callriakc_pb_socket:delete_vclock/4
passing the retrieved server-side vclock.This PR adds tests for the above.
I expect this PR not to be merged, as in my opinion it highlights that there is room for improvement in the user API. I would expect either:
riakc_pb_socket:fetch_type
function to include an option to return the vclock of the object; orriakc_pb_socket:delete_type
to be added.I understand both options require changes in the Protocol Buffers messages definition.
I partially understand the complexity in mapping from CRDT context to Riak KV object vclock because in a corner case the Riak object could contain not simply a CRDT e.g. set but unexpected siblings e.g. a set CRDT, a map CRDT, a register CRDT, a non-CRDT (I read of this corner case in the Riak KV server code). But I guess it could be handled returning an error probably as if if happen the user has probably got more serious issues...