mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +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)",
|
||||
err);
|
||||
} else {
|
||||
do {
|
||||
const bool ro = mode_readonly() || flipcoin();
|
||||
const bool throttle = ro && 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) |
|
||||
(enable_renew ? MDBX_CP_RENEW_TXN : MDBX_CP_DEFAULTS);
|
||||
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) &&
|
||||
(!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)",
|
||||
err);
|
||||
txn_end(err != MDBX_SUCCESS || flipcoin());
|
||||
} while (err != MDBX_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user