View Issue Details

IDProjectCategoryView StatusLast Update
0004062SymmetricDSBugpublic2019-08-09 09:53
ReporterjmuellerAssigned To 
Status newResolutionopen 
Product Version3.9.17 
Target VersionFixed in Version 
Summary0004062: SimpleDateFormat is incompatible with PostgreSql microsecond template
DescriptionFormatUtils uses java.text.SimpleDateFormat, which has no microsecond support. In fact FormatUtils tries to add multiple "s" patterns for milliseconds which are silently discarded.
This works fine for most DBs but fails for postgres since the DmlStatement templates use "US" which means microseconds. As a result, a postgres generated partial second ".123456" will be deserialized into 123 seconds, 456 milliseconds, extra seconds get carried over into minutes of the resulting date.
Steps To Reproduce1. Have a two node cluster where both servers are running postgres.
2. Configure a test table to have a timestamptz column. Configure NEWER_WINS and use the column as the detect expression.
3. Disconnect the network between the two nodes
4. update the first database with a timestamp, make sure it has a large partial second.
5. quickly update the same row in the second database, make sure it has a small partial second.
6. Reconnect the network
Expected: a conflict is resolved, the second update is kept.
Actual: a conflict is resolved, but the first update is kept.
Additional InformationExpected workaround was to use date_trunc to remove microsecond resolution from my data, but the PostgreSqlDmlStatement class and PostgreSqlTriggerTemplate use a "US" pattern which causes timestamps in batches to be right padded with zeros.
Tagsconflict manager, data type, dialect: postgresql


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-08-07 09:41 jmueller New Issue
2019-08-09 09:53 elong Tag Attached: conflict manager
2019-08-09 09:53 elong Tag Attached: data type
2019-08-09 09:53 elong Tag Attached: dialect: postgresql