Skip to content

Commit

Permalink
[release-7.3] Pause perpetual storage wiggle when TSS count target is…
Browse files Browse the repository at this point in the history
… met. (#11824)

* TSS pause

* Add condition
  • Loading branch information
yao-xiao-github authored Dec 16, 2024
1 parent a97b392 commit 9fb460b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions fdbclient/ServerKnobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
init( PERPETUAL_WIGGLE_MIN_BYTES_BALANCE_RATIO, 0.85 );
init( PW_MAX_SS_LESSTHAN_MIN_BYTES_BALANCE_RATIO, 8 );
init( PERPETUAL_WIGGLE_DISABLE_REMOVER, true );
init( PERPETUAL_WIGGLE_PAUSE_AFTER_TSS_TARGET_MET, false ); if (isSimulated)PERPETUAL_WIGGLE_PAUSE_AFTER_TSS_TARGET_MET = deterministicRandom()->coinflip();
init( LOG_ON_COMPLETION_DELAY, DD_QUEUE_LOGGING_INTERVAL );
init( BEST_TEAM_MAX_TEAM_TRIES, 10 );
init( BEST_TEAM_OPTION_COUNT, 4 );
Expand Down
1 change: 1 addition & 0 deletions fdbclient/include/fdbclient/ServerKnobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class ServerKnobs : public KnobsImpl<ServerKnobs> {
// balanced/filledup before starting the next wiggle.
double PERPETUAL_WIGGLE_DELAY; // The max interval between the last wiggle finish and the next wiggle start
bool PERPETUAL_WIGGLE_DISABLE_REMOVER; // Whether the start of perpetual wiggle replace team remover
bool PERPETUAL_WIGGLE_PAUSE_AFTER_TSS_TARGET_MET;
double LOG_ON_COMPLETION_DELAY;
int BEST_TEAM_MAX_TEAM_TRIES;
int BEST_TEAM_OPTION_COUNT;
Expand Down
29 changes: 19 additions & 10 deletions fdbserver/DDTeamCollection.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2234,19 +2234,28 @@ class DDTeamCollectionImpl {
takeRest = self->server_info.size() <= self->configuration.storageTeamSize ||
self->machine_info.size() < self->configuration.storageTeamSize || imbalance;

if (SERVER_KNOBS->PERPETUAL_WIGGLE_PAUSE_AFTER_TSS_TARGET_MET &&
self->configuration.storageMigrationType == StorageMigrationType::DEFAULT) {
takeRest = takeRest || (self->getTargetTSSInDC() > 0 && self->reachTSSPairTarget());
}

// log the extra delay and change the wiggler state
if (takeRest) {
self->storageWiggler->setWiggleState(StorageWiggler::PAUSE);
if (self->configuration.storageMigrationType == StorageMigrationType::GRADUAL) {
TraceEvent(SevWarn, "PerpetualStorageWiggleSleep", self->distributorId)
.suppressFor(SERVER_KNOBS->PERPETUAL_WIGGLE_DELAY * 4)
.detail("ImbalanceFactor",
SERVER_KNOBS->PW_MAX_SS_LESSTHAN_MIN_BYTES_BALANCE_RATIO ? numSSToBeLoadBytesBalanced
: ratio)
.detail("ServerSize", self->server_info.size())
.detail("MachineSize", self->machine_info.size())
.detail("StorageTeamSize", self->configuration.storageTeamSize);
}
Severity sev =
self->configuration.storageMigrationType == StorageMigrationType::GRADUAL ? SevWarn : SevInfo;
TraceEvent(sev, "PerpetualStorageWiggleSleep", self->distributorId)
.suppressFor(SERVER_KNOBS->PERPETUAL_WIGGLE_DELAY * 4)
.detail("Primary", self->primary)
.detail("ImbalanceFactor",
SERVER_KNOBS->PW_MAX_SS_LESSTHAN_MIN_BYTES_BALANCE_RATIO ? numSSToBeLoadBytesBalanced
: ratio)
.detail("ServerSize", self->server_info.size())
.detail("MachineSize", self->machine_info.size())
.detail("StorageTeamSize", self->configuration.storageTeamSize)
.detail("TargetTSSInDC", self->getTargetTSSInDC())
.detail("ReachTSSPairTarget", self->reachTSSPairTarget())
.detail("MigrationType", self->configuration.storageMigrationType.toString());
}
}
return Void();
Expand Down

0 comments on commit 9fb460b

Please sign in to comment.