Skip to content

Commit

Permalink
Fix newsi relinks ordering bug that occurs only on the master
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Hannum <[email protected]>
  • Loading branch information
markhannum committed Aug 12, 2024
1 parent 2488162 commit 03114e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
23 changes: 2 additions & 21 deletions bdb/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(&current->commit_lsn, start_lsn) > 0);
/* On master, relink records preceed pglogs */
if (current)
update_current_pglogs = 1;
}
}

Pthread_rwlock_unlock(&qcur->queue->queue_lk);
Expand Down
2 changes: 1 addition & 1 deletion db/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tests/newsi_on_master.test/newsi.testopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable_new_snapshot
2 changes: 1 addition & 1 deletion tests/newsi_on_master.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ select sleep(2)
delete from t1 where 1
EOF

sleep 5
wait

diff $results $expected
if [[ $? != 0 ]]; then
Expand Down

0 comments on commit 03114e7

Please sign in to comment.