| 5585 | } |
| 5586 | |
| 5587 | void Transaction::addReadConflictRange(KeyRangeRef const& keys) { |
| 5588 | ASSERT(!keys.empty()); |
| 5589 | |
| 5590 | // There aren't any keys in the database with size larger than the max key size, so if range contains large keys |
| 5591 | // we can translate it to an equivalent one with smaller keys |
| 5592 | KeyRef begin = keys.begin; |
| 5593 | KeyRef end = keys.end; |
| 5594 | |
| 5595 | int64_t beginMaxSize = getMaxReadKeySize(begin); |
| 5596 | int64_t endMaxSize = getMaxReadKeySize(end); |
| 5597 | if (begin.size() > beginMaxSize) { |
| 5598 | begin = begin.substr(0, beginMaxSize + 1); |
| 5599 | } |
| 5600 | if (end.size() > endMaxSize) { |
| 5601 | end = end.substr(0, endMaxSize + 1); |
| 5602 | } |
| 5603 | |
| 5604 | KeyRangeRef r = KeyRangeRef(begin, end); |
| 5605 | |
| 5606 | if (r.empty()) { |
| 5607 | return; |
| 5608 | } |
| 5609 | |
| 5610 | tr.transaction.read_conflict_ranges.push_back_deep(tr.arena, r); |
| 5611 | } |
| 5612 | |
| 5613 | void Transaction::makeSelfConflicting() { |
| 5614 | BinaryWriter wr(Unversioned()); |
nothing calls this directly
no test coverage detected