-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node reconnection causes modified index to jump by 1 #7253
Comments
I think this is expected; when follower comes back, it registers itself to v2 store with member attributes like:
v3 has separate kv space, so v3 indexes won't be affected by this. Defer to @xiang90 for double-checking? |
@dansimone There is no guarantees on the v2 index other than it is increasing. It is actually an etcd index, not store index. For v3, we have a store revision, which users can rely on. |
And this is only true if your system only has one client. Once you etcd cluster has multiple concurrent clients, it wont hold. I do not think it is a good way to think about index. Do not rely on index to count number of update on one key. I am closing this issue since the v2 api is pretty much freeze. We only do bug fixes. |
If the system can arbitrarily increase modifiedIndex on its own, how can we reliably check / watch whether a key has been updated without reading the actual value? |
The key has modified index. You can check that. |
I've noticed a situation where the modified index of a key increases by 1 more than expected:
I'm pretty sure what's happening is that the internals of the Raft algorithm are triggering an implicit 'set' when resyncing the state of Key1 on Follower1 in #6. This could be interpreted as expected, but here's why I think this is wrong - regardless of the state of the cluster behind the scenes, modified index is a part of the Etcd public API. There could easily be a client out there running a waitForIndex=X+3 after #4, and expecting this to not return until 2 updates to Key1 have been made. The fact that a cluster member went offline and reconnected should be completely transparent to that client.
Reproducer steps using the Etcd Docker image:
The text was updated successfully, but these errors were encountered: