From 7b713f7fd2ea471926bc8c4e9ff48030aefcefce Mon Sep 17 00:00:00 2001 From: Xiaoxi Wang Date: Wed, 23 Jun 2021 05:49:55 +0000 Subject: [PATCH] add knob --- fdbclient/ServerKnobs.cpp | 1 + fdbclient/ServerKnobs.h | 1 + fdbserver/DataDistribution.actor.cpp | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fdbclient/ServerKnobs.cpp b/fdbclient/ServerKnobs.cpp index 38e7beb341..8cbb77defb 100644 --- a/fdbclient/ServerKnobs.cpp +++ b/fdbclient/ServerKnobs.cpp @@ -210,6 +210,7 @@ void ServerKnobs::initialize(Randomize _randomize, ClientKnobs* clientKnobs, IsS init( ALL_DATA_REMOVED_DELAY, 1.0 ); init( INITIAL_FAILURE_REACTION_DELAY, 30.0 ); if( randomize && BUGGIFY ) INITIAL_FAILURE_REACTION_DELAY = 0.0; init( CHECK_TEAM_DELAY, 30.0 ); + init( PERPETUAL_WIGGLE_DELAY, 50.0 ); init( LOG_ON_COMPLETION_DELAY, DD_QUEUE_LOGGING_INTERVAL ); init( BEST_TEAM_MAX_TEAM_TRIES, 10 ); init( BEST_TEAM_OPTION_COUNT, 4 ); diff --git a/fdbclient/ServerKnobs.h b/fdbclient/ServerKnobs.h index c704541a2e..30468c7e84 100644 --- a/fdbclient/ServerKnobs.h +++ b/fdbclient/ServerKnobs.h @@ -160,6 +160,7 @@ public: double ALL_DATA_REMOVED_DELAY; double INITIAL_FAILURE_REACTION_DELAY; double CHECK_TEAM_DELAY; + double PERPETUAL_WIGGLE_DELAY; double LOG_ON_COMPLETION_DELAY; int BEST_TEAM_MAX_TEAM_TRIES; int BEST_TEAM_OPTION_COUNT; diff --git a/fdbserver/DataDistribution.actor.cpp b/fdbserver/DataDistribution.actor.cpp index 08a9143167..3dd6aceeec 100644 --- a/fdbserver/DataDistribution.actor.cpp +++ b/fdbserver/DataDistribution.actor.cpp @@ -3936,14 +3936,17 @@ ACTOR Future updateNextWigglingStoragePID(DDTeamCollection* teamCollection ACTOR Future perpetualStorageWiggleIterator(AsyncVar* stopSignal, FutureStream finishStorageWiggleSignal, DDTeamCollection* teamCollection) { + state int lastFinishTime = now(); loop { choose { when(wait(stopSignal->onChange())) {} when(waitNext(finishStorageWiggleSignal)) { - // there must not have other teams to place wiggled data - while (teamCollection->server_info.size() <= teamCollection->configuration.storageTeamSize || - teamCollection->machine_info.size() < teamCollection->configuration.storageTeamSize) { - wait(delayJittered(SERVER_KNOBS->CHECK_TEAM_DELAY)); + state bool takeRest = true; // delay to avoid delete and update ServerList too frequently + while (takeRest) { + wait(delayJittered(SERVER_KNOBS->PERPETUAL_WIGGLE_DELAY)); + // there must not have other teams to place wiggled data + takeRest = teamCollection->server_info.size() <= teamCollection->configuration.storageTeamSize || + teamCollection->machine_info.size() < teamCollection->configuration.storageTeamSize; } wait(updateNextWigglingStoragePID(teamCollection)); }