diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/conn/conn_dhandle.c')
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_dhandle.c | 31 |
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. */ |