Skip to content

oracledb_cdc: Update commit_ts_ms to use a more accurate commit time#4451

Closed
josephwoodward wants to merge 1 commit into
mainfrom
jw/oraclecommitts
Closed

oracledb_cdc: Update commit_ts_ms to use a more accurate commit time#4451
josephwoodward wants to merge 1 commit into
mainfrom
jw/oraclecommitts

Conversation

@josephwoodward
Copy link
Copy Markdown
Contributor

No description provided.

Table: dml.Table,
Data: data,
Timestamp: dml.Timestamp,
Timestamp: dml.CommitTimestamp,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

After this change, the Timestamp field on MessageEvent is sourced from dml.CommitTimestamp, which is now the value of V$LOGMNR_CONTENTS.COMMIT_TIMESTAMP. That field is what drives the source_ts_ms metadata in batcher.go#L173-L178, but the documented contract for source_ts_ms in input_oracledb_cdc.go#L80-L82 explicitly states it reflects "the database server's wall-clock time at the moment the DML executed, not the transaction commit time." After this PR, source_ts_ms and commit_ts_ms will be identical (both the commit time), and source_ts_ms will no longer match its documented meaning. Consider keeping the per-row TIMESTAMP column selected alongside COMMIT_TIMESTAMP so the operation timestamp continues to populate source_ts_ms while only commit_ts_ms is corrected.

@claude
Copy link
Copy Markdown

claude Bot commented May 22, 2026

Commits

  1. Commit message oracledb_cdc: Update commit_ts_ms to use a more accurate commit time violates the message format: the message after system: must start lowercase (e.g., update, not Update).

Review
The change correctly switches commit_ts_ms to be sourced from V$LOGMNR_CONTENTS.COMMIT_TIMESTAMP, fixing the previous bug where commit_ts_ms was actually the operation timestamp. However, because the TIMESTAMP column was dropped from the query entirely, the MessageEvent.Timestamp field (which drives source_ts_ms) is now also set to the commit time, conflicting with the documented contract for source_ts_ms.

  1. source_ts_ms will now report the transaction commit time, contradicting the documented behavior in input_oracledb_cdc.go#L80-L82. See inline comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant