-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
One JetStream cluster node restart, KeyValue client may get expired value #4162
Comments
@derekcollison same with leader and follower, |
I am inclined to think that if the KV watcher used a different inbox it would work correctly, waiting on @piotrpio to chime in. |
@derekcollison I do not think this is related to KV watcher - in the given example, watchers are not used (not even internally). The only thing I reproduced the issue and it seems it does not matter whether we kill leader or follower - for a short period after server restart (I guess until consensus is reached), the values returned by direct get sometimes contain old revision (from before server was killed). The issue disappears once I turn off To me this looks like an issue with direct get - I'm investigating and will let you know what I find out. |
Thanks for taking a look. I'll investigate and see if we can fix this up in the 2.9.17 release. |
And apologies @piotrpio, you are right, these are direct gets. Will fix. |
I have a test that now shows this, will fix. |
One JetStream cluster node restart, KeyValue client may get expired value
nats-server -DV
outputserver info:
Versions of
nats-server
and affected client libraries used:nats-server -version: 2.9.16
github.com/nats-io/nats.go v1.25.0
OS/Container environment:
Windows 11 22H2 22621.1702
Steps or code to reproduce the issue:
Expected result:
put[1] ver = 1
get key1 = val1 ver 1
get key1 = val1 ver 1
... more [get key1 = val1 ver 1]
put[2] ver = 2
get key1 = val2 ver 2
get key1 = val2 ver 2
get key1 = val2 ver 2
... more [get key1 = val2 ver 2]
Actual result:
put[1] ver = 1
get key1 = val1 ver 1
get key1 = val1 ver 1
... more [get key1 = val1 ver 1]
put[2] ver = 2
get key1 = val2 ver 2
get key1 = val2 ver 2
get key1 = val1 ver 1 // ----- unexpected value
get key1 = val1 ver 1 // ----- unexpected value
get key1 = val2 ver 2
get key1 = val2 ver 2
get key1 = val1 ver 1 // ----- unexpected value
get key1 = val2 ver 2
get key1 = val2 ver 2
get key1 = val2 ver 2
... more [get key1 = val2 ver 2]
The text was updated successfully, but these errors were encountered: