libkv icon indicating copy to clipboard operation
libkv copied to clipboard

AtomicPut doesn't compare value

Open mthenw opened this issue 8 years ago • 2 comments

Right now AtomicPut doesn't compare value, just ModRevision. Is it intended or not implemented yet? :)

mthenw avatar Sep 01 '17 12:09 mthenw

You're right, probably just an oversight, vacation didn't help 🏖 😅. I'll look into the remaining issues when I'm back.

abronan avatar Sep 01 '17 13:09 abronan

Could you elaborate on what you would want to gain by comparing the value as well?

I'm more familiar with Consul, and there it is intentional to only compare the index. The Consul CAS parameter only takes an index since modifying the value would also modify the index. AFAICT comparing the value would only provide a different result if you passed in an index/value combination that wasn't a valid state that existed in the store. Otherwise it seems like comparing the value would be redundant and slow down operations.

mgood avatar Apr 04 '18 16:04 mgood