Skip to content

KV.Update errors with "wrong last sequence" (10071) with bucket replica=3 only under high update frequency #7281

@michaelwitt13

Description

@michaelwitt13

Observed behavior

We have a NATS Cluster consisting of three nodes. Under high update frequency of updating a KeyValue with KV.update with the NATS Java driver using always the right revision by the client for each KV.update method call, there are a lot of JetStreamApiExceptions emitted with the error message "wrong last sequence" (10071) by the NATS server.
The errors do not appear if the KV bucket is configured with replica=1 but it appears very often (hundreds / thousands of times) when the bucket is configured with replica=3.
Is this a known issue?
Is the KV.update designed to be stable under high load and frequency in a replica-scenario?
Is this a bug or would you advise against using replicas in a high load / frequency scenario updating KeyValues at all?

Expected behavior

If a NATS client like the Java driver calls KV.update with the correct revision, the server / driver should not reply sporadically with an error message "wrong last sequence (10071)". If KV.update is called with the right revision and the NATS cluster is up, it should always update without any error, even under a high load / high frequency scenario.

Server and client version

nats_server_version: 2.11.8-alpine
Java driver version: io.nats:jnats:2.21.4

Host environment

Kubernetes infrastructure with 3 NATS cluster nodes running on AWS

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSuspected defect such as a bug or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions