Increase trState->totalCost by one with each clear
This commit is contained in:
parent
6251e8be32
commit
92bbcebed9
|
@ -5816,6 +5816,10 @@ void Transaction::clear(const KeyRangeRef& range, AddConflictRange addConflictRa
|
|||
return;
|
||||
|
||||
t.mutations.emplace_back(req.arena, MutationRef::ClearRange, r.begin, r.end);
|
||||
// NOTE: The throttling cost of each clear is assumed to be one page.
|
||||
// This makes compuation fast, but can be inaccurate and may
|
||||
// underestimate the cost of large clears.
|
||||
++trState->totalCost;
|
||||
|
||||
if (addConflictRange)
|
||||
t.write_conflict_ranges.push_back(req.arena, r);
|
||||
|
|
|
@ -115,10 +115,7 @@ class TransactionCostWorkload : public TestWorkload {
|
|||
return Void();
|
||||
}
|
||||
|
||||
int64_t expectedFinalCost() const override {
|
||||
// Clears are not measured in Transaction::getTotalCost
|
||||
return 0;
|
||||
}
|
||||
int64_t expectedFinalCost() const override { return 1; }
|
||||
};
|
||||
|
||||
class ReadRangeTest : public ITest {
|
||||
|
|
Loading…
Reference in New Issue