summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/conn/conn_dhandle.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-11-20 17:30:42 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-20 07:24:19 +0000
commitd0dfd00a48e83bc0e7e17d938f2578970a329304 (patch)
tree07a9a582d7fbfec81e6e82d2ee4b49e6d50d9362 /src/third_party/wiredtiger/src/conn/conn_dhandle.c
parentefb1467bec93d1de4aff70e817e10645f2ebfb3f (diff)
downloadmongo-d0dfd00a48e83bc0e7e17d938f2578970a329304.tar.gz
Import wiredtiger: b22e16b7643e0e07c784962899b3a45728536947 from branch mongodb-5.0
ref: d05021d0ee..b22e16b764 for: 4.9.0 WT-6563 Create a reproducer for invalid modification application WT-6672 Don't increase the writegen number until RTS cleans up the checkpoint WT-6859 Implement search_near method for the history store cursor
Diffstat (limited to 'src/third_party/wiredtiger/src/conn/conn_dhandle.c')
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_dhandle.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
index 16a9d7812b5..8727ed1b18b 100644
--- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
@@ -848,6 +848,37 @@ restart:
}
/*
+ * __wt_dhandle_update_write_gens --
+ * Update the open dhandles write generation and base write generation number.
+ */
+void
+__wt_dhandle_update_write_gens(WT_SESSION_IMPL *session)
+{
+ WT_BTREE *btree;
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle;
+
+ conn = S2C(session);
+
+ for (dhandle = NULL;;) {
+ WT_WITH_HANDLE_LIST_WRITE_LOCK(session, WT_DHANDLE_NEXT(session, dhandle, &conn->dhqh, q));
+ if (dhandle == NULL)
+ break;
+ btree = (WT_BTREE *)dhandle->handle;
+
+ WT_ASSERT(session, btree != NULL);
+
+ /*
+ * Initialize the btrees write generation numbers and runtime write generations after
+ * rollback to stable so that the transaction ids of the pages will be reset when loaded
+ * from disk to memory.
+ */
+ btree->write_gen = btree->base_write_gen = btree->run_write_gen =
+ WT_MAX(btree->write_gen, conn->base_write_gen);
+ }
+}
+
+/*
* __wt_verbose_dump_handles --
* Dump information about all data handles.
*/