From 03114e74790dce590c1f84fcce65b0433e8ec5c5 Mon Sep 17 00:00:00 2001 From: Mark Hannum Date: Thu, 8 Aug 2024 20:10:35 -0400 Subject: [PATCH] Fix newsi relinks ordering bug that occurs only on the master Signed-off-by: Mark Hannum --- bdb/cursor.c | 23 ++--------------------- db/config.c | 2 +- tests/newsi_on_master.test/newsi.testopts | 1 + tests/newsi_on_master.test/runit | 2 +- 4 files changed, 5 insertions(+), 23 deletions(-) create mode 100644 tests/newsi_on_master.test/newsi.testopts diff --git a/bdb/cursor.c b/bdb/cursor.c index 749d888e47..5cbbe0d058 100644 --- a/bdb/cursor.c +++ b/bdb/cursor.c @@ -1622,20 +1622,6 @@ static int bdb_clean_pglog_queue(bdb_state_type *bdb_state, Pthread_rwlock_wrlock(&queue->queue_lk); if (cur) curqe = cur->cur; - /* Any orphan relinks at the front can be deleted */ - while ((qe = LISTC_TOP(&queue->queue_keys)) != NULL && - qe->type == PGLOGS_QUEUE_RELINK) { - qe = listc_rtl(&queue->queue_keys); - return_pglogs_queue_key(qe); -#ifdef ASOF_TRACE - count++; -#endif - /* adjust asof queue cursor */ - if (curqe == qe) { - cur->cur = NULL; - goto done; - } - } /* Find the last entry we can delete */ qe = LISTC_BOT(&queue->queue_keys); @@ -8017,14 +8003,9 @@ static int update_pglogs_from_global_queues_int( } } - /* Skip over unneeded RELINKS */ - while (!update_current_pglogs && current && current != last) { - current = current->lnk.next; - if (current->type != PGLOGS_QUEUE_PAGE) - continue; - assert(log_compare(¤t->commit_lsn, start_lsn) > 0); + /* On master, relink records preceed pglogs */ + if (current) update_current_pglogs = 1; - } } Pthread_rwlock_unlock(&qcur->queue->queue_lk); diff --git a/db/config.c b/db/config.c index 402cf05e0e..c279646845 100644 --- a/db/config.c +++ b/db/config.c @@ -1210,7 +1210,7 @@ static int read_lrl_option(struct dbenv *dbenv, char *line, } else if (tokcmp(tok, ltok, "enable_snapshot_isolation") == 0) { bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_SNAPISOL, 1); gbl_snapisol = 1; - /* Disable- will circle back to fix */ + /* Fixed, but we need to enable pglog logging first */ /* gbl_new_snapisol = 1; gbl_new_snapisol_asof = 1; diff --git a/tests/newsi_on_master.test/newsi.testopts b/tests/newsi_on_master.test/newsi.testopts new file mode 100644 index 0000000000..43c8c4251f --- /dev/null +++ b/tests/newsi_on_master.test/newsi.testopts @@ -0,0 +1 @@ +enable_new_snapshot diff --git a/tests/newsi_on_master.test/runit b/tests/newsi_on_master.test/runit index c48420bbec..79e4325934 100755 --- a/tests/newsi_on_master.test/runit +++ b/tests/newsi_on_master.test/runit @@ -20,7 +20,7 @@ select sleep(2) delete from t1 where 1 EOF -sleep 5 +wait diff $results $expected if [[ $? != 0 ]]; then