Skip to content
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

JS/KV - Updates #94

Open
6 of 11 tasks
kozlovic opened this issue Feb 10, 2022 · 0 comments · Fixed by nats-io/nats.deno#262
Open
6 of 11 tasks

JS/KV - Updates #94

kozlovic opened this issue Feb 10, 2022 · 0 comments · Fixed by nats-io/nats.deno#262
Assignees
Labels
client Client related work enhancement New feature or request

Comments

@kozlovic
Copy link
Member

kozlovic commented Feb 10, 2022

Overview

Several changes need to be added - or checked that it does not impact - to client libraries

  • If the client detects that the connection is to a server v2.7.2+, the KV stream need to be created with the DiscardNew policy. The server version (json field "version") is present in the INFO protocol received during (re)connect.
  • Make sure that the check for heartbeat set on a consumer is at least 2x the heartbeat setting. The Go client had a bug when the check was set at the exact heartbeat value which could cause the library to think that the HB was missed.
  • For KV Watch, the library after creating the ordered consumer should have access to the consumer's "pending" number of messages at the time of the creation. As indicated with ADR-8, it is safer to use Pending+Delivered.Consumer, especially that servers have a bug when the consumer info's initial state may be wrong (Make sure we snapshot initial consumer info during consumer creation. nats-server#2858). Using ConsumerInfo's Pending + Delivered.Consumer will work for both old and new servers.
    The pending value, if 0 when creating the watch, should trigger sending the "empty entry" to indicate that state. When the watcher starts to receive messages, if the init pending state was not already done, should keep track of the first time a message arrives and set the pending state to what the message delta is, then when the number of received messages is greater than this "initial pending" value, send the "empty entry" to signal that the initial state is reached.

Go PRs where those changes were implemented:

The behavior is documented in ADR-8.

Clients and Tools

Other Tasks

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants