0.7 migration can deadlock with a live released 0.6 fleet on awa.deferred_jobs

Abierto
#877 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
postgresql, rust

Línea de trabajo

Start with rolling_upgrade_rehearsal_test -- --ignored and reproduce the failing 0.6.3 cell with Postgres log_lock_waits enabled and a lower deadlock_timeout. Trace the migration step that alters awa.deferred_jobs and the 0.6.3 promotion, rescue, or retry path to identify the lock order; compare that path with 0.6.19. Done when the deadlock is reproducible and a fix or operational requirement is supported by the rehearsal.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What was seen

A full local run of rolling_upgrade_rehearsal_test -- --ignored against awa-pg==0.6.3 failed test_binary_first_current_refuses_v040_then_rolls_after_migration. migrations::run hit a Postgres deadlock (40P01): the current migration's ALTER TABLE awa.deferred_jobs was waiting on a 0.6.3 backend, which was waiting on the migration. The cell passed 2 of 2 when rerun alone, so the deadlock is intermittent. The 6-cell run against 0.6.19 passed (#876).

Why it matters

0.6.2 and later are supported rolling-upgrade sources, and the upgrade guide allows migrating while a 0.6 fleet runs. A deadlock aborts the migration transaction. It can be retried, but an operator following the guide gets an error partway through.

To find out

  • Which migration step issues the ALTER TABLE awa.deferred_jobs, and what lock it takes.
  • What the 0.6.3 backend was doing (promotion, rescue or retry into deferred_jobs) and which lock it already held when it waited on the migration. Lock order is a likely cause: the migration locks another table first, then deferred_jobs, while the 0.6 path takes them in the opposite order.
  • Whether 0.6.19 can hit the same cycle, or whether the 0.6 path changed between 0.6.3 and 0.6.19.
  • Fix options:
    • take the migration's locks in the order the runtime uses;
    • add a lock_timeout and retry around that step;
    • document that this migration needs a quiet window for that table.

The failing cell's evidence (Postgres log with the deadlock detail) was not kept. Reproduce with the rehearsal against 0.6.3, log_lock_waits = on and deadlock_timeout lowered.

Lenguaje dominante
Rust
Estrellas
37
Forks
8
Merge medio
14 h 16 min
PR fusionados (30 d)
244

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hardbyte/awa

Todos los issues de hardbyte/awa

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.