fix: switchConnectionFile could get the proxies out of the clientInfo and continue connecting to the wrong cluster

This commit is contained in:
Evan Tschannen 2019-07-30 16:32:26 -07:00
parent d8b14fe372
commit 5c978f6129
1 changed files with 5 additions and 1 deletions

View File

@ -729,11 +729,15 @@ ACTOR static Future<Void> switchConnectionFileImpl(Reference<ClusterConnectionFi
// Reset state from former cluster.
self->masterProxies.clear();
self->masterProxiesChangeTrigger.trigger();
self->minAcceptableReadVersion = std::numeric_limits<Version>::max();
self->invalidateCache(allKeys);
auto clearedClientInfo = self->clientInfo->get();
clearedClientInfo.proxies.clear();
clearedClientInfo.id = deterministicRandom()->randomUniqueID();
self->clientInfo->set(clearedClientInfo);
self->connectionFile->set(connFile);
state Database db(Reference<DatabaseContext>::addRef(self));
state Transaction tr(db);
loop {