-
Notifications
You must be signed in to change notification settings - Fork 169
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
KV Update command doesn't return last sequence number in case of fail #1221
Comments
Hey! Thanks for the proposal. Server actually returns that information, unfortunately as a part of the string descritpion. However, I would like to ask - what is the use case? How the returned sequence help here? |
Recently Jeremy from NATS team released video about Jetstream KV, and mentioned example toy project, leader election system. I've tried to implement that project in Rust, and got two problems.
|
The create method was added recently and will be part of next release (which will happen shortly). You can check the main branch to see how it was implemented in the meantime. |
Awesome news about |
Wait a little, did I got this correctly. Server doesn't clearly return metadata such as last sequence id, just string formatted with that data? |
Server returns the error code ( |
Should that behavior reported to server team as problematic? It's kinda weird, cause human readable text is additional traffic, probably better to send error code and related metadata, and build an error string on clients itself. Maybe some flag variable to backwards compatibility? |
It's very rarely that the data returned in error is useful in any way for the clients. |
Proposed change
Add to error message some metadata, such as last sequence number.
Use case
Distributed TTL based locks, leader election systems.
Contribution
Yes.
The text was updated successfully, but these errors were encountered: