diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index 89f30dec34..c954e9e196 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -444,10 +444,8 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs, bool isSimula init( STORAGE_DURABILITY_LAG_SOFT_MAX, 200e6 ); if( smallStorageTarget ) STORAGE_DURABILITY_LAG_SOFT_MAX = 10e6; //FIXME: Low priority reads are disabled by assigning very high knob values, reduce knobs for 7.0 - init( LOW_PRIORITY_STORAGE_QUEUE_BYTES_START, 775e8 ); if( smallStorageTarget ) LOW_PRIORITY_STORAGE_QUEUE_BYTES_START = 1750e3; - init( LOW_PRIORITY_STORAGE_QUEUE_BYTES_END, 760e6 ); if( smallStorageTarget ) LOW_PRIORITY_STORAGE_QUEUE_BYTES_END = 1500e3; - init( LOW_PRIORITY_DURABILITY_LAG_START, 275e8 ); if( smallStorageTarget ) LOW_PRIORITY_DURABILITY_LAG_START = 15e6; - init( LOW_PRIORITY_DURABILITY_LAG_END, 260e6 ); if( smallStorageTarget ) LOW_PRIORITY_DURABILITY_LAG_END = 10e6; + init( LOW_PRIORITY_STORAGE_QUEUE_BYTES, 775e8 ); if( smallStorageTarget ) LOW_PRIORITY_STORAGE_QUEUE_BYTES = 1750e3; + init( LOW_PRIORITY_DURABILITY_LAG, 275e8 ); if( smallStorageTarget ) LOW_PRIORITY_DURABILITY_LAG = 15e6; bool smallTlogTarget = randomize && BUGGIFY; init( TARGET_BYTES_PER_TLOG, 2400e6 ); if( smallTlogTarget ) TARGET_BYTES_PER_TLOG = 2000e3; diff --git a/fdbserver/Knobs.h b/fdbserver/Knobs.h index 4017948aed..5f779a1c58 100644 --- a/fdbserver/Knobs.h +++ b/fdbserver/Knobs.h @@ -383,10 +383,8 @@ public: int64_t STORAGE_DURABILITY_LAG_HARD_MAX; int64_t STORAGE_DURABILITY_LAG_SOFT_MAX; - int64_t LOW_PRIORITY_STORAGE_QUEUE_BYTES_START; - int64_t LOW_PRIORITY_STORAGE_QUEUE_BYTES_END; - int64_t LOW_PRIORITY_DURABILITY_LAG_START; - int64_t LOW_PRIORITY_DURABILITY_LAG_END; + int64_t LOW_PRIORITY_STORAGE_QUEUE_BYTES; + int64_t LOW_PRIORITY_DURABILITY_LAG; int64_t TARGET_BYTES_PER_TLOG; int64_t SPRING_BYTES_TLOG; diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index 13af6c725a..7f71d0c33b 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -96,16 +96,6 @@ private: bool isClear; }; -ACTOR Future increasingPriorityDelay(Future change) { - choose { - when(wait(delay(0, TaskPriority::Low))){} - when(wait(change)) { - wait(delay(0, TaskPriority::DefaultEndpoint)); - } - } - return Void(); -} - struct AddingShard : NonCopyable { KeyRange keys; Future fetchClient; // holds FetchKeys() actor @@ -518,7 +508,6 @@ public: bool behind; bool versionBehind; - AsyncVar durabilityBehind; bool debug_inApplyUpdate; double debug_lastValidateTime; @@ -614,7 +603,7 @@ public: counters(this), tag(invalidTag), maxQueryQueue(0), thisServerID(ssi.id()), readQueueSizeMetric(LiteralStringRef("StorageServer.ReadQueueSize")), behind(false), versionBehind(false), byteSampleClears(false, LiteralStringRef("\xff\xff\xff")), noRecentUpdates(false), lastUpdate(now()), - poppedAllAfter(std::numeric_limits::max()), cpuUsage(0.0), diskUsage(0.0), durabilityBehind(false) { + poppedAllAfter(std::numeric_limits::max()), cpuUsage(0.0), diskUsage(0.0) { version.initMetric(LiteralStringRef("StorageServer.Version"), counters.cc.id); oldestVersion.initMetric(LiteralStringRef("StorageServer.OldestVersion"), counters.cc.id); durableVersion.initMetric(LiteralStringRef("StorageServer.DurableVersion"), counters.cc.id); @@ -695,27 +684,11 @@ public: (currentRate() < 1e-6 ? 1e6 : 1.0 / currentRate())); } - bool checkDurabilityBehind() { - return version.get() - durableVersion.get() > SERVER_KNOBS->LOW_PRIORITY_DURABILITY_LAG_END; - - /* - if(durabilityBehind.get()) { - durabilityBehind.set( - version.get() - durableVersion.get() > SERVER_KNOBS->LOW_PRIORITY_DURABILITY_LAG_END || - queueSize() > SERVER_KNOBS->LOW_PRIORITY_STORAGE_QUEUE_BYTES_END); - } else { - durabilityBehind.set( - version.get() - durableVersion.get() > SERVER_KNOBS->LOW_PRIORITY_DURABILITY_LAG_START || - queueSize() > SERVER_KNOBS->LOW_PRIORITY_STORAGE_QUEUE_BYTES_START ); - } - return durabilityBehind.get(); - */ - } - Future getQueryDelay() { - if(checkDurabilityBehind()) { + if((version.get() - durableVersion.get() > SERVER_KNOBS->LOW_PRIORITY_DURABILITY_LAG) || + (queueSize() > SERVER_KNOBS->LOW_PRIORITY_STORAGE_QUEUE_BYTES)) { ++counters.lowPriorityQueries; - return delay(0, TaskPriority::Low); //increasingPriorityDelay(durabilityBehind.onChange()); + return delay(0, TaskPriority::BehindReads); } return delay(0, TaskPriority::DefaultEndpoint); } diff --git a/flow/network.h b/flow/network.h index eb2105c468..08c24414a6 100644 --- a/flow/network.h +++ b/flow/network.h @@ -90,6 +90,7 @@ enum class TaskPriority { UpdateStorage = 3000, TLogSpilledPeekReply = 2800, FetchKeys = 2500, + BehindReads = 2200, Low = 2000, Min = 1000,