-
Notifications
You must be signed in to change notification settings - Fork 3
Add preserve-origin and timestamp for table repair operations. #64
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
Open
ibrarahmad
wants to merge
5
commits into
pgEdge:main
Choose a base branch
from
ibrarahmad:SPOC-401
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Implement preserve-origin feature that maintains original replication origin node ID and LSN when repairing rows during recovery scenarios. This prevents replication conflicts when the origin node returns to the cluster.
mason-sharp
requested changes
Jan 22, 2026
Member
mason-sharp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments.
Also, please add tests.
Enhances the preserve-origin feature to maintain per-row timestamp accuracy during table repairs. Each unique timestamp now gets its own transaction, ensuring rows maintain their original commit timestamps with microsecond precision. This is critical for temporal ordering and conflict resolution in distributed database recovery scenarios. Key changes: refactored grouping to use (origin, LSN, timestamp) tuples, implemented per-timestamp transaction management, changed timestamp format from RFC3339 to RFC3339Nano for microsecond precision, added unit tests for batch key functions, and moved replication origin resets after commit.
Enhances preserve-origin documentation to describe how each unique timestamp gets its own transaction for microsecond-precision preservation. Critical for temporal ordering and conflict resolution in recovery scenarios. Key changes: added preserve-origin flag to API docs, expanded table-repair command documentation with per-row timestamp details, and updated HTTP API documentation with behavior notes.
Contributor
Author
Test case added |
…mode After insert-only repair with source-of-truth n1: - All rows from n1 are copied to n2 (upserted) - n2's unique rows are preserved (not deleted) - Result: n1 has 0 unique rows, n2 has 2 unique rows Updated test assertions from incorrect expectations (2, 4, 4) to correct values (0, 2, 2) that match actual insert-only behavior.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implement preserve-origin feature that maintains original replication origin node ID and timstamp when repairing rows during recovery scenarios. This prevents replication conflicts when the origin node returns to the cluster.
Test Scenario
(no
--preserve-origin)(
--preserve-origin)