You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change fixes an issue where lob writes can be out of order (though only occasionally appeared to fail in the CI pipeline). Now we buffer the lob writes until we see their corresponding insert or update.
Following the fix I've run the CI job numerous times and it appears to fix the issue.
oracledb_cdc: lob write order — message after the colon is a noun phrase, not imperative mood. Policy requires imperative (e.g., oracledb_cdc: fix lob write ordering or similar) — see the PR title oracledb_cdc: lob write race condition for a more descriptive phrasing.
Review
Single blocker: a missing ctx argument in the new drainPendingLOBWrites helper makes the package fail to compile.
internal/impl/oracledb/logminer/logminer.go:779 — lm.inferLOBLocator(event) is missing the required ctx context.Context argument; drainPendingLOBWrites needs to accept and forward ctx from its caller at line 291.
oracledb_cdc: lob write order — the message is not in imperative mood. The commit policy requires system: message where message uses imperative mood (e.g. "add", "fix", "buffer", "handle"). "lob write order" is a noun phrase that doesn't describe the action being performed. Consider rewording, e.g. oracledb_cdc: buffer lob writes that arrive before insert or oracledb_cdc: handle out-of-order lob writes.
The oracledb_cdc: address merge conflict (cbc4a55) commit is a fixup that resolves the merge from main — it should be squashed into either the merge commit or the main oracledb_cdc: lob write order commit rather than standing on its own. Per the commit policy, each commit should be a self-contained logical change; merge-conflict resolutions are not.
Review
The change buffers LOB_WRITE events that arrive before their matching INSERT/UPDATE (BASICFILE DISABLE STORAGE IN ROW ordering) and drains them once the DML is processed. Cleanup on commit/rollback is consistent with the existing lobStates lifecycle, and the new unit test exercises the out-of-order arrival path.
drainPendingLOBWrites returns a fatal error on ParseLobWrite failure, while the equivalent non-buffered OpLobWrite handler logs a warning and continues. See inline comment on logminer.go#L797.
The first commit headline oracledb_cdc: lob write order is missing an imperative verb (e.g. fix, handle, order-as-verb is ambiguous here). The commit policy requires imperative mood like otlp: add authz support. The second commit (oracledb_cdc: address lob race condition) is fine.
Review
Targeted fix to buffer LOB_WRITE events that arrive before their matching INSERT/UPDATE under BASICFILE DISABLE STORAGE IN ROW ordering, with cleanup on commit/rollback and a unit test covering the out-of-order case.
Two new fmt.Errorf sites wrap the underlying parse error with %v instead of %w, breaking the error chain — see inline comments on logminer.go#L425 and logminer.go#L796. The rest of the file consistently uses %w for wrapped errors.
Review
The change buffers LOB_WRITE redo events that arrive before their matching INSERT/UPDATE (BASICFILE DISABLE STORAGE IN ROW ordering) and drains the buffer once the row event is processed. Cleanup is wired into both commit and rollback paths, and a focused unit test (logminer_test.go#L235-L267) covers the new ordering.
Review
Adds a buffer for LOB_WRITE events that arrive before their matching INSERT (BASICFILE DISABLE STORAGE IN ROW ordering), with drain on INSERT/UPDATE and cleanup on commit/rollback. The inferLOBLocator candidate-selection change correctly distinguishes out-of-line LOBs (NULL/absent from Data) from inline LOBs ([]byte{} placeholders handled by SELECT_LOB_LOCATOR). Sorted iteration via slices.Sorted makes column assignment deterministic.
LGTM
josephwoodward
changed the title
oracledb_cdc: lob write race condition
oracledb_cdc: fix LOB_WRITE race condition
May 28, 2026
Commit f61452d has a typo in the subject: determinsitic → deterministic.
The 4 commits (lob write order, address lob race condition, ensure we wrap error, make order determinsitic) all incrementally fix the same logical change. Commits 3 and 4 in particular look like fixups (a single error-wrap line and a single-line slices.Sorted change) that should be squashed into the first two for cleaner history.
Review
The fix buffers out-of-order LOB_WRITE events into a new pendingLOBWrites map and drains them once the matching INSERT/UPDATE is added to the transaction cache, with cleanup on commit/rollback. The inferLOBLocator candidate-selection rewrite (treat columns absent or nil as candidates; []byte{} placeholders are not) plus sorted-key iteration for determinism look correct, and the new TestLOBWriteBeforeInsert exercises the buffer→drain path end-to-end.
LGTM
josephwoodward
changed the title
oracledb_cdc: fix LOB_WRITE race condition
oracledb_cdc: fix LOB_WRITE events appearing before INSERT/UPDATES
May 28, 2026
josephwoodward
changed the title
oracledb_cdc: fix LOB_WRITE events appearing before INSERT/UPDATES
oracledb_cdc: fix LOB_WRITE events appearing before INSERT/UPDATE LOB events
May 28, 2026
josephwoodward
changed the title
oracledb_cdc: fix LOB_WRITE events appearing before INSERT/UPDATE LOB events
oracledb_cdc: buffer out of order LOB_WRITE events until corresponding INSERT/UPDATE events are received
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes an issue where lob writes can be out of order (though only occasionally appeared to fail in the CI pipeline). Now we buffer the lob writes until we see their corresponding insert or update.
Following the fix I've run the CI job numerous times and it appears to fix the issue.