Skip to content

feat(replication): add support for replica identity full#952

Merged
meskill merged 5 commits intomainfrom
feat/identity_full_support
May 4, 2026
Merged

feat(replication): add support for replica identity full#952
meskill merged 5 commits intomainfrom
feat/identity_full_support

Conversation

@meskill
Copy link
Copy Markdown
Contributor

@meskill meskill commented May 1, 2026

Fixes #930

@blacksmith-sh

This comment has been minimized.

validation_errors.sort_by_key(|e| match e {
TableValidationError::NoIdentityColumns(table) => table.name.clone(),
});
validation_errors.sort_by_key(|e| e.table.name.clone());
Copy link
Copy Markdown
Collaborator

@levkk levkk May 1, 2026

Choose a reason for hiding this comment

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

nit: could sort by schema and table name so errors for the same schema appear next to each other.


/// Returns `true` when the named table has at least one unique index that is
/// fully built and valid on the given server connection.
pub async fn has_unique_index(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For schemas that have 1000s of tables, this could be slow. Try maybe returning a map like this:

schema table unique_index
public users t
orders items f

Copy link
Copy Markdown
Collaborator

@levkk levkk left a comment

Choose a reason for hiding this comment

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

Still reviewing, but looks really good so far! The LB test is flaky (I need to fix it). The copy data test is also flaky I think, but I haven't looked into why yet.

.cloned()
.collect();
for table in &omni_full {
self.validate_full_identity_omni_has_unique_index(table)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: this should be executed as one query, ideally, although probably not critical since this runs only once.

Copy link
Copy Markdown
Collaborator

@levkk levkk left a comment

Choose a reason for hiding this comment

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

Really cool stuff!

@meskill
Copy link
Copy Markdown
Contributor Author

meskill commented May 3, 2026

made a small update to remove some errors that actually shouldn't have been there for identity full and they should not block the execution flow.

Copy link
Copy Markdown
Collaborator

@levkk levkk left a comment

Choose a reason for hiding this comment

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

Very cool!

@meskill meskill merged commit 7e799a8 into main May 4, 2026
22 checks passed
@meskill meskill deleted the feat/identity_full_support branch May 4, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for REPLICA IDENTIFY FULL

2 participants