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
- HTTP request → handle_controller_request() → acquires Leader read lock → external_request()
- external_request() sends ControllerMessage::EnterMaintenanceMode on controller_tx
- 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
Description
EnterMaintenanceModeandExitMaintenanceModeare currently variants ofControllerMessage(in the replicators crate), which is areplicator → controllernotification channel. However, these are external commands sent fromLeader::external_request()in readyset-server,not replicator notifications.
Current flow
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 inexternal_request(). Remove the two variants fromControllerMessageentirely.Change in user-visible behavior
Requires documentation change