-
Notifications
You must be signed in to change notification settings - Fork 133
Description
Hi,
I'm trying to implement a gRPC service for the tsgrpc_kvstore driver, and trying to understand how to correctly support the generation_if_equal option for WriteRequest. In particular, how to handle the case where the generation does not match - the comment in the proto says "the write is aborted" on a mismatch, what exactly does this mean?
Both returning an error from the RPC and returning an error in the WriteResponse.status field leads to the TensorStore write to fail immediately, which leads me to believe this is not what I should do?
Looking at PerformWriteback I see that the transaction is re-tried if the returned generation is "unknown" (== empty). However if I try this, TensorStore just sends writes with generation_if_equal=StorageGeneration::NoValue() in a loop, instead of what I would expect:
- Attempt a write with an old generation, receive StorageGeneration::Unknown
- Issue a read to obtain the current value of the file
- Issue a new write, with the update generation and value
thank you!
PS: I'm also a bit unclear what I should use for the timestamp value of GenerationAndTimestamp - is this intended to be the current time of the gRPC server? The last modified time of the file?