PostgreSQL: DeleteTable's first catalog select has no lock timeout and waits behind CreateBackup
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Read crates/storage-postgres/src/delete_table.rs around the initial FOR UPDATE select, then inspect the FOR SHARE rationale in crates/storage-postgres/src/backup_engine.rs and the timeout handling from PR #504 in worker_store.rs. First measure how DynamoDB handles DeleteTable during CreateBackup, as the issue says this behavior has not been re-measured. Add a test that holds the row FOR SHARE on a second connection; done means DeleteTable returns within the timeout with the response matching the measured service behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Where
crates/storage-postgres/src/delete_table.rs, the SELECT ... FROM tables WHERE account_id = $1 AND table_name = $2 AND table_status IN ('ACTIVE', 'CREATING') FOR UPDATE that starts every DeleteTable, on main at abf8082f (lines 27 to 41).
What happens
The select runs on a catalog transaction with no lock_timeout. It waits for any transaction that holds the table's row:
CreateBackupholds the rowFOR SHAREfrom its first catalog read until the data snapshot has been taken (crates/storage-postgres/src/backup_engine.rs, the comment above theFOR SHAREselect explains why), so a DeleteTable issued during a backup of a large table waits for the whole snapshot.UpdateTableholds the rowFOR UPDATEfor the length of its catalog transaction (crates/storage-postgres/src/update_table.rs).
While it waits, the request holds one connection of the catalog pool. With pool_size concurrent DeleteTable calls against tables being backed up, the pool is exhausted for other requests until the backups finish or sqlx's 30 s acquire timeout fires for the later callers.
The same shape was bounded for the control-plane pass in PR #504 (a transaction-local lock_timeout on the catalog transaction, and a defined answer when it fires). This select was left as it was because it is on main and not part of that fix.
Service behaviour
On Amazon DynamoDB, DeleteTable during a CreateBackup of the same table answers 200 with TableStatus: DELETING and the backup completes (the backup is of the table state at request time). This was not re-measured for this issue; the row for it should be measured before the fix is written.
Suggested fix
Set a transaction-local lock_timeout on the DeleteTable catalog transaction before the select (the constant PR #504 introduces in worker_store.rs can move to a shared place). On lock_not_available, decide the answer from the measurement: if the service serves the delete during a backup, the fix is to not block on the backup's FOR SHARE at all (for example by reading the row without the lock and marking it DELETING with a conditional UPDATE, letting the backup's definition read stay consistent through its own snapshot); otherwise answer ResourceInUseException with the measured sentence.
A test: hold the row FOR SHARE from a second connection, call DeleteTable, expect it to return within the timeout rather than wait for the release.
- Lenguaje dominante
- Rust
- Estrellas
- 517
- Forks
- 60
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 ExtendDB/extenddb
-
backend:mongodb bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 2 días
-
backend:cassandra bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
backend:cassandra bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
[storage.cassandra] accepts unknown keys silentlyPosiblemente ocupada @LeeroyHannigan la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ExtendDB/extenddb#540 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de ExtendDB/extenddb
Issues similares
-
desktop documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
vfarcic/dot-agent-deck#2008 ·
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
pbakaus/impeccable#1210 ·
Los mantenedores suelen responder en 1 día
-
Deduplicate the `--yes`/non-interactive-terminal refusal guard (three near-identical copies)Abiertoenhancement ux-opportunities
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: ci priority: P4 ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
shep-pm/shep#1249 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`PartialEq` for `AssignedBigUint` treats different values as equalPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertostatus:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
midnightntwrk/midnight-zk#600 ·
Los mantenedores suelen responder en 2 días