summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWill Korteland <will.korteland@mongodb.com>2022-03-24 05:03:55 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-24 05:35:56 +0000
commit1842f6a33d9b5e668af7c03f5e1fe899dcf2b279 (patch)
treeec8afebf1ee5f8d64d0e0b30e956445a8a20ebc3 /src
parent84d4191d2c86740469b91da76471386812372992 (diff)
downloadmongo-1842f6a33d9b5e668af7c03f5e1fe899dcf2b279.tar.gz
Import wiredtiger: e53cae78535950f1a36b1c7f5c306fef67fcfbaa from branch mongodb-master
ref: a2ec68905a..e53cae7853 for: 6.0.0 WT-8265 Add an option to wt verify utility to turn off txnid clearing
Diffstat (limited to 'src')
-rw-r--r--src/third_party/wiredtiger/dist/api_data.py4
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_vrfy.c6
-rw-r--r--src/third_party/wiredtiger/src/config/config_def.c9
-rw-r--r--src/third_party/wiredtiger/src/include/cell_inline.h3
-rw-r--r--src/third_party/wiredtiger/src/include/session.h29
-rw-r--r--src/third_party/wiredtiger/src/include/wiredtiger.in2
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c5
-rw-r--r--src/third_party/wiredtiger/src/utilities/util_verify.c27
9 files changed, 55 insertions, 32 deletions
diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py
index 35a735442c8..fd60c37507b 100644
--- a/src/third_party/wiredtiger/dist/api_data.py
+++ b/src/third_party/wiredtiger/dist/api_data.py
@@ -1697,6 +1697,10 @@ methods = {
'WT_SESSION.truncate' : Method([]),
'WT_SESSION.upgrade' : Method([]),
'WT_SESSION.verify' : Method([
+ Config('do_not_clear_txn_id', 'false', r'''
+ Turn off transaction id clearing, intended for debugging and better
+ diagnosis of crashes or failures.''',
+ type='boolean'),
Config('dump_address', 'false', r'''
Display page addresses, time windows, and page types as
pages are verified, using the application's message handler,
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index aa8b9441c28..31e60aa762d 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "a2ec68905add46df8661ff50073f595ef2c79eae"
+ "commit": "e53cae78535950f1a36b1c7f5c306fef67fcfbaa"
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy.c b/src/third_party/wiredtiger/src/btree/bt_vrfy.c
index 20ac38c41f8..5de2cfdcc1c 100644
--- a/src/third_party/wiredtiger/src/btree/bt_vrfy.c
+++ b/src/third_party/wiredtiger/src/btree/bt_vrfy.c
@@ -60,6 +60,12 @@ __verify_config(WT_SESSION_IMPL *session, const char *cfg[], WT_VSTUFF *vs)
txn_global = &S2C(session)->txn_global;
+ WT_RET(__wt_config_gets(session, cfg, "do_not_clear_txn_id", &cval));
+ if (cval.val)
+ F_SET(session, WT_SESSION_DEBUG_DO_NOT_CLEAR_TXN_ID);
+ else
+ F_CLR(session, WT_SESSION_DEBUG_DO_NOT_CLEAR_TXN_ID);
+
WT_RET(__wt_config_gets(session, cfg, "dump_address", &cval));
vs->dump_address = cval.val != 0;
diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c
index f771e55b661..ab219c960e4 100644
--- a/src/third_party/wiredtiger/src/config/config_def.c
+++ b/src/third_party/wiredtiger/src/config/config_def.c
@@ -438,6 +438,7 @@ static const WT_CONFIG_CHECK confchk_WT_SESSION_timestamp_transaction[] = {
{"read_timestamp", "string", NULL, NULL, NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}};
static const WT_CONFIG_CHECK confchk_WT_SESSION_verify[] = {
+ {"do_not_clear_txn_id", "boolean", NULL, NULL, NULL, 0},
{"dump_address", "boolean", NULL, NULL, NULL, 0}, {"dump_blocks", "boolean", NULL, NULL, NULL, 0},
{"dump_layout", "boolean", NULL, NULL, NULL, 0}, {"dump_offsets", "list", NULL, NULL, NULL, 0},
{"dump_pages", "boolean", NULL, NULL, NULL, 0},
@@ -1314,10 +1315,10 @@ static const WT_CONFIG_ENTRY config_entries[] = {{"WT_CONNECTION.add_collator",
confchk_WT_SESSION_timestamp_transaction, 4},
{"WT_SESSION.truncate", "", NULL, 0}, {"WT_SESSION.upgrade", "", NULL, 0},
{"WT_SESSION.verify",
- "dump_address=false,dump_blocks=false,dump_layout=false,"
- "dump_offsets=,dump_pages=false,stable_timestamp=false,"
- "strict=false",
- confchk_WT_SESSION_verify, 7},
+ "do_not_clear_txn_id=false,dump_address=false,dump_blocks=false,"
+ "dump_layout=false,dump_offsets=,dump_pages=false,"
+ "stable_timestamp=false,strict=false",
+ confchk_WT_SESSION_verify, 8},
{"colgroup.meta",
"app_metadata=,assert=(commit_timestamp=none,"
"durable_timestamp=none,read_timestamp=none,write_timestamp=off),"
diff --git a/src/third_party/wiredtiger/src/include/cell_inline.h b/src/third_party/wiredtiger/src/include/cell_inline.h
index 5c13af6b56e..e593ff17a0d 100644
--- a/src/third_party/wiredtiger/src/include/cell_inline.h
+++ b/src/third_party/wiredtiger/src/include/cell_inline.h
@@ -1039,6 +1039,9 @@ __cell_unpack_window_cleanup(WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk
if (dsk->write_gen > S2BT(session)->base_write_gen)
return;
+ if (F_ISSET(session, WT_SESSION_DEBUG_DO_NOT_CLEAR_TXN_ID))
+ return;
+
__cell_addr_window_cleanup(session, unpack_addr);
__cell_kv_window_cleanup(session, unpack_kv);
}
diff --git a/src/third_party/wiredtiger/src/include/session.h b/src/third_party/wiredtiger/src/include/session.h
index 85589653ec8..58551f5b702 100644
--- a/src/third_party/wiredtiger/src/include/session.h
+++ b/src/third_party/wiredtiger/src/include/session.h
@@ -194,20 +194,21 @@ struct __wt_session_impl {
#define WT_SESSION_BACKUP_DUP 0x00002u
#define WT_SESSION_CACHE_CURSORS 0x00004u
#define WT_SESSION_CAN_WAIT 0x00008u
-#define WT_SESSION_DEBUG_RELEASE_EVICT 0x00010u
-#define WT_SESSION_EVICTION 0x00020u
-#define WT_SESSION_IGNORE_CACHE_SIZE 0x00040u
-#define WT_SESSION_IMPORT 0x00080u
-#define WT_SESSION_IMPORT_REPAIR 0x00100u
-#define WT_SESSION_INTERNAL 0x00200u
-#define WT_SESSION_LOGGING_INMEM 0x00400u
-#define WT_SESSION_NO_DATA_HANDLES 0x00800u
-#define WT_SESSION_NO_RECONCILE 0x01000u
-#define WT_SESSION_QUIET_CORRUPT_FILE 0x02000u
-#define WT_SESSION_READ_WONT_NEED 0x04000u
-#define WT_SESSION_RESOLVING_TXN 0x08000u
-#define WT_SESSION_ROLLBACK_TO_STABLE 0x10000u
-#define WT_SESSION_SCHEMA_TXN 0x20000u
+#define WT_SESSION_DEBUG_DO_NOT_CLEAR_TXN_ID 0x00010u
+#define WT_SESSION_DEBUG_RELEASE_EVICT 0x00020u
+#define WT_SESSION_EVICTION 0x00040u
+#define WT_SESSION_IGNORE_CACHE_SIZE 0x00080u
+#define WT_SESSION_IMPORT 0x00100u
+#define WT_SESSION_IMPORT_REPAIR 0x00200u
+#define WT_SESSION_INTERNAL 0x00400u
+#define WT_SESSION_LOGGING_INMEM 0x00800u
+#define WT_SESSION_NO_DATA_HANDLES 0x01000u
+#define WT_SESSION_NO_RECONCILE 0x02000u
+#define WT_SESSION_QUIET_CORRUPT_FILE 0x04000u
+#define WT_SESSION_READ_WONT_NEED 0x08000u
+#define WT_SESSION_RESOLVING_TXN 0x10000u
+#define WT_SESSION_ROLLBACK_TO_STABLE 0x20000u
+#define WT_SESSION_SCHEMA_TXN 0x40000u
/* AUTOMATIC FLAG VALUE GENERATION STOP 32 */
uint32_t flags;
diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in
index d3687ffa267..32a6a574851 100644
--- a/src/third_party/wiredtiger/src/include/wiredtiger.in
+++ b/src/third_party/wiredtiger/src/include/wiredtiger.in
@@ -1639,6 +1639,8 @@ struct __wt_session {
* @param name the URI of the table or file to verify, optional if verifying the history
* store
* @configstart{WT_SESSION.verify, see dist/api_data.py}
+ * @config{do_not_clear_txn_id, Turn off transaction id clearing\, intended for debugging
+ * and better diagnosis of crashes or failures., a boolean flag; default \c false.}
* @config{dump_address, Display page addresses\, time windows\, and page types as pages are
* verified\, using the application's message handler\, intended for debugging., a boolean
* flag; default \c false.}
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index fc1127db390..c66963875ae 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -432,11 +432,10 @@ __session_reconfigure(WT_SESSION *wt_session, const char *config)
* and no longer needed.
*/
if ((ret = __wt_config_getones(session, config, "debug.release_evict_page", &cval)) == 0) {
- if (cval.val) {
+ if (cval.val)
F_SET(session, WT_SESSION_DEBUG_RELEASE_EVICT);
- } else {
+ else
F_CLR(session, WT_SESSION_DEBUG_RELEASE_EVICT);
- }
}
WT_ERR_NOTFOUND_OK(ret, false);
diff --git a/src/third_party/wiredtiger/src/utilities/util_verify.c b/src/third_party/wiredtiger/src/utilities/util_verify.c
index c4d18dc00ea..0f09f343475 100644
--- a/src/third_party/wiredtiger/src/utilities/util_verify.c
+++ b/src/third_party/wiredtiger/src/utilities/util_verify.c
@@ -17,10 +17,12 @@ usage(void)
{
static const char *options[] = {"-d config",
"display underlying information during verification", "-s",
- "verify against the specified timestamp", NULL, NULL};
+ "verify against the specified timestamp", "-t", "do not clear txn ids during verification",
+ NULL, NULL};
util_usage(
- "verify [-s] [-d dump_address | dump_blocks | dump_layout | dump_offsets=#,# | dump_pages] "
+ "verify [-s] [-t] [-d dump_address | dump_blocks | dump_layout | dump_offsets=#,# | "
+ "dump_pages] "
"[uri]",
"options:", options);
@@ -38,11 +40,12 @@ util_verify(WT_SESSION *session, int argc, char *argv[])
size_t size;
int ch;
char *config, *dump_offsets, *uri;
- bool dump_address, dump_blocks, dump_layout, dump_pages, stable_timestamp;
+ bool do_not_clear_txn_id, dump_address, dump_blocks, dump_layout, dump_pages, stable_timestamp;
- dump_address = dump_blocks = dump_layout = dump_pages = stable_timestamp = false;
+ do_not_clear_txn_id = dump_address = dump_blocks = dump_layout = dump_pages = stable_timestamp =
+ false;
config = dump_offsets = uri = NULL;
- while ((ch = __wt_getopt(progname, argc, argv, "d:s")) != EOF)
+ while ((ch = __wt_getopt(progname, argc, argv, "d:st")) != EOF)
switch (ch) {
case 'd':
if (strcmp(__wt_optarg, "dump_address") == 0)
@@ -66,6 +69,9 @@ util_verify(WT_SESSION *session, int argc, char *argv[])
case 's':
stable_timestamp = true;
break;
+ case 't':
+ do_not_clear_txn_id = true;
+ break;
case '?':
default:
return (usage());
@@ -82,17 +88,18 @@ util_verify(WT_SESSION *session, int argc, char *argv[])
if ((uri = util_uri(session, *argv, "table")) == NULL)
return (1);
- if (dump_address || dump_blocks || dump_layout || dump_offsets != NULL || dump_pages ||
- stable_timestamp) {
- size = strlen("dump_address,") + strlen("dump_blocks,") + strlen("dump_layout,") +
- strlen("dump_pages,") + strlen("dump_offsets[],") +
+ if (do_not_clear_txn_id || dump_address || dump_blocks || dump_layout || dump_offsets != NULL ||
+ dump_pages || stable_timestamp) {
+ size = strlen("do_not_clear_txn_id,") + strlen("dump_address,") + strlen("dump_blocks,") +
+ strlen("dump_layout,") + strlen("dump_pages,") + strlen("dump_offsets[],") +
(dump_offsets == NULL ? 0 : strlen(dump_offsets)) + strlen("history_store") +
strlen("stable_timestamp,") + 20;
if ((config = malloc(size)) == NULL) {
ret = util_err(session, errno, NULL);
goto err;
}
- if ((ret = __wt_snprintf(config, size, "%s%s%s%s%s%s%s%s",
+ if ((ret = __wt_snprintf(config, size, "%s%s%s%s%s%s%s%s%s",
+ do_not_clear_txn_id ? "do_not_clear_txn_id," : "",
dump_address ? "dump_address," : "", dump_blocks ? "dump_blocks," : "",
dump_layout ? "dump_layout," : "", dump_offsets != NULL ? "dump_offsets=[" : "",
dump_offsets != NULL ? dump_offsets : "", dump_offsets != NULL ? "]," : "",