Skip to content

Multiple UNIQUE constraint violation error not logged/outputted (INSERT/INSERT Conflict) #315

@yuito-tanaka

Description

@yuito-tanaka

Hello, I conducted a test to verify that multiple UNIQUE constraint violations are detected in an INSERT/INSERT conflict, resulting in the error "multiple unique constraints violated by remotely INSERTed tuple."

  1. Both Node1 and Node2 have a test_table (id int PRIMARY KEY, email text UNIQUE, username text UNIQUE).
  2. On Node2: Pauses the replication apply process.: SELECT pgactive.pgactive_apply_pause();
  3. On Node2: Insert data. : INSERT INTO test_table VALUES (1,'dup@example.com', 'username1');
               INSERT INTO test_table VALUES (2,'username2@example.com', 'dup_user');
  4. On Node1: Insert data. : INSERT INTO test_table VALUES (100, 'dup@example.com', 'dup_user');
  5. On Node2 : Resume the replication apply process. : SELECT pgactive.pgactive_apply_resume();
  6. Result : The error "multiple unique constraints violated by remotely INSERTed tuple." was not logged in the
    PostgreSQL server log. Additionally, on Node2, logs were recorded showing an INSERT/INSERT conflict
    between the tuple {"id":1, "email":"dup@example.com","username":"username1"} and
    the tuple {"id":100, "email":"dup@example.com","username":dup_user"} from Node1.

Questions:
I conducted a test expecting the error "multiple unique constraints violated by remotely INSERTed tuple." to appear in the PostgreSQL server log on Node2. However, this error was not output. Instead, the conflict log for a INSERT/INSERT conflict involving a single UNIQUE constraint violation was recorded. Is the above procedure appropriate as a test to detect multiple UNIQUE constraint violations? Thank you!

Environment:

  • PostgreSQL Version: 18.3
  • Extension: pgactive (latest)
  • Setup: Active-Active replication between 2 nodes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions