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

This commit is contained in:
Evan Tschannen 2018-06-27 20:35:51 -07:00
parent 2987f85177
commit c74e43f2d0
1 changed files with 8 additions and 0 deletions

View File

@ -1908,6 +1908,11 @@ ACTOR Future<Void> 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<Void> 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());