Repository navigation
fix(k8s): roll dipper out one pod at a time - #846
Merged
Merged
Conversation
A rollout with the Deployment's default RollingUpdate strategy runs the old and the new pod side by side. Each keeps its own nonce for the one signer and its own in-process locks, the global reassess lock among them, while both pull jobs from the same queue, so the 2 could send transactions on the same nonce and offer or cancel the same agreement twice. The manifest now uses Recreate, and the k8s README says to run exactly 1 replica. The example config also asked for 10 database connections, which dipper's own startup check refuses: the default 8 worker loops need 26. The check moves from main into Config::validate_db_pool, which now runs with the other config checks before anything connects, so a test can hold the example to it. The example now uses the default pool of 32. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review found the change claimed more than it does. `Recreate` only orders a rollout: when a pod is evicted, deleted or its node drained, Kubernetes starts the replacement while the old pod is still shutting down, and the old pod's worker keeps taking jobs until its turn in the stop sequence. The manifest and the k8s README now say so, and to keep such disruptions to planned windows until dipper holds a lock of its own for as long as it runs. `rollingUpdate: null` drops the defaulted rolling-update settings that a client-side apply onto an existing Deployment would otherwise keep, which the API refuses next to `Recreate`. A pool too small for the worker loops is now reported as an invalid config, not a db config, as `worker_concurrency` is part of the problem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…od-at-a-time # Conflicts: # bin/dipper-service/src/config.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A rollout with the Deployment's default
RollingUpdatestrategy runs the old and the new dipper side by side until the new pod is ready. Each pod keeps its own nonce for the one signer (nonce: AtomicU64undersubmit_lockinchain_client/client.rs) and its own in-process locks, the global reassess lock among them, while both pull jobs from the same queue. During that overlap the 2 can send transactions on the same nonce and offer or cancel the same agreement twice. testnet-v2 runs this way today (maxSurge: 25%rounds up to a second pod).k8s/deployment.yamlnow setsstrategy: Recreate, andk8s/README.mdsays to run exactly 1 replica and why. The price is a gap while the new pod starts.mainintoConfig::validate_db_pool, run with the other config checks before anything connects, so a test holds the example to it; the example now uses the default pool of 32.A Postgres advisory lock (#841, on the Redpanda stack) keeps 2 pods from consuming Studio's requests at once.
Recreateorders rollouts only: on an eviction, a node drain or a pod deletion, Kubernetes starts the replacement while the old pod is still terminating, so this does not rule out 2 signers on its own. That needs a lock dipper holds for as long as it runs, which is a follow-up.Tests:
example_config_has_db_connections_for_its_worker_loopsfailed onmain("needs at least 26 db connections … db.max_connections is 10") and passes now; 3 more pin the rule.just fmt-check,just checkandjust test-unitpass locally.Changes after review
Recreateprevents 2 pods acting at once: it orders rollouts only. The README says to keep evictions and node drains to planned windows until dipper holds a lock of its own.rollingUpdate: nullnext totype: Recreate, so a client-side apply onto an existing Deployment drops the defaulted rolling-update settings the API refuses withRecreate.🤖 Generated with Claude Code