Skip to content

Commit

Permalink
WT-6610 It is not an error if the backup rename configuration is not … (
Browse files Browse the repository at this point in the history
#5966)

* WT-6610 It is not an error if the backup rename configuration is not found.

* Retain the value of ret.

* Add test covering upgrade with backup and rename

* Add back in the changes from WT-6215 and WT-6539

* Reinstate testing logic lost in merge/reapply

* Fixes if 'rename' is not in the configuration string.
Allow format compatibility to test incremental backup.

Co-authored-by: Alexander Gorrod <alexander.gorrod@mongodb.com>
  • Loading branch information
sueloverso and agorrod committed Aug 27, 2020
1 parent 1fd3405 commit 3aad1a7
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 89 deletions.
2 changes: 1 addition & 1 deletion dist/api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def __ge__(self, other):
intended for use with internal stress testing of WiredTiger.''',
type='list', undoc=True,
choices=[
'aggressive_sweep', 'checkpoint_slow', 'history_store_checkpoint_delay',
'aggressive_sweep', 'backup_rename', 'checkpoint_slow', 'history_store_checkpoint_delay',
'history_store_sweep_race', 'prepare_checkpoint_delay', 'split_1', 'split_2',
'split_3', 'split_4', 'split_5', 'split_6', 'split_7', 'split_8']),
Config('verbose', '', r'''
Expand Down
45 changes: 25 additions & 20 deletions src/config/config_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@ static const WT_CONFIG_CHECK confchk_WT_CONNECTION_reconfigure[] = {
{"statistics_log", "category", NULL, NULL,
confchk_WT_CONNECTION_reconfigure_statistics_log_subconfigs, 5},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"checkpoint_slow\","
"\"history_store_checkpoint_delay\",\"history_store_sweep_race\","
"\"prepare_checkpoint_delay\",\"split_1\",\"split_2\",\"split_3\""
",\"split_4\",\"split_5\",\"split_6\",\"split_7\",\"split_8\"]",
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_slow\",\"history_store_checkpoint_delay\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
"\"split_1\",\"split_2\",\"split_3\",\"split_4\",\"split_5\","
"\"split_6\",\"split_7\",\"split_8\"]",
NULL, 0},
{"verbose", "list", NULL,
"choices=[\"api\",\"backup\",\"block\",\"checkpoint\","
Expand Down Expand Up @@ -589,10 +590,11 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
NULL, 0},
{"statistics_log", "category", NULL, NULL, confchk_wiredtiger_open_statistics_log_subconfigs, 6},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"checkpoint_slow\","
"\"history_store_checkpoint_delay\",\"history_store_sweep_race\","
"\"prepare_checkpoint_delay\",\"split_1\",\"split_2\",\"split_3\""
",\"split_4\",\"split_5\",\"split_6\",\"split_7\",\"split_8\"]",
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_slow\",\"history_store_checkpoint_delay\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
"\"split_1\",\"split_2\",\"split_3\",\"split_4\",\"split_5\","
"\"split_6\",\"split_7\",\"split_8\"]",
NULL, 0},
{"transaction_sync", "category", NULL, NULL, confchk_wiredtiger_open_transaction_sync_subconfigs,
2},
Expand Down Expand Up @@ -666,10 +668,11 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = {
NULL, 0},
{"statistics_log", "category", NULL, NULL, confchk_wiredtiger_open_statistics_log_subconfigs, 6},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"checkpoint_slow\","
"\"history_store_checkpoint_delay\",\"history_store_sweep_race\","
"\"prepare_checkpoint_delay\",\"split_1\",\"split_2\",\"split_3\""
",\"split_4\",\"split_5\",\"split_6\",\"split_7\",\"split_8\"]",
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_slow\",\"history_store_checkpoint_delay\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
"\"split_1\",\"split_2\",\"split_3\",\"split_4\",\"split_5\","
"\"split_6\",\"split_7\",\"split_8\"]",
NULL, 0},
{"transaction_sync", "category", NULL, NULL, confchk_wiredtiger_open_transaction_sync_subconfigs,
2},
Expand Down Expand Up @@ -740,10 +743,11 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = {
NULL, 0},
{"statistics_log", "category", NULL, NULL, confchk_wiredtiger_open_statistics_log_subconfigs, 6},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"checkpoint_slow\","
"\"history_store_checkpoint_delay\",\"history_store_sweep_race\","
"\"prepare_checkpoint_delay\",\"split_1\",\"split_2\",\"split_3\""
",\"split_4\",\"split_5\",\"split_6\",\"split_7\",\"split_8\"]",
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_slow\",\"history_store_checkpoint_delay\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
"\"split_1\",\"split_2\",\"split_3\",\"split_4\",\"split_5\","
"\"split_6\",\"split_7\",\"split_8\"]",
NULL, 0},
{"transaction_sync", "category", NULL, NULL, confchk_wiredtiger_open_transaction_sync_subconfigs,
2},
Expand Down Expand Up @@ -812,10 +816,11 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = {
NULL, 0},
{"statistics_log", "category", NULL, NULL, confchk_wiredtiger_open_statistics_log_subconfigs, 6},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"checkpoint_slow\","
"\"history_store_checkpoint_delay\",\"history_store_sweep_race\","
"\"prepare_checkpoint_delay\",\"split_1\",\"split_2\",\"split_3\""
",\"split_4\",\"split_5\",\"split_6\",\"split_7\",\"split_8\"]",
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_slow\",\"history_store_checkpoint_delay\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
"\"split_1\",\"split_2\",\"split_3\",\"split_4\",\"split_5\","
"\"split_6\",\"split_7\",\"split_8\"]",
NULL, 0},
{"transaction_sync", "category", NULL, NULL, confchk_wiredtiger_open_transaction_sync_subconfigs,
2},
Expand Down
1 change: 1 addition & 0 deletions src/conn/conn_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,7 @@ __wt_timing_stress_config(WT_SESSION_IMPL *session, const char *cfg[])
*/
static const WT_NAME_FLAG stress_types[] = {
{"aggressive_sweep", WT_TIMING_STRESS_AGGRESSIVE_SWEEP},
{"backup_rename", WT_TIMING_STRESS_BACKUP_RENAME},
{"checkpoint_slow", WT_TIMING_STRESS_CHECKPOINT_SLOW},
{"history_store_checkpoint_delay", WT_TIMING_STRESS_HS_CHECKPOINT_DELAY},
{"history_store_sweep_race", WT_TIMING_STRESS_HS_SWEEP},
Expand Down
27 changes: 19 additions & 8 deletions src/cursor/cur_backup_incr.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ __curbackup_incr_blkmod(WT_SESSION_IMPL *session, WT_BTREE *btree, WT_CURSOR_BAC
cb->nbits = (uint64_t)b.val;
WT_ERR(__wt_config_subgets(session, &v, "offset", &b));
cb->offset = (uint64_t)b.val;
/*
* The rename configuration string component was added later. So don't error if we don't
* find it in the string. If we don't have it, we're not doing a rename.
*/
WT_ERR_NOTFOUND_OK(__wt_config_subgets(session, &v, "rename", &b), true);
if (ret == 0 && b.val)
F_SET(cb, WT_CURBACKUP_RENAME);
else
F_CLR(cb, WT_CURBACKUP_RENAME);

/*
* We found a match. Load the block information into the cursor.
Expand Down Expand Up @@ -112,7 +121,7 @@ __curbackup_incr_next(WT_CURSOR *cursor)
F_CLR(cursor, WT_CURSTD_RAW);

if (!F_ISSET(cb, WT_CURBACKUP_INCR_INIT) &&
(btree == NULL || F_ISSET(cb, WT_CURBACKUP_FORCE_FULL))) {
(btree == NULL || F_ISSET(cb, WT_CURBACKUP_FORCE_FULL | WT_CURBACKUP_RENAME))) {
/*
* We don't have this object's incremental information or it's a forced file copy. If this
* is a log file, use the full pathname that may include the log path.
Expand Down Expand Up @@ -155,19 +164,21 @@ __curbackup_incr_next(WT_CURSOR *cursor)
*/
WT_ERR(__curbackup_incr_blkmod(session, btree, cb));
/*
* There are three cases where we do not have block modification information for
* There are several cases where we do not have block modification information for
* the file. They are described and handled as follows:
*
* 1. Newly created file without checkpoint information. Return the whole file
* information.
* 2. File created and checkpointed before incremental backups were configured.
* 1. Renamed file. Always return the whole file information.
* 2. Newly created file without checkpoint information. Return the whole
* file information.
* 3. File created and checkpointed before incremental backups were configured.
* Return no file information as it was copied in the initial full backup.
* 3. File that has not been modified since the previous incremental backup.
* 4. File that has not been modified since the previous incremental backup.
* Return no file information as there is no new information.
*/
if (cb->bitstring.mem == NULL) {
if (cb->bitstring.mem == NULL || F_ISSET(cb, WT_CURBACKUP_RENAME)) {
F_SET(cb, WT_CURBACKUP_INCR_INIT);
if (F_ISSET(cb, WT_CURBACKUP_CKPT_FAKE) && F_ISSET(cb, WT_CURBACKUP_HAS_CB_INFO)) {
if (F_ISSET(cb, WT_CURBACKUP_RENAME) ||
(F_ISSET(cb, WT_CURBACKUP_CKPT_FAKE) && F_ISSET(cb, WT_CURBACKUP_HAS_CB_INFO))) {
WT_ERR(__wt_fs_size(session, cb->incr_file, &size));
__wt_cursor_set_key(cursor, 0, size, WT_BACKUP_FILE);
goto done;
Expand Down
25 changes: 13 additions & 12 deletions src/include/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,18 +509,19 @@ struct __wt_connection_impl {
*/
/* AUTOMATIC FLAG VALUE GENERATION START */
#define WT_TIMING_STRESS_AGGRESSIVE_SWEEP 0x0001u
#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x0002u
#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x0004u
#define WT_TIMING_STRESS_HS_SWEEP 0x0008u
#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x0010u
#define WT_TIMING_STRESS_SPLIT_1 0x0020u
#define WT_TIMING_STRESS_SPLIT_2 0x0040u
#define WT_TIMING_STRESS_SPLIT_3 0x0080u
#define WT_TIMING_STRESS_SPLIT_4 0x0100u
#define WT_TIMING_STRESS_SPLIT_5 0x0200u
#define WT_TIMING_STRESS_SPLIT_6 0x0400u
#define WT_TIMING_STRESS_SPLIT_7 0x0800u
#define WT_TIMING_STRESS_SPLIT_8 0x1000u
#define WT_TIMING_STRESS_BACKUP_RENAME 0x0002u
#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x0004u
#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x0008u
#define WT_TIMING_STRESS_HS_SWEEP 0x0010u
#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x0020u
#define WT_TIMING_STRESS_SPLIT_1 0x0040u
#define WT_TIMING_STRESS_SPLIT_2 0x0080u
#define WT_TIMING_STRESS_SPLIT_3 0x0100u
#define WT_TIMING_STRESS_SPLIT_4 0x0200u
#define WT_TIMING_STRESS_SPLIT_5 0x0400u
#define WT_TIMING_STRESS_SPLIT_6 0x0800u
#define WT_TIMING_STRESS_SPLIT_7 0x1000u
#define WT_TIMING_STRESS_SPLIT_8 0x2000u
/* AUTOMATIC FLAG VALUE GENERATION STOP */
uint64_t timing_stress_flags;

Expand Down
19 changes: 10 additions & 9 deletions src/include/cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@ struct __wt_cursor_backup {
uint64_t granularity; /* Length, transfer size */

/* AUTOMATIC FLAG VALUE GENERATION START */
#define WT_CURBACKUP_CKPT_FAKE 0x01u /* Object has fake checkpoint */
#define WT_CURBACKUP_DUP 0x02u /* Duplicated backup cursor */
#define WT_CURBACKUP_FORCE_FULL 0x04u /* Force full file copy for this cursor */
#define WT_CURBACKUP_FORCE_STOP 0x08u /* Force stop incremental backup */
#define WT_CURBACKUP_HAS_CB_INFO 0x10u /* Object has checkpoint backup info */
#define WT_CURBACKUP_INCR 0x20u /* Incremental backup cursor */
#define WT_CURBACKUP_INCR_INIT 0x40u /* Cursor traversal initialized */
#define WT_CURBACKUP_LOCKER 0x80u /* Hot-backup started */
/* AUTOMATIC FLAG VALUE GENERATION STOP */
#define WT_CURBACKUP_CKPT_FAKE 0x001u /* Object has fake checkpoint */
#define WT_CURBACKUP_DUP 0x002u /* Duplicated backup cursor */
#define WT_CURBACKUP_FORCE_FULL 0x004u /* Force full file copy for this cursor */
#define WT_CURBACKUP_FORCE_STOP 0x008u /* Force stop incremental backup */
#define WT_CURBACKUP_HAS_CB_INFO 0x010u /* Object has checkpoint backup info */
#define WT_CURBACKUP_INCR 0x020u /* Incremental backup cursor */
#define WT_CURBACKUP_INCR_INIT 0x040u /* Cursor traversal initialized */
#define WT_CURBACKUP_LOCKER 0x080u /* Hot-backup started */
#define WT_CURBACKUP_RENAME 0x100u /* Object had a rename */
/* AUTOMATIC FLAG VALUE GENERATION STOP */
uint32_t flags;
};

Expand Down
4 changes: 4 additions & 0 deletions src/include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[])
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_close_connection_close(WT_SESSION_IMPL *session)
Expand Down Expand Up @@ -1032,6 +1034,8 @@ extern int __wt_meta_apply_all(WT_SESSION_IMPL *session,
int (*file_func)(WT_SESSION_IMPL *, const char *[]),
int (*name_func)(WT_SESSION_IMPL *, const char *, bool *), const char *cfg[])
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_meta_blk_mods_load(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt,
bool rename) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_meta_block_metadata(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_meta_checkpoint(WT_SESSION_IMPL *session, const char *fname, const char *checkpoint,
Expand Down
5 changes: 3 additions & 2 deletions src/include/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ struct __wt_block_mods {
uint64_t offset; /* Zero bit offset for bitstring */
uint64_t granularity;
/* AUTOMATIC FLAG VALUE GENERATION START */
#define WT_BLOCK_MODS_VALID 0x1u /* Entry is valid */
/* AUTOMATIC FLAG VALUE GENERATION STOP */
#define WT_BLOCK_MODS_RENAME 0x1u /* Entry is from a rename */
#define WT_BLOCK_MODS_VALID 0x2u /* Entry is valid */
/* AUTOMATIC FLAG VALUE GENERATION STOP */
uint32_t flags;
};

Expand Down
85 changes: 60 additions & 25 deletions src/meta/meta_ckpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
static int __ckpt_last(WT_SESSION_IMPL *, const char *, WT_CKPT *);
static int __ckpt_last_name(WT_SESSION_IMPL *, const char *, const char **);
static int __ckpt_load(WT_SESSION_IMPL *, WT_CONFIG_ITEM *, WT_CONFIG_ITEM *, WT_CKPT *);
static int __ckpt_load_blk_mods(WT_SESSION_IMPL *, const char *, WT_CKPT *);
static int __ckpt_named(WT_SESSION_IMPL *, const char *, const char *, WT_CKPT *);
static int __ckpt_set(WT_SESSION_IMPL *, const char *, const char *, bool);
static int __ckpt_version_chk(WT_SESSION_IMPL *, const char *, const char *);
Expand Down Expand Up @@ -73,6 +72,16 @@ __ckpt_load_blk_mods(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt
blk_mod->nbits = (uint64_t)b.val;
WT_RET(__wt_config_subgets(session, &v, "offset", &b));
blk_mod->offset = (uint64_t)b.val;
/*
* The rename configuration string component was added later. So don't error if we don't
* find it in the string. If we don't have it, we're not doing a rename.
*/
ret = __wt_config_subgets(session, &v, "rename", &b);
WT_RET_NOTFOUND_OK(ret);
if (ret == 0 && b.val)
F_SET(blk_mod, WT_BLOCK_MODS_RENAME);
else
F_CLR(blk_mod, WT_BLOCK_MODS_RENAME);
ret = __wt_config_subgets(session, &v, "blocks", &b);
WT_RET_NOTFOUND_OK(ret);
if (ret != WT_NOTFOUND) {
Expand Down Expand Up @@ -387,7 +396,7 @@ __ckpt_compare_order(const void *a, const void *b)
* information.
*/
static int
__ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt)
__ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt, bool rename)
{
WT_BLKINCR *blk;
WT_BLOCK_MODS *blk_mod;
Expand Down Expand Up @@ -425,6 +434,10 @@ __ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt)
setup = true;
}

/* If we are keeping or setting up an entry on a rename, set the flag. */
if (rename && (!free || setup))
F_SET(blk_mod, WT_BLOCK_MODS_RENAME);

/* Free any old information if we need to do so. */
if (free && F_ISSET(blk_mod, WT_BLOCK_MODS_VALID)) {
__wt_free(session, blk_mod->id_str);
Expand All @@ -448,6 +461,32 @@ __ckpt_valid_blk_mods(WT_SESSION_IMPL *session, WT_CKPT *ckpt)
return (0);
}

/*
* __wt_meta_blk_mods_load --
* Load the block mods for a given checkpoint and set up all the information to store.
*/
int
__wt_meta_blk_mods_load(WT_SESSION_IMPL *session, const char *config, WT_CKPT *ckpt, bool rename)
{
/*
* Load most recent checkpoint backup blocks to this checkpoint.
*/
WT_RET(__ckpt_load_blk_mods(session, config, ckpt));

WT_RET(__wt_meta_block_metadata(session, config, ckpt));

/*
* Set the add-a-checkpoint flag, and if we're doing incremental backups, request a list of the
* checkpoint's modified blocks from the block manager.
*/
F_SET(ckpt, WT_CKPT_ADD);
if (F_ISSET(S2C(session), WT_CONN_INCR_BACKUP)) {
F_SET(ckpt, WT_CKPT_BLOCK_MODS);
WT_RET(__ckpt_valid_blk_mods(session, ckpt, rename));
}
return (0);
}

/*
* __wt_meta_ckptlist_get --
* Load all available checkpoint information for a file.
Expand Down Expand Up @@ -522,22 +561,7 @@ __wt_meta_ckptlist_get(
__wt_atomic_cas64(&conn->ckpt_most_recent, most_recent, ckpt->sec))
break;
}
/*
* Load most recent checkpoint backup blocks to this checkpoint.
*/
WT_ERR(__ckpt_load_blk_mods(session, config, ckpt));

WT_ERR(__wt_meta_block_metadata(session, config, ckpt));

/*
* Set the add-a-checkpoint flag, and if we're doing incremental backups, request a list of
* the checkpoint's modified blocks from the block manager.
*/
F_SET(ckpt, WT_CKPT_ADD);
if (F_ISSET(conn, WT_CONN_INCR_BACKUP)) {
F_SET(ckpt, WT_CKPT_BLOCK_MODS);
WT_ERR(__ckpt_valid_blk_mods(session, ckpt));
}
WT_ERR(__wt_meta_blk_mods_load(session, config, ckpt, false));
}

/* Return the array to our caller. */
Expand Down Expand Up @@ -763,19 +787,19 @@ __wt_meta_ckptlist_to_meta(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, WT_ITEM
}

/*
* __ckpt_blkmod_to_meta --
* __wt_ckpt_blkmod_to_meta --
* Add in any modification block string needed, including an empty one.
*/
static int
__ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt)
int
__wt_ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt)
{
WT_BLOCK_MODS *blk;
WT_ITEM bitstring;
u_int i;
bool valid;
bool skip_rename, valid;

WT_CLEAR(bitstring);
valid = false;
skip_rename = valid = false;
for (i = 0, blk = &ckpt->backup_blocks[0]; i < WT_BLKINCR_MAX; ++i, ++blk)
if (F_ISSET(blk, WT_BLOCK_MODS_VALID))
valid = true;
Expand All @@ -795,11 +819,22 @@ __ckpt_blkmod_to_meta(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_CKPT *ckpt)
for (i = 0, blk = &ckpt->backup_blocks[0]; i < WT_BLKINCR_MAX; ++i, ++blk) {
if (!F_ISSET(blk, WT_BLOCK_MODS_VALID))
continue;

/*
* Occasionally skip including the rename string at all when it's not necessary for
* correctness, that lets us simulate what is generated in the config string by earlier
* versions of WiredTiger
*/
if (FLD_ISSET(S2C(session)->timing_stress_flags, WT_TIMING_STRESS_BACKUP_RENAME) &&
!F_ISSET(blk, WT_BLOCK_MODS_RENAME) && __wt_random(&session->rnd) % 10 == 0)
skip_rename = true;

WT_RET(__wt_raw_to_hex(session, blk->bitstring.data, blk->bitstring.size, &bitstring));
WT_RET(__wt_buf_catfmt(session, buf,
"%s\"%s\"=(id=%" PRIu32 ",granularity=%" PRIu64 ",nbits=%" PRIu64 ",offset=%" PRIu64
",blocks=%.*s)",
"%s,blocks=%.*s)",
i == 0 ? "" : ",", blk->id_str, i, blk->granularity, blk->nbits, blk->offset,
skip_rename ? "" : F_ISSET(blk, WT_BLOCK_MODS_RENAME) ? ",rename=1" : ",rename=0",
(int)bitstring.size, (char *)bitstring.data));
/* The hex string length should match the appropriate number of bits. */
WT_ASSERT(session, (blk->nbits >> 2) <= bitstring.size);
Expand Down Expand Up @@ -828,7 +863,7 @@ __wt_meta_ckptlist_set(
/* Add backup block modifications for any added checkpoint. */
WT_CKPT_FOREACH (ckptbase, ckpt)
if (F_ISSET(ckpt, WT_CKPT_ADD))
WT_ERR(__ckpt_blkmod_to_meta(session, buf, ckpt));
WT_ERR(__wt_ckpt_blkmod_to_meta(session, buf, ckpt));

has_lsn = ckptlsn != NULL;
if (ckptlsn != NULL)
Expand Down
Loading

0 comments on commit 3aad1a7

Please sign in to comment.