You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if no key exists, it returns some random number for response meta.LastIndex and always fails on CAS operation (false for first param in api).
Consul 0.5.0
Hi @lud4ik if you query and don't get a key back the index is set to the last index that modified the KV store, since there's no key present that you are querying (you could use this to do a blocking query to wait for that key to get created, for example). If the key doesn't exist you can use ?cas=0 which means "create the key only if it isn't already there". Hope that helps!
?cas= : This flag is used to turn the PUT into a Check-And-Set operation. This is very useful as a building block for more complex synchronization primitives. If the index is 0, Consul will only put the key if it does not already exist. If the index is non-zero, the key is only set if the index matches the ModifyIndex of that key.
I perform get, use meta.LastIndex for ModifyIndex in CAS
But if no key exists, it returns some random number for response meta.LastIndex and always fails on CAS operation (false for first param in api).
Consul 0.5.0
If key is present everything works ok.
The text was updated successfully, but these errors were encountered: