Skip to main content

Module cluster_controller

Module cluster_controller 

Source
Expand description

Driver and glue for the mz_cluster_controller reconciler.

The controller crate is pure: it knows nothing about the Coordinator. This module is the half of the ClusterControllerCtx boundary that does: it runs the controller as a separate task and implements the ctx by marshaling each pull/apply to the Coordinator over the internal command channel, because the catalog and the live compute/storage signals are reachable only from the coordinator loop. Pulls are batched so the round-trip count per tick is bounded.

Everything here is gated by ENABLE_CLUSTER_CONTROLLER (default off). With the gate off the task does not tick, so the legacy scheduling and graceful paths remain the sole writers of the replica set. With the gate on the controller owns the user managed-cluster replica set; the legacy entry points no-op. (System/builtin clusters are never controller-owned. The catalogโ€™s bootstrap migration owns their replicas.)

Structsยง

CoordCtx ๐Ÿ”’
The controller-task side of the boundary: a ClusterControllerCtx that marshals every call to the Coordinator over internal_cmd_tx.
ReplicaHydrationCheck ๐Ÿ”’

Enumsยง

ClusterControllerRequest
A request the controller task marshals to the Coordinator to satisfy one ClusterControllerCtx call. Each variant carries a oneshot for the reply.

Functionsยง

memory_burst ๐Ÿ”’
memory_reconfiguration ๐Ÿ”’
on_timeout_from_controller ๐Ÿ”’
reason_from_strategies ๐Ÿ”’
Map a create decisionโ€™s strategy-attribution to the audit reason carried on the create event.
replica_shape ๐Ÿ”’
Map an in-memory replica config to a ReplicaShape, or None for an unmanaged replica (which the controller does not own).
status_from_controller ๐Ÿ”’