fix: address upload-consistency verify findings

Mark a stale pending row in its own committed transaction before the
cleaner deletes the object, and let mark_ready promote only unmarked
rows, so a cleaner rollback after the object delete can no longer leave
a ready attachment without its object. Add fault checks for an unknown
COMMIT outcome, an upload outliving the grace period and a cleaner
failure after the object delete; fix the cleaner entrypoint in rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:27:47 +03:00
co-authored by Claude Opus 5.5
parent f2dc0b368a
commit 87c48b940b
20 changed files with 714 additions and 118 deletions
+3 -2
View File
@@ -106,8 +106,9 @@ access_log=False)`. Импорты в `src/__main__.py` — внутри `if __n
engine и клиента S3; затем обработчики SIGTERM и SIGINT asyncio,
`early_stop.disarm()`, «Started cleaner».
- Цикл: проход, затем ожидание `[cleaner] interval_seconds` или
сигнала. SIGTERM / SIGINT ставят флаг: текущая строка доводится (не
дольше срока шага с БД, 6 с), новые не берутся, клиенты закрываются,
сигнала. SIGTERM / SIGINT ставят флаг: доводится текущий шаг строки —
пометка, удаление объекта или строки (не дольше срока шага с БД, 6 с;
флаг проверяется и между шагами), новые не берутся, клиенты закрываются,
«Stopped cleaner» и код 0 — раньше `stop_grace_period` 10 с. Сигнал
до обработчиков asyncio — ранний обработчик: «Stopped cleaner before
startup», код 0.