ptrdom commented on issue #533: URL: https://github.com/apache/pekko-persistence-r2dbc/issues/533#issuecomment-6441870458
The problem is broader than the repeated hour. With `connectionTimeZone = SERVER`, r2dbc-mysql resolves the server time zone from `@@system_time_zone`, which is an abbreviation like `EDT`. When that isn't a Java zone id, the driver fails with `ZoneRulesException: Unknown time-zone ID: EDT` and uses the JVM default time zone instead. Reproduction with MySQL 9.5.0 with `TZ=America/New_York` (`@@system_time_zone = EDT`), r2dbc-mysql 1.4.3 and the JVM in `Europe/Vilnius`: | id | written as | expected | stored | read | |---|---|---|---|---| | 1 | bound `Instant` | 2026-11-01T05:30Z | **12:30Z** | 05:30Z | | 2 | bound `Instant` | 2026-11-01T06:30Z | **13:30Z** | 06:30Z | | 3 | UTC literal | 2026-11-01T05:30Z | 05:30Z | **2026-10-31T23:30Z** | | 4 | UTC literal | 2026-11-01T06:30Z | 06:30Z | **2026-10-31T23:30Z** | So all timestamps are stored shifted by the difference between the JVM and server time zones (7 hours here), not only in the repeated hour, and the plugin's own round trip hides it because reading applies the same wrong conversion. Server-side comparisons like `db_timestamp < NOW(6) - <behind-current-time>` would be off by that difference too. This affects servers in zones whose abbreviation isn't a Java zone id (for example `EDT`, `EST`, `PDT`, `CEST`) whenever the JVM runs in a different zone. CI runs both in UTC, so it doesn't show. `connectionTimeZone = UTC` with `forceConnectionTimeZoneToSession = true` stores and reads all four rows correctly here too. #534 adds `DbTimestampDstSpec`, which checks the instants stored by the server, and is pending for MySQL until this is fixed. With the MySQL container in `America/New_York` and the spec enabled, it fails with the stored instants shifted by 7 hours. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
