Skip to content

source-oracle: Per-thread log file selection for RAC#4490

Merged
willdonnelly merged 1 commit into
mainfrom
wgd/2026-05-15-oracle-rac-log-selection
May 15, 2026
Merged

source-oracle: Per-thread log file selection for RAC#4490
willdonnelly merged 1 commit into
mainfrom
wgd/2026-05-15-oracle-rac-log-selection

Conversation

@willdonnelly
Copy link
Copy Markdown
Member

Description:

In Oracle RAC, each instance writes its own thread of redo, and SCN ranges across threads overlap arbitrarily while sequence numbers are independent. The previous log selection logic assumed a single thread, and could misbehave in all kinds of interesting ways when that wasn't true.

The new selection logic sorts candidate files by FIRST_CHANGE# and tracks NEXT_CHANGE# per-thread then takes the minimum across threads to find the global covered SCN upper-bound after adding each file. This logic reduces to the old behavior in single-threaded cases.

I have not tested this against a real RAC deployment but I believe that it should work in theory, and as previously mentioned it reduces to the single-thread logic the rest of the time so I believe it should be safe to try in production.

In Oracle RAC, each instance writes its own thread of redo, and SCN
ranges across threads overlap arbitrarily while sequence numbers are
independent. The previous log selection logic assumed a single thread,
and could misbehave in all kinds of interesting ways when that wasn't
true.

The new selection logic sorts candidate files by `FIRST_CHANGE#` and
tracks `NEXT_CHANGE#` per-thread then takes the minimum across threads
to find the global covered SCN upper-bound after adding each file. This
logic reduces to the old behavior in single-threaded cases.

I have not tested this against a real RAC deployment but I believe that
it should work in theory, and as previously mentioned it reduces to the
single-thread logic the rest of the time so I believe it should be safe
to try in production.
@willdonnelly willdonnelly requested a review from a team May 15, 2026 18:16
@willdonnelly willdonnelly added the change:unplanned Unplanned change, useful for things like doc updates label May 15, 2026
Copy link
Copy Markdown
Member

@Alex-Bair Alex-Bair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@willdonnelly willdonnelly merged commit 232a2a4 into main May 15, 2026
69 of 70 checks passed
@willdonnelly willdonnelly deleted the wgd/2026-05-15-oracle-rac-log-selection branch May 15, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:unplanned Unplanned change, useful for things like doc updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants