Postgres: TIMESTAMP WITHOUT TIME ZONE + java.sql.Timestamp stores JVM-local time; mixed-TZ fleets/DST corrupt ordering, lag, purge
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with PostgresOutboxStore, which binds created_at, updated_at and last_attempt with setTimestamp and reads them back with getTimestamp, and with the Postgres schema changesets that declare these columns as TIMESTAMP. Add a migration that converts the columns to timestamptz, then switch the store to OffsetDateTime binding and reading. Done when a test passes with a non-UTC TimeZone.setDefault and the migration path for existing users is documented.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Severity: Medium · Area: okapi-postgres schema and JDBC mapping · Found in: code review of main @ e5630a1 (reasoned from pgjdbc semantics, not reproduced)
Problem
The Postgres schema declares created_at, updated_at and last_attempt as TIMESTAMP (without time zone). PostgresOutboxStore writes them with setTimestamp(Timestamp.from(instant)) and reads them with getTimestamp(...).toInstant(). pgjdbc renders a java.sql.Timestamp in the JVM default time zone, so the column stores local wall-clock time of whichever JVM wrote the row:
- Mixed-TZ fleets (e.g. one pod with
TZ=Europe/Warsaw, others UTC, or a developer laptop pointed at a shared DB):ORDER BY created_atis skewed by hours- the lag gauge (
okapi.entries.lag.seconds) is off by hours, possibly negative - the purger's
last_attempt < cutoffdeletesDELIVEREDrows hours early or keeps them hours late
- DST fall-back in a non-UTC zone: an hour of local times repeats, so two different instants map to the same stored value. Ordering and lag are wrong for that hour, and reading back can shift values by 1 h.
MySQL TIMESTAMP(6) normalizes to UTC, so this mainly affects Postgres.
Suggested fix
Migrate the columns to TIMESTAMPTZ (changeset 002 with ALTER COLUMN ... TYPE timestamptz USING ... AT TIME ZONE '<zone that wrote the data>', documented for existing users). Bind with setObject(i, instant.atOffset(ZoneOffset.UTC)) and read with getObject(col, OffsetDateTime::class.java). Add a test that runs the store with a non-UTC TimeZone.setDefault.
- Lenguaje dominante
- Kotlin
- Estrellas
- 14
- Forks
- 0
- Merge medio
- 9 h 54 min
- PR fusionados (30 d)
- 11
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de softwaremill/okapi
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
softwaremill/okapi#141 ·
Los mantenedores suelen responder en 1 día
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failurePosiblemente ocupada @rawo la tomó hoy. Abiertobreaking-change bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
softwaremill/okapi#137 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 1-2 días Aptitud para principiantes 42/100
softwaremill/okapi#136 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 Medio día Aptitud para principiantes 62/100
softwaremill/okapi#134 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
softwaremill/okapi#133 ·
Los mantenedores suelen responder en 1 día
Todos los issues de softwaremill/okapi
Issues similares
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
airbytehq/airbyte#91201 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Source: c7 Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
2.23
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ankidroid/Anki-Android#23042 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Submission] AI通话助手Abiertosubmit-adaption submit-adaption-pre
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
BetterAndroid/android-notification-icon-project#828 · 1 comentario ·
Los mantenedores suelen responder en 1 día