Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix newsi relinks ordering bug #4601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions bdb/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,20 +1626,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 @@ -8072,14 +8058,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
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