fix: delete the object and the row in one locked cleanup transaction

Keep the committed mark, then delete the object and the row under the
same row lock, so an older replica without the mark check that waits on
the row finds it gone instead of promoting it to ready after the object
delete. A mixed-version stand is no worse than before the mark; document
the upgrade order (replicas first, cleaner last) and fix stale wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 22:08:29 +03:00
co-authored by Claude Opus 5.5
parent 6551839807
commit 5889ca2ad7
13 changed files with 384 additions and 136 deletions
+5 -3
View File
@@ -106,9 +106,11 @@ 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 ставят флаг: доводится до commit или отката
текущий шаг строки — пометка или уборка (объект и строка одной
транзакцией; не дольше срока шага с БД, 6 с, DELETE в S3 внутри него
≤ 5 с; флаг проверяется и между шагами), новые не берутся, клиенты
закрываются,
«Stopped cleaner» и код 0 — раньше `stop_grace_period` 10 с. Сигнал
до обработчиков asyncio — ранний обработчик: «Stopped cleaner before
startup», код 0.