mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:44:12 +08:00
mdbx-test: don't fail "ttl" & "nested" testcases on key-space overflow.
Change-Id: I6788a02ecd88bec086b1d12c3d9246c8de59ed29
This commit is contained in:
parent
a9705c4f34
commit
d83a765dbe
@ -209,7 +209,10 @@ retry:
|
||||
|
||||
if (unlikely(!keyvalue_maker.increment(serial, 1))) {
|
||||
log_notice("nested: unexpected key-space overflow");
|
||||
return false;
|
||||
keyspace_overflow = true;
|
||||
head_count = n;
|
||||
stochastic_breakable_restart_with_nested(true);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,8 +281,8 @@ bool testcase_nested::run() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (should_continue() || !clear_wholetable_passed ||
|
||||
!clear_stepbystep_passed) {
|
||||
if (!keyspace_overflow && (should_continue() || !clear_wholetable_passed ||
|
||||
!clear_stepbystep_passed)) {
|
||||
unsigned underutilization_x256 =
|
||||
txn_underutilization_x256(txn_guard.get());
|
||||
if (dbfull_passed > underutilization_x256) {
|
||||
|
@ -301,6 +301,7 @@ class testcase_nested : public testcase {
|
||||
unsigned clear_wholetable_passed{0};
|
||||
unsigned clear_stepbystep_passed{0};
|
||||
unsigned dbfull_passed{0};
|
||||
bool keyspace_overflow{false};
|
||||
FIFO fifo;
|
||||
std::stack<std::tuple<scoped_txn_guard, uint64_t, FIFO, SET>> stack;
|
||||
|
||||
|
11
test/ttl.cc
11
test/ttl.cc
@ -81,6 +81,7 @@ bool testcase_ttl::run() {
|
||||
unsigned clear_stepbystep_passed = 0;
|
||||
unsigned dbfull_passed = 0;
|
||||
unsigned loops = 0;
|
||||
bool keyspace_overflow = false;
|
||||
while (true) {
|
||||
const uint64_t salt = prng64_white(seed) /* mdbx_txn_id(txn_guard.get()) */;
|
||||
|
||||
@ -134,8 +135,8 @@ bool testcase_ttl::run() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (should_continue() || !clear_wholetable_passed ||
|
||||
!clear_stepbystep_passed) {
|
||||
if (!keyspace_overflow && (should_continue() || !clear_wholetable_passed ||
|
||||
!clear_stepbystep_passed)) {
|
||||
unsigned underutilization_x256 =
|
||||
txn_underutilization_x256(txn_guard.get());
|
||||
if (dbfull_passed > underutilization_x256) {
|
||||
@ -165,7 +166,11 @@ bool testcase_ttl::run() {
|
||||
|
||||
if (unlikely(!keyvalue_maker.increment(serial, 1))) {
|
||||
log_notice("ttl: unexpected key-space overflow");
|
||||
goto bailout;
|
||||
keyspace_overflow = true;
|
||||
txn_restart(true, false);
|
||||
serial = fifo.front().first;
|
||||
fifo.front().second = head_count = n;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
err = breakable_restart();
|
||||
|
Loading…
x
Reference in New Issue
Block a user