Skip to content

[bug] NATS store ignores replicas on an adopted bucket #807

Description

@MarcusKainth

Where

Coordination (spate-coordination)

Version

0.2.0 (main at 799bdf8)

Cargo features

coordination-nats

Rust version and platform

Not platform-specific.

What happened

ensure_bucket in crates/spate-coordination/src/store/nats.rs adopts an existing bucket after comparing only its max_age with the configured lease TTL. It does not compare num_replicas. A job whose buckets were created with replicas: 1 keeps running at replication factor 1 after its workers are reconfigured with replicas: 3, and nothing reports the difference.

The NATS store page tells production deployments to set replicas: 3 so the buckets survive losing a node. An operator who follows that advice for an existing job gets no error, no warning and no change.

What you expected instead

The worker handles a replica mismatch on an adopted bucket the way it handles a max_age mismatch, or at least logs it. Which of fatal, warn or scale up (JetStream accepts a replica change on stream update) is right is open.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate: spate-coordinationLeader election, work assignment, and the store backends

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions