You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2020/04/22 18:32:15 UTC

[GitHub] [bookkeeper] phemmer opened a new issue #2318: Clarification on usage of kv_rpc.proto PutRequest expected_version

phemmer opened a new issue #2318:
URL: https://github.com/apache/bookkeeper/issues/2318


   **QUESTION**
   
   The kv_rpc.proto has a field [`expected_version`](https://github.com/apache/bookkeeper/blob/release-4.10.0/stream/proto/src/main/proto/kv_rpc.proto#L175) which I assume is for ensuring that the current version of a key is at the specified version prior to performing a change.
   
   However there are still several open questions about how to properly use this functionality:
   1. Is the version check functionality enabled whenever a value is provided here? Thus no value, no version checking?
   2. If the above is indeed the case, how do you handle the version check when `version=0`? In protobuf, zero is the equivalent of a field being not provided. So there's no way to differentiate between checking for `version==0` and version checking disabled.
   3. How do you do a check to ensure that the given key does *not* exist prior to a write? Can't use `version=0` as per the above 2 questions.
   
   If we could get this added to the documentation on this field, it would be appreciated.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org