View Issue Details

IDProjectCategoryView StatusLast Update
0003005SymmetricDSBugpublic2017-03-14 12:09
Reportermmichalek Assigned Tommichalek  
Priorityhigh 
Status closedResolutionfixed 
Product Version3.8.18 
Target Version3.8.18Fixed in Version3.8.18 
Summary0003005: SequenceFactory may issue duplicate outgoing_batch (batch_id) sequence numbers when shared db transactions are rolled back
DescriptionSaw a case with 2 clients where the system was configured with an invalid initial load select. This caused the routing process to start the initial load, and then fail and rollback its db transaction. That same db transaction had been passed into SequenceFactory and (potentially) used to update the sym_sequence table for the next value of the outgoing_batch sequence.

When the db transaction rolls back, so does the update to sym_sequence. These leaves SequenceFactory in a position where it may have already dispensed sequences 1-10, but be set back to sequence 1, after the db transaction rollback.

This lead to side affects such as PK violations on the sym_outgoing_batch.batch_id field, and existing batches being re-opened and additional data added to them.

As a resolution, SequenceFactory will now be more self contained and not participate in outside db transactions like this.
TagsNo tags attached.

Activities

mmichalek

2017-03-02 22:17

administrator   ~0000971

As a workaround, you can set the cache of your sequences to 0.
update sym_sequence set cache_size = 0;

This change requires a restart to the SymmetricDS server.

Related Changesets

SymmetricDS: 3.8 dd438e54

2017-03-02 17:05:23

mmichalek

Details Diff
0003005: SequenceFactory may issue duplicate outgoing_batch (batch_id)
sequence numbers when shared db transactions are rolled back
Affected Issues
0003005
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/ISequenceService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataExtractorService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/SequenceService.java Diff File

Issue History

Date Modified Username Field Change
2017-03-02 21:45 mmichalek New Issue
2017-03-02 21:45 mmichalek Status new => assigned
2017-03-02 21:45 mmichalek Assigned To => mmichalek
2017-03-02 22:05 mmichalek Status assigned => resolved
2017-03-02 22:05 mmichalek Resolution open => fixed
2017-03-02 22:05 mmichalek Fixed in Version => 3.8.18
2017-03-02 22:05 mmichalek Status resolved => feedback
2017-03-02 22:05 mmichalek Resolution fixed => reopened
2017-03-02 22:06 mmichalek Description Updated View Revisions
2017-03-02 22:07 mmichalek Status feedback => resolved
2017-03-02 22:07 mmichalek Resolution reopened => fixed
2017-03-02 22:17 mmichalek Note Added: 0000971
2017-03-02 22:17 mmichalek Status resolved => feedback
2017-03-02 22:17 mmichalek Resolution fixed => reopened
2017-03-02 22:17 mmichalek Status feedback => resolved
2017-03-02 22:17 mmichalek Resolution reopened => fixed
2017-03-02 23:00 mmichalek Changeset attached => SymmetricDS 3.8 dd438e54
2017-03-14 12:09 chenson Status resolved => closed