fix: forbid parallel save operations (#2172)

* fix: forbid parallel save operations

* feat: add SAVE option to takeover command
This commit is contained in:
Borys 2023-11-21 13:56:27 +02:00 committed by GitHub
parent c10dac4db2
commit e6f3522d59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 165 additions and 83 deletions

View file

@ -87,8 +87,9 @@ class Service : public facade::ServiceInterface {
// Returns: the new state.
// if from equals the old state then the switch is performed "to" is returned.
// Otherwise, does not switch and returns the current state in the system.
// true if operation is successed
// Upon switch, updates cached global state in threadlocal ServerState struct.
GlobalState SwitchState(GlobalState from, GlobalState to);
std::pair<GlobalState, bool> SwitchState(GlobalState from, GlobalState to);
GlobalState GetGlobalState() const;