Skip to content

Move EnterMaintenanceMode/ExitMaintenanceMode off ControllerMessage channel #1623

@altmannmarcelo

Description

@altmannmarcelo

Description

EnterMaintenanceMode and ExitMaintenanceMode are currently variants of ControllerMessage (in the replicators crate), which is a replicator → controller notification channel. However, these are external commands sent from Leader::external_request() in readyset-server,

not replicator notifications.

Current flow

  1. HTTP request → handle_controller_request() → acquires Leader read lock → external_request()
  2. external_request() sends ControllerMessage::EnterMaintenanceMode on controller_tx
  3. Controller select loop receives it and calls self.maintenance_mode.store(true, ...)

This is an unnecessary round-trip through the channel just to set an Arc<AtomicBool>.

We can pass the maintenance_mode: Arc<AtomicBool> into Leader during construction and set it directly in external_request(). Remove the two variants from ControllerMessage entirely.

Change in user-visible behavior

Requires documentation change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions