Drain all pending work in hashtable's setOldestVersion
This commit is contained in:
@@ -60,7 +60,6 @@ void benchConflictSet() {
|
||||
ConflictSet cs{0};
|
||||
|
||||
bench.batch(kOpsPerTx);
|
||||
bench.minEpochIterations(10000);
|
||||
|
||||
int64_t version = 0;
|
||||
|
||||
@@ -239,6 +238,8 @@ void benchConflictSet() {
|
||||
|
||||
cs.setOldestVersion(version - kMvccWindow);
|
||||
|
||||
bench.minEpochIterations(1000000);
|
||||
|
||||
{
|
||||
bench.run("monotonic increasing point writes", [&]() {
|
||||
auto v = ++version;
|
||||
|
@@ -56,16 +56,18 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
|
||||
return;
|
||||
}
|
||||
auto iter = map.find(removalKey);
|
||||
while (keyUpdates > 0) {
|
||||
if (iter == map.end()) {
|
||||
iter = map.begin();
|
||||
}
|
||||
for (; keyUpdates > 0 && iter != map.end(); --keyUpdates) {
|
||||
for (; iter != map.end(); --keyUpdates) {
|
||||
if (iter->second <= oldestVersion) {
|
||||
iter = map.erase(iter);
|
||||
} else {
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iter == map.end()) {
|
||||
removalKey.clear();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user