mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx-testing: повтор сценария с mdbx_txn_copy2pathname()
до получения успешной копии для предотвращения сбоев test/CMakeLists.txt
.
This commit is contained in:
parent
69f85af242
commit
ee8c9225d6
@ -28,6 +28,7 @@ void testcase_copy::copy_db(const bool with_compaction) {
|
|||||||
: "mdbx_env_copy(MDBX_CP_ASIS)",
|
: "mdbx_env_copy(MDBX_CP_ASIS)",
|
||||||
err);
|
err);
|
||||||
} else {
|
} else {
|
||||||
|
do {
|
||||||
const bool ro = mode_readonly() || flipcoin();
|
const bool ro = mode_readonly() || flipcoin();
|
||||||
const bool throttle = ro && flipcoin();
|
const bool throttle = ro && flipcoin();
|
||||||
const bool dynsize = flipcoin();
|
const bool dynsize = flipcoin();
|
||||||
@ -40,13 +41,16 @@ void testcase_copy::copy_db(const bool with_compaction) {
|
|||||||
(flush ? MDBX_CP_DEFAULTS : MDBX_CP_DONT_FLUSH) |
|
(flush ? MDBX_CP_DEFAULTS : MDBX_CP_DONT_FLUSH) |
|
||||||
(enable_renew ? MDBX_CP_RENEW_TXN : MDBX_CP_DEFAULTS);
|
(enable_renew ? MDBX_CP_RENEW_TXN : MDBX_CP_DEFAULTS);
|
||||||
txn_begin(ro);
|
txn_begin(ro);
|
||||||
err = mdbx_txn_copy2pathname(txn_guard.get(), copy_pathname.c_str(), flags);
|
err =
|
||||||
|
mdbx_txn_copy2pathname(txn_guard.get(), copy_pathname.c_str(), flags);
|
||||||
if (unlikely(err != MDBX_SUCCESS && (!throttle || err != MDBX_OUSTED) &&
|
if (unlikely(err != MDBX_SUCCESS && (!throttle || err != MDBX_OUSTED) &&
|
||||||
(!enable_renew && err != MDBX_MVCC_RETARDED)))
|
(!enable_renew && err != MDBX_MVCC_RETARDED)))
|
||||||
failure_perror(with_compaction ? "mdbx_txn_copy2pathname(MDBX_CP_COMPACT)"
|
failure_perror(with_compaction
|
||||||
|
? "mdbx_txn_copy2pathname(MDBX_CP_COMPACT)"
|
||||||
: "mdbx_txn_copy2pathname(MDBX_CP_ASIS)",
|
: "mdbx_txn_copy2pathname(MDBX_CP_ASIS)",
|
||||||
err);
|
err);
|
||||||
txn_end(err != MDBX_SUCCESS || flipcoin());
|
txn_end(err != MDBX_SUCCESS || flipcoin());
|
||||||
|
} while (err != MDBX_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user