Merge pull request #4747 from sfc-gh-anoyes/anoyes/fix-clang-unseed-mismatch

Use a deterministic iteration order for committing in the special key…
This commit is contained in:
Andrew Noyes 2021-05-05 10:03:29 -07:00 committed by GitHub
commit 5e7f83b22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -572,16 +572,20 @@ ACTOR Future<Void> commitActor(SpecialKeySpace* sks, ReadYourWritesTransaction*
state RangeMap<Key, std::pair<bool, Optional<Value>>, KeyRangeRef>::Ranges ranges =
ryw->getSpecialKeySpaceWriteMap().containedRanges(specialKeys);
state RangeMap<Key, std::pair<bool, Optional<Value>>, KeyRangeRef>::iterator iter = ranges.begin();
state std::set<SpecialKeyRangeRWImpl*> writeModulePtrs;
state std::vector<SpecialKeyRangeRWImpl*> writeModulePtrs;
std::unordered_set<SpecialKeyRangeRWImpl*> deduplicate;
while (iter != ranges.end()) {
std::pair<bool, Optional<Value>> entry = iter->value();
if (entry.first) {
auto modulePtr = sks->getRWImpls().rangeContaining(iter->begin())->value();
writeModulePtrs.insert(modulePtr);
auto [_, inserted] = deduplicate.insert(modulePtr);
if (inserted) {
writeModulePtrs.push_back(modulePtr);
}
}
++iter;
}
state std::set<SpecialKeyRangeRWImpl*>::const_iterator it;
state std::vector<SpecialKeyRangeRWImpl*>::const_iterator it;
for (it = writeModulePtrs.begin(); it != writeModulePtrs.end(); ++it) {
Optional<std::string> msg = wait((*it)->commit(ryw));
if (msg.present()) {