diff --git a/fdbserver/DataDistributionTracker.actor.cpp b/fdbserver/DataDistributionTracker.actor.cpp index e327ab2ca0..bc1286ebb4 100644 --- a/fdbserver/DataDistributionTracker.actor.cpp +++ b/fdbserver/DataDistributionTracker.actor.cpp @@ -311,7 +311,11 @@ ACTOR Future changeSizes( DataDistributionTracker* self, KeyRange keys, in } struct HasBeenTrueFor : NonCopyable { - explicit HasBeenTrueFor( bool value ) : trigger( value ? Void() : Future() ) {} + explicit HasBeenTrueFor( Optional value ) { + if(value.present()) { + trigger = delayJittered(std::max(0.0, SERVER_KNOBS->DD_MERGE_COALESCE_DELAY + value.get().lastLowBandwidthStartTime - now()), decrementPriority(TaskPriority::DataDistribution) ) || cleared.getFuture(); + } + } Future set() { if( !trigger.isValid() ) { @@ -420,7 +424,7 @@ Future shardMerger( KeyRangeRef merged; StorageMetrics endingStats = shardSize->get().get().metrics; double lastLowBandwidthStartTime = shardSize->get().get().lastLowBandwidthStartTime; - if(SERVER_KNOBS->DD_MERGE_COALESCE_DELAY > SERVER_KNOBS->DD_LOW_BANDWIDTH_DELAY && now() - lastLowBandwidthStartTime < SERVER_KNOBS->DD_LOW_BANDWIDTH_DELAY) { + if(FLOW_KNOBS->DELAY_JITTER_OFFSET*SERVER_KNOBS->DD_MERGE_COALESCE_DELAY > SERVER_KNOBS->DD_LOW_BANDWIDTH_DELAY && now() - lastLowBandwidthStartTime < SERVER_KNOBS->DD_LOW_BANDWIDTH_DELAY) { TraceEvent( g_network->isSimulated() ? SevError : SevWarnAlways, "ShardMergeTooSoon", self->distributorId).detail("Keys", keys); } @@ -570,7 +574,7 @@ ACTOR Future shardTracker( Reference>> shardSize) { // Survives multiple calls to shardEvaluator and keeps merges from happening too quickly. - state HasBeenTrueFor wantsToMerge( shardSize->get().present() ); + state HasBeenTrueFor wantsToMerge( shardSize->get() ); wait( yieldedFuture(self->readyToStart.getFuture()) ); diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index f23e054dac..3962f16bcf 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -181,7 +181,7 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs, bool isSimula init( DATA_DISTRIBUTION_LOGGING_INTERVAL, 5.0 ); init( DD_ENABLED_CHECK_DELAY, 1.0 ); init( DD_STALL_CHECK_DELAY, 0.4 ); //Must be larger than 2*MAX_BUGGIFIED_DELAY - init( DD_LOW_BANDWIDTH_DELAY, isSimulated ? 100.0 : 280.0 ); if( randomize && BUGGIFY ) DD_LOW_BANDWIDTH_DELAY = 0; + init( DD_LOW_BANDWIDTH_DELAY, isSimulated ? 90.0 : 240.0 ); if( randomize && BUGGIFY ) DD_LOW_BANDWIDTH_DELAY = 0; //Because of delayJitter, this should be less than 0.9 * DD_MERGE_COALESCE_DELAY init( DD_MERGE_COALESCE_DELAY, isSimulated ? 120.0 : 300.0 ); if( randomize && BUGGIFY ) DD_MERGE_COALESCE_DELAY = 0.001; init( STORAGE_METRICS_POLLING_DELAY, 2.0 ); if( randomize && BUGGIFY ) STORAGE_METRICS_POLLING_DELAY = 15.0; init( STORAGE_METRICS_RANDOM_DELAY, 0.2 );