G
YouTube TikTok Games
Skip to content

clusterd: take the spill backend from the controller - #40701

Draft
antiguru wants to merge 2 commits into
mainfrom
replica-spill-backend
Draft

antiguru wants to merge 2 commits into
mainfrom
replica-spill-backend

Conversation

@antiguru

Copy link
Copy Markdown
Member

Replicas decided their spill behavior themselves: --no-swap from the Kubernetes orchestrator, a compute flag read once when the buffer pool was installed, and a silent fallback to swap when the file store failed to open. Storage's choice between upsert v1 and v2 depended on the same inputs. Review of #40697 showed that inputs depending on install order or on one process's file store can put workers of one replica on different operator graphs.

The controller now decides the spill backend when it provisions a replica and passes --spill-backend=swap|file|none to every process:

  • file when enable_column_paged_batcher_file_extents is on for the replica and its size has a scratch disk. The flag moves from compute to the controller, stays replica-scoped, and takes effect when a replica is next provisioned.
  • swap when the size has swap_enabled.
  • none otherwise.

clusterd halts when told file without a scratch directory, and the pool halts when the file store cannot be opened, replacing the fallback to swap and its gauge. A new none pool backend keeps compressed extents resident and never pages them out. Upsert v2 renders, and the storage spill gate installs the pool, whenever the backend is not none. --no-swap is gone.

Production keeps its current behavior: swap sizes get swap, disk sizes get none and keep upsert v1, and the file flag is off. Local and CI replica sizes set no swap_enabled, so they get file while the CI flag is on and none (upsert v1) when it is varied off.

Supersedes #40697.

New test: no_store_keeps_extents_resident. test/cluster starts its file-store clusterd with --spill-backend=file.

🤖 Generated with Claude Code

Replicas decided their spill behavior themselves, from --no-swap, a
compute flag read once at pool install, and a fallback to swap when the
file store failed to open. Storage's choice between upsert v1 and v2 hung
off the same inputs, and a reviewer found that install-order-dependent
inputs could put workers of one replica on different operator graphs.

The controller now decides the backend when it provisions a replica and
passes it as --spill-backend=swap|file|none. File requires a scratch
directory, and clusterd halts without one or when the file store fails
to open. The none backend keeps compressed extents resident. Upsert v2
renders whenever the backend is not none. The file-extents flag moves to
the controller and is read per replica at provisioning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sqllogictest runner places replica scratch directories under the
container's tmpfs /tmp. The pool's file store refuses memory-backed
directories, and a replica told to spill to files halts when its store
cannot open, so every replica crash-looped and every shard timed out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant