From c74e43f2d04f0154de194ed0790896e73a636c3b Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Wed, 27 Jun 2018 20:35:51 -0700 Subject: [PATCH] fix: during upgrades, a storage server which does not have data for a shard could be in the source servers, so as a fallback if a fetch keys fails long enough disable locality based load balancing to allow the storage server to peek from someone different than itself --- fdbserver/storageserver.actor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index e7c2309a3f..fc5056d593 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -1908,6 +1908,11 @@ ACTOR Future fetchKeys( StorageServer *data, AddingShard* shard ) { // Throw away deferred updates from before fetchVersion, since we don't need them to use blocks fetched at that version while (!shard->updates.empty() && shard->updates[0].version <= fetchVersion) shard->updates.pop_front(); + //FIXME: remove when we no longer support upgrades from 5.X + if(debug_getRangeRetries >= 100) { + data->cx->enableLocalityLoadBalance = false; + } + debug_getRangeRetries++; if (debug_nextRetryToLog==debug_getRangeRetries){ debug_nextRetryToLog += std::min(debug_nextRetryToLog, 1024); @@ -1922,6 +1927,9 @@ ACTOR Future fetchKeys( StorageServer *data, AddingShard* shard ) { } } + //FIXME: remove when we no longer support upgrades from 5.X + data->cx->enableLocalityLoadBalance = true; + // We have completed the fetch and write of the data, now we wait for MVCC window to pass. // As we have finished this work, we will allow more work to start... shard->fetchComplete.send(Void());