View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004062||SymmetricDS||Bug||public||2019-08-07 13:41||2022-08-08 19:31|
|Target Version||3.11.4||Fixed in Version||3.11.4|
|Summary||0004062: SimpleDateFormat is incompatible with PostgreSql microsecond template|
|Description||FormatUtils 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 Reproduce||1. 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 Information||Expected 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.|
|Tags||conflict manager, data type, dialect: postgresql|
|2019-08-07 13:41||jmueller||New Issue|
|2019-08-09 13:53||elong||Tag Attached: conflict manager|
|2019-08-09 13:53||elong||Tag Attached: data type|
|2019-08-09 13:53||elong||Tag Attached: dialect: postgresql|
|2022-08-08 19:31||emiller||Status||new => resolved|
|2022-08-08 19:31||emiller||Resolution||open => fixed|
|2022-08-08 19:31||emiller||Fixed in Version||=> 3.11.4|
|2022-08-08 19:31||emiller||Relationship added||related to 0004246|