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
+6 -2
View File
@@ -128,7 +128,9 @@ paths:
`BEFORE UPDATE OF status`, пока строку не уберёт уборщик: на уровне
оператора строка не заблокирована, а пометку уборщика (только
`updated_at`) `OF status` не задерживает; `undeletable` — как
`outlive`, и удаление строки падает), `clear-fail-attachments`,
`outlive`, и удаление строки падает — в той же транзакции уборки,
где уборщик уже удалил объект: это откат второго шага после удачного
DELETE в S3), `clear-fail-attachments`,
`kill-api` / `start-api` (`docker kill` / `docker start`
`<FAULT_PROJECT>-api`, ожидание `healthy`);
- тесты: `test_upload_with_object_storage_stopped` (+ «Незавершённая
@@ -161,7 +163,9 @@ paths:
сценарии прежний код уже выполнял. Тесты по замечаниям verify:
`test_cleaner_failure_after_object_delete` красный на коде до пометки
(201: ждавший `mark_ready` перевёл строку в `ready` после отката
уборщика, объект уже удалён); `test_ready_commit_outcome_unknown` и
уборщика, объект уже удалён; на двухшаговой схеме — пометка, затем
объект и строка одной транзакцией — тест не менялся и проверяет тот
же откат); `test_ready_commit_outcome_unknown` и
`test_upload_outlives_grace` на том коде зелёные (ветки были верны) и
красные на временных регрессиях — компенсация на любой сбой (объекта
нет сразу после 503) и возврат `RuntimeError` (500);