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