mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-05 12:52:20 +08:00
mdbx-test: adds more jitter while DB opening.
Change-Id: Ic0f03f4fbe064ea00f719baa11b28cc24aafcb5b
This commit is contained in:
@@ -1212,7 +1212,7 @@ static __inline pgno_t pgno_sub(pgno_t base, pgno_t subtrahend) {
|
||||
}
|
||||
|
||||
static __inline void mdbx_jitter4testing(bool tiny) {
|
||||
#ifndef NDEBUG
|
||||
#if MDBX_DEBUG
|
||||
if (MDBX_DBG_JITTER & mdbx_runtime_flags)
|
||||
mdbx_osal_jitter(tiny);
|
||||
#else
|
||||
|
@@ -11639,6 +11639,7 @@ static int __cold mdbx_env_copy_asis(MDBX_env *env, MDBX_txn *read_txn,
|
||||
return rc;
|
||||
}
|
||||
|
||||
mdbx_jitter4testing(false);
|
||||
const size_t meta_bytes = pgno2bytes(env, NUM_METAS);
|
||||
/* Make a snapshot of meta-pages,
|
||||
* but writing ones after the data was flushed */
|
||||
@@ -11654,6 +11655,7 @@ static int __cold mdbx_env_copy_asis(MDBX_env *env, MDBX_txn *read_txn,
|
||||
|
||||
/* Copy the data */
|
||||
const size_t data_bytes = pgno2bytes(env, read_txn->mt_next_pgno);
|
||||
mdbx_jitter4testing(false);
|
||||
#if __GLIBC_PREREQ(2, 27)
|
||||
for (off_t in_offset = meta_bytes; in_offset < (off_t)data_bytes;) {
|
||||
off_t out_offset = in_offset;
|
||||
|
Reference in New Issue
Block a user