fix: history tags were being incorrectly popped

fix: history tags were not cleared when a storage server was removed
This commit is contained in:
Evan Tschannen 2018-02-03 12:20:18 -08:00
parent ebd94bb654
commit 63a9f2aed6
2 changed files with 8 additions and 2 deletions

View File

@ -2002,9 +2002,10 @@ ACTOR Future<Void> popOldTags( Database cx, Reference<ILogSystem> logSystem, Ver
loop {
try {
state Future<Standalone<RangeResultRef>> fTagLocalities = tr.getRange( tagLocalityListKeys, CLIENT_KNOBS->TOO_MANY );
state Future<Standalone<RangeResultRef>> fTags = tr.getRange( serverTagKeys, CLIENT_KNOBS->TOO_MANY, true);
state Future<Standalone<RangeResultRef>> fTags = tr.getRange( serverTagKeys, CLIENT_KNOBS->TOO_MANY );
state Future<Standalone<RangeResultRef>> fHistoryTags = tr.getRange( serverTagHistoryKeys, CLIENT_KNOBS->TOO_MANY );
Void _ = wait( success(fTagLocalities) && success(fTags) );
Void _ = wait( success(fTagLocalities) && success(fTags) && success(fHistoryTags) );
state std::vector<Future<Void>> popActors;
state std::vector<Tag> tags;
@ -2013,6 +2014,10 @@ ACTOR Future<Void> popOldTags( Database cx, Reference<ILogSystem> logSystem, Ver
tags.push_back(decodeServerTagValue( kv.value ));
}
for(auto& kv : fHistoryTags.get()) {
tags.push_back(decodeServerTagValue( kv.value ));
}
//FIXME: we have to check the old locality indefinately, because we can never be sure when pops have succeeded, we can remove this code when we no longer need to support upgrades from 5.X to 6.0
popActors.push_back(popOldTags(&tr, logSystem, recoveryCommitVersion, tagLocalityUpgraded, tags));
for(auto& kv : fTagLocalities.get()) {

View File

@ -797,6 +797,7 @@ ACTOR Future<Void> removeStorageServer( Database cx, UID serverID, MoveKeysLock
tr.clear( serverListKeyFor(serverID) );
tr.clear( serverTagKeyFor(serverID) );
tr.clear( serverTagHistoryRangeFor(serverID) );
retry = true;
Void _ = wait( tr.commit() );
return Void();