summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-09-09 16:05:05 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-09 06:34:14 +0000
commit63d2ed6429eebba1e385aa0f8490692af2e929a5 (patch)
tree6717aadce5b58c172b3e39670bf76f3c525a67b4
parent123941cc37845e954fa14b7217c22827a1506470 (diff)
downloadmongo-63d2ed6429eebba1e385aa0f8490692af2e929a5.tar.gz
Import wiredtiger: c4fa0f7511202f4b9908e0b70a444197dddd07c2 from branch mongodb-6.1
ref: 2537dbfc79..c4fa0f7511 for: 6.1.0-rc2 WT-9792 Fix RTS to remove globally visible update of the data store update from the history store (#8240)
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c24
-rw-r--r--src/third_party/wiredtiger/test/format/failure_configs/CONFIG.WT-9792160
3 files changed, 182 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 8815c9fa99a..e4e89543c08 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-6.1",
- "commit": "2537dbfc7938d44113f355000c677bc8badb2969"
+ "commit": "c4fa0f7511202f4b9908e0b70a444197dddd07c2"
}
diff --git a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
index 1238681fd57..444374bda1f 100644
--- a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
+++ b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c
@@ -55,12 +55,22 @@ __rollback_delete_hs(WT_SESSION_IMPL *session, WT_ITEM *key, wt_timestamp_t ts)
for (; ret == 0; ret = hs_cursor->prev(hs_cursor)) {
/* Retrieve the time window from the history cursor. */
__wt_hs_upd_time_window(hs_cursor, &hs_tw);
- if (hs_tw->start_ts < ts)
+
+ /*
+ * Remove all history store versions with a stop timestamp greater than the start/stop
+ * timestamp of a stable update in the data store.
+ */
+ if (hs_tw->stop_ts <= ts)
break;
WT_ERR(hs_cursor->remove(hs_cursor));
WT_STAT_CONN_DATA_INCR(session, txn_rts_hs_removed);
- if (hs_tw->start_ts == ts)
+
+ /*
+ * The globally visible start time window's are cleared during history store reconciliation.
+ * Treat them also as a stable entry removal from the history store.
+ */
+ if (hs_tw->start_ts == ts || hs_tw->start_ts == WT_TS_NONE)
WT_STAT_CONN_DATA_INCR(session, cache_hs_key_truncate_rts);
else
WT_STAT_CONN_DATA_INCR(session, cache_hs_key_truncate_rts_unstable);
@@ -1865,7 +1875,15 @@ __rollback_to_stable_btree_apply_all(WT_SESSION_IMPL *session, wt_timestamp_t ro
}
WT_ERR_NOTFOUND_OK(ret, false);
- if (F_ISSET(S2C(session), WT_CONN_RECOVERING))
+ /*
+ * Performing eviction in parallel to a checkpoint can lead to situation where the history store
+ * have more updates than its corresponding data store. Performing history store cleanup at the
+ * end can able to remove any such unstable updates that are written to the history store.
+ *
+ * Do not perform the final pass on the history store in an in-memory configuration as it
+ * doesn't exist.
+ */
+ if (!F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
WT_ERR(__rollback_to_stable_hs_final_pass(session, rollback_timestamp));
err:
diff --git a/src/third_party/wiredtiger/test/format/failure_configs/CONFIG.WT-9792 b/src/third_party/wiredtiger/test/format/failure_configs/CONFIG.WT-9792
new file mode 100644
index 00000000000..4889602e518
--- /dev/null
+++ b/src/third_party/wiredtiger/test/format/failure_configs/CONFIG.WT-9792
@@ -0,0 +1,160 @@
+############################################
+# RUN PARAMETERS: V3
+############################################
+assert.read_timestamp=0
+backup=1
+backup.incremental=off
+backup.incr_granularity=11461
+block_cache=0
+block_cache.cache_on_checkpoint=0
+block_cache.cache_on_writes=0
+block_cache.size=47
+btree.huffman_value=0
+cache=612
+cache.evict_max=1
+cache.minimum=20
+checkpoint=on
+checkpoint.log_size=167
+checkpoint.wait=32
+disk.data_extend=0
+disk.direct_io=0
+disk.encryption=none
+disk.mmap=1
+disk.mmap_all=0
+format.abort=0
+format.independent_thread_rng=0
+format.major_timeout=0
+import=0
+logging=0
+logging.compression=none
+logging.file_max=199668
+logging.prealloc=0
+logging.remove=0
+ops.alter=0
+ops.compaction=1
+ops.hs_cursor=1
+ops.prepare=0
+ops.random_cursor=0
+ops.salvage=0
+ops.verify=1
+quiet=1
+runs.in_memory=0
+runs.ops=0
+runs.rows=1000000
+runs.tables=3
+runs.threads=16
+runs.timer=6
+runs.verify_failure_dump=0
+statistics=0
+statistics.server=0
+stress.aggressive_sweep=0
+stress.checkpoint=0
+stress.checkpoint_evict_page=0
+stress.checkpoint_reserved_txnid_delay=0
+stress.checkpoint_prepare=0
+stress.evict_reposition=1
+stress.failpoint_eviction_fail_after_reconciliation=0
+stress.failpoint_hs_delete_key_from_ts=0
+stress.hs_checkpoint_delay=0
+stress.hs_search=0
+stress.hs_sweep=0
+stress.split_1=0
+stress.split_2=1
+stress.split_3=0
+stress.split_4=0
+stress.split_5=0
+stress.split_6=0
+stress.split_7=0
+transaction.implicit=0
+transaction.timestamps=1
+wiredtiger.config=off
+wiredtiger.rwlock=1
+wiredtiger.leak_memory=0
+############################################
+# TABLE PARAMETERS: table 1
+############################################
+table1.btree.compression=snappy
+table1.btree.dictionary=0
+table1.btree.internal_key_truncation=1
+table1.btree.internal_page_max=15
+table1.btree.key_max=24
+table1.btree.key_min=14
+table1.btree.leaf_page_max=11
+table1.btree.memory_page_max=8
+table1.btree.prefix_len=0
+table1.btree.prefix_compression=0
+table1.btree.prefix_compression_min=7
+table1.btree.reverse=0
+table1.btree.split_pct=94
+table1.btree.value_max=1513
+table1.btree.value_min=1
+table1.disk.checksum=unencrypted
+table1.disk.firstfit=0
+table1.ops.pct.delete=3
+table1.ops.pct.insert=63
+table1.ops.pct.modify=3
+table1.ops.pct.read=9
+table1.ops.pct.write=22
+table1.ops.truncate=1
+table1.runs.mirror=0
+table1.runs.source=file
+table1.runs.type=row-store
+############################################
+# TABLE PARAMETERS: table 2
+############################################
+table2.btree.compression=zlib
+table2.btree.dictionary=0
+table2.btree.internal_key_truncation=1
+table2.btree.internal_page_max=12
+table2.btree.key_max=115
+table2.btree.key_min=22
+table2.btree.leaf_page_max=12
+table2.btree.memory_page_max=9
+table2.btree.prefix_len=0
+table2.btree.prefix_compression=1
+table2.btree.prefix_compression_min=7
+table2.btree.reverse=0
+table2.btree.split_pct=86
+table2.btree.value_max=37
+table2.btree.value_min=16
+table2.disk.checksum=on
+table2.disk.firstfit=1
+table2.ops.pct.delete=12
+table2.ops.pct.insert=0
+table2.ops.pct.modify=2
+table2.ops.pct.read=60
+table2.ops.pct.write=26
+table2.ops.truncate=1
+table2.runs.mirror=0
+table2.runs.source=table
+table2.runs.type=row-store
+############################################
+# TABLE PARAMETERS: table 3
+############################################
+table3.btree.compression=zstd
+table3.btree.dictionary=0
+table3.btree.internal_key_truncation=1
+table3.btree.internal_page_max=11
+table3.btree.key_max=68
+table3.btree.key_min=21
+table3.btree.leaf_page_max=13
+table3.btree.memory_page_max=1
+table3.btree.prefix_len=41
+table3.btree.prefix_compression=1
+table3.btree.prefix_compression_min=2
+table3.btree.reverse=0
+table3.btree.split_pct=86
+table3.btree.value_max=239
+table3.btree.value_min=9
+table3.disk.checksum=unencrypted
+table3.disk.firstfit=0
+table3.ops.pct.delete=50
+table3.ops.pct.insert=2
+table3.ops.pct.modify=1
+table3.ops.pct.read=3
+table3.ops.pct.write=44
+table3.ops.truncate=1
+table3.runs.mirror=0
+table3.runs.source=table
+table3.runs.type=row-store
+