summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_api.c1
-rw-r--r--src/third_party/wiredtiger/src/include/connection.h33
-rw-r--r--src/third_party/wiredtiger/src/session/session_compact.c20
4 files changed, 39 insertions, 17 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index c318afdbfe2..0e38f29b46e 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-5.2",
- "commit": "7feed3f6351bbb3164538a2510bf5ce39e36133f"
+ "commit": "a9197f1480f65355eaf9e16812e5fd7e8f591eab"
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c
index ecd2441b60d..d96bf66d151 100644
--- a/src/third_party/wiredtiger/src/conn/conn_api.c
+++ b/src/third_party/wiredtiger/src/conn/conn_api.c
@@ -2207,6 +2207,7 @@ __wt_timing_stress_config(WT_SESSION_IMPL *session, const char *cfg[])
{"backup_rename", WT_TIMING_STRESS_BACKUP_RENAME},
{"checkpoint_reserved_txnid_delay", WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY},
{"checkpoint_slow", WT_TIMING_STRESS_CHECKPOINT_SLOW},
+ {"compact_slow", WT_TIMING_STRESS_COMPACT_SLOW},
{"failpoint_history_delete_key_from_ts",
WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS},
{"history_store_checkpoint_delay", WT_TIMING_STRESS_HS_CHECKPOINT_DELAY},
diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h
index 4e1117867cf..bbd4db1a9ae 100644
--- a/src/third_party/wiredtiger/src/include/connection.h
+++ b/src/third_party/wiredtiger/src/include/connection.h
@@ -575,22 +575,23 @@ struct __wt_connection_impl {
* Variable with flags for which subsystems the diagnostic stress timing delays have been requested.
*/
/* AUTOMATIC FLAG VALUE GENERATION START 0 */
-#define WT_TIMING_STRESS_AGGRESSIVE_SWEEP 0x0001u
-#define WT_TIMING_STRESS_BACKUP_RENAME 0x0002u
-#define WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 0x0004u
-#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x0008u
-#define WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS 0x0010u
-#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x0020u
-#define WT_TIMING_STRESS_HS_SEARCH 0x0040u
-#define WT_TIMING_STRESS_HS_SWEEP 0x0080u
-#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x0100u
-#define WT_TIMING_STRESS_SPLIT_1 0x0200u
-#define WT_TIMING_STRESS_SPLIT_2 0x0400u
-#define WT_TIMING_STRESS_SPLIT_3 0x0800u
-#define WT_TIMING_STRESS_SPLIT_4 0x1000u
-#define WT_TIMING_STRESS_SPLIT_5 0x2000u
-#define WT_TIMING_STRESS_SPLIT_6 0x4000u
-#define WT_TIMING_STRESS_SPLIT_7 0x8000u
+#define WT_TIMING_STRESS_AGGRESSIVE_SWEEP 0x00001u
+#define WT_TIMING_STRESS_BACKUP_RENAME 0x00002u
+#define WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 0x00004u
+#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x00008u
+#define WT_TIMING_STRESS_COMPACT_SLOW 0x00010u
+#define WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS 0x00020u
+#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x00040u
+#define WT_TIMING_STRESS_HS_SEARCH 0x00080u
+#define WT_TIMING_STRESS_HS_SWEEP 0x00100u
+#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x00200u
+#define WT_TIMING_STRESS_SPLIT_1 0x00400u
+#define WT_TIMING_STRESS_SPLIT_2 0x00800u
+#define WT_TIMING_STRESS_SPLIT_3 0x01000u
+#define WT_TIMING_STRESS_SPLIT_4 0x02000u
+#define WT_TIMING_STRESS_SPLIT_5 0x04000u
+#define WT_TIMING_STRESS_SPLIT_6 0x08000u
+#define WT_TIMING_STRESS_SPLIT_7 0x10000u
/* AUTOMATIC FLAG VALUE GENERATION STOP 64 */
uint64_t timing_stress_flags;
diff --git a/src/third_party/wiredtiger/src/session/session_compact.c b/src/third_party/wiredtiger/src/session/session_compact.c
index 0fc929ac94f..05851afd4c5 100644
--- a/src/third_party/wiredtiger/src/session/session_compact.c
+++ b/src/third_party/wiredtiger/src/session/session_compact.c
@@ -176,6 +176,24 @@ __compact_handle_append(WT_SESSION_IMPL *session, const char *cfg[])
}
/*
+ * __compact_timing_stress --
+ * Optionally add a delay to the compact for debug purposes.
+ */
+static void
+__compact_timing_stress(WT_SESSION_IMPL *session)
+{
+ struct timespec tsp;
+
+ /* We only want to sleep if the flag is set. */
+ if (FLD_ISSET(S2C(session)->timing_stress_flags, WT_TIMING_STRESS_COMPACT_SLOW)) {
+ /* Add a 2 second wait to simulate compact slowness. */
+ tsp.tv_sec = 2;
+ tsp.tv_nsec = 0;
+ __wt_sleep((uint64_t)tsp.tv_sec, (uint64_t)tsp.tv_nsec / WT_THOUSAND);
+ }
+}
+
+/*
* __wt_session_compact_check_timeout --
* Check if the timeout has been exceeded.
*/
@@ -257,6 +275,8 @@ __compact_worker(WT_SESSION_IMPL *session)
if (session->op_handle[i]->compact_skip)
continue;
+ __compact_timing_stress(session);
+
session->compact_state = WT_COMPACT_RUNNING;
WT_WITH_DHANDLE(session, session->op_handle[i], ret = __wt_compact(session));
WT_ERR_ERROR_OK(ret, EBUSY, true);