View Issue Details

IDProjectCategoryView StatusLast Update
0004457SymmetricDSImprovementpublic2020-07-20 14:50
Reporterelong Assigned Toelong  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.12.0 
Target Version3.12.2Fixed in Version3.12.2 
Summary0004457: Batch conflict possible when blocking row has self referencing foreign key
DescriptionWhen a table has a foreign key reference to itself, and the source and target are out of sync, a batch can get a conflict error.

[DefaultDatabaseWriterConflictResolver] [main] Primary key violation on table TEST_DATALOADER_PARENT during UPDATE with batch 00000-10003. Attempting to correct.
[DefaultDatabaseWriterConflictResolver] [main] Child exists foreign key violation while correcting primary key violation. Attempting further corrections.
[DefaultDatabaseWriterConflictResolver] [main] Remove foreign row catalog 'ROOT' schema 'PUBLIC' foreign table name 'TEST_DATALOADER_PARENT' fk name 'FK_TEST_DATALOADER_PARENT_PID' where sql '"ID" = 10002' to correct table 'TEST_DATALOADER_PARENT' for column 'ID'
[DefaultDatabaseWriter] [main] Failed to process update event in batch 00000-10003 on channel 'default'.
Failed pk data was: "10002"
Failed row data was: "10001","update-pk2",
org.jumpmind.symmetric.io.data.writer.ConflictException: Detected conflict while executing UPDATE on ROOT.PUBLIC.TEST_DATALOADER_PARENT. The primary key data was: {ID=10002}. Failed to fallback.
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.performFallbackToUpdate(AbstractDatabaseWriterConflictResolver.java:337)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.performChainedFallbackForUpdate(AbstractDatabaseWriterConflictResolver.java:208)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.needsResolved(AbstractDatabaseWriterConflictResolver.java:110)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter.write(AbstractDatabaseWriter.java:212)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:155)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:139)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:131)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:122)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:116)
    at org.jumpmind.symmetric.io.AbstractWriterTest.writeData(AbstractWriterTest.java:95)
    at org.jumpmind.symmetric.io.data.writer.DatabaseWriterConflictTest.update(DatabaseWriterConflictTest.java:278)
    at org.jumpmind.symmetric.io.data.writer.DatabaseWriterConflictTest.testUpdatePkViolationDeleteFkViolationBlockingSelf(DatabaseWriterConflictTest.java:188)
Steps To ReproduceUsing DatabaseWriterConflictTest:

        String firstId = insert(getNextId(), "update-pk1", null);
        String secondId = insert(getNextId(), "update-pk2", firstId);
        update(secondId, firstId, "update-pk2", null);
Tagsconflict manager

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.12 2ac4afae

2020-06-26 17:35:02

admin

Details Diff
0004457: Batch conflict possible when blocking row has self referencing
foreign key
Affected Issues
0004457
mod - symmetric-io/src/integrationTest/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriterConflictTest.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriterConflictResolver.java Diff File

Issue History

Date Modified Username Field Change
2020-06-26 21:33 elong New Issue
2020-06-26 21:33 elong Status new => assigned
2020-06-26 21:33 elong Assigned To => elong
2020-06-26 21:33 elong Tag Attached: conflict manager
2020-06-26 21:35 elong Status assigned => resolved
2020-06-26 21:35 elong Resolution open => fixed
2020-06-26 21:35 elong Fixed in Version => 3.12.2
2020-06-26 22:00 admin Changeset attached => SymmetricDS 3.12 2ac4afae
2020-07-20 14:50 elong Status resolved => closed