Skip to content

Improve conflict resolution on replica when table has both Primary and Unique keys #8042

@hvlad

Description

@hvlad

The setup is the same as in #8040:

  • replica database contains a table with Primary Key and at least one Unique Key
  • the record is being inserted and violates UK (not PK!)

Currently, PK violation on insert is resolved by updating conflicting record, using the PK fields values.

But case with UK violation can't be resolved as engine tries to find record for update using PK
and such record obviously can't be found, thus original error is returned. This stops replication
until manual correction by DBA.

Improvement is to update record using not PK but the unique index that was violated on insert.
In this case record exists and can be updated. Replication process will continue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions