Skip to content

Don't reset main-queue settings on startup - #984

Merged
aduffeck merged 2 commits into
opencloud-eu:mainfrom
aduffeck:fix-main-queue-replicas
Nov 11, 2026
Merged

aduffeck merged 2 commits into
opencloud-eu:mainfrom
aduffeck:fix-main-queue-replicas

Conversation

@aduffeck

@aduffeck aduffeck commented Nov 9, 2026

Copy link
Copy Markdown
Member

Every service that opens an event stream ran UpdateStream on main-queue with a config that only had Name and MaxAge set. A JetStream update replaces the whole stream config, so any other setting fell back to its default on each service start. On an external 3-node NATS cluster this dropped the stream from R3 to R1. Limits and discard policy set by an admin were reset the same way.

What changes:

  • The existing stream config is read first. Only MaxAge is changed, and the full config is sent back.
  • MaxAge is only set when the stream has none. Restarts no longer touch the stream, and a custom MaxAge is kept.
  • If several services race to create the stream, the ones that lose re-read it and continue.
  • Errors are now logged as a warning. Before, they were dropped silently.

Fixes opencloud-eu/opencloud#3869

Assisted by Claude Opus 5.5

Only set MaxAge on main-queue when it has none, and keep the rest of
the existing config. The old full-config update reset replicas to 1.

Fixes opencloud-eu/opencloud#3869
@aduffeck
aduffeck requested a review from maki5 November 11, 2026 07:16

@maki5 maki5 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me but it will be good to add a test for this case

@aduffeck
aduffeck merged commit f494c4c into opencloud-eu:main Nov 11, 2026
19 checks passed
@openclouders openclouders mentioned this pull request Nov 12, 2026
1 task
NickWalters pushed a commit to NickWalters/reva that referenced this pull request Nov 16, 2026
Brings the typed storage results (opencloud-eu#986), the stuck synchronous upload
fix (opencloud-eu#976), the main-queue replica fix (opencloud-eu#984), the posix id cache fail
fast (opencloud-eu#989) and release 2.52.2 into workpackages.

The typed results were mostly mechanical: the ocm received driver keeps
its service account client, nextcloud keeps its real TouchFile (now
returning a TouchFileResult), and the coordinator ignores the TouchFile
result and still reads the node back, because not every driver fills
it.

opencloud-eu#976 patched the legacy upload session store, which workpackages
removed. Its recovery of nodes left processing by an interrupted
synchronous upload moves into the pkg fork as
Decomposedfs.recoverInterruptedUpload. The coordinator stages sessions
in the same <upload dir>/<id> and <id>.info layout as the old store, so
nodes stuck by older versions still heal on the first download.
Aspects.DisableVersioning stays gone, SeparateBlobs comes along.

The sync specs now drive uploads through the coordinator. The two
blob-first specs follow with the next commit, which moves the blob-first
write to the coordinator path.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] External NATS JetStream: OpenCloud downgrades main-queue replication from R3 to R1

4 participants