RFC - DO NOT MERGE - Test deletion of object version (i.e. vclock) corresponding to CRDT version (i.e. context) #317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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...