Release the quarantine only after the object hashes to the row again
A pass without --deep released the quarantine of a missing or resized attachment as soon as an object of the same size appeared under its key, so other bytes of the same length went back to /content. The pass now streams and hashes the object of every quarantined row whose size matches again, deep or not, and releases it only when the SHA-256 matches; other bytes keep the row quarantined. Consistent data still costs no GET. The keyset reads page + 1 rows, so a pass takes exactly ceil(N/page) SQL pages instead of one more for the empty tail. The reconciler is assembled by dishka from PlatformProvider and the attachment storage provider that the API uses too, and it publishes the events of the intents it drops, so audit.attachment_discarded reason=reconcile reaches the journal. Any failure of a pass, not only Unavailable, ends as reconcile.failed with the error type and exit code 1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b6c04f2296
commit
3de1dcdc84
@@ -1,15 +1,15 @@
|
||||
## 1. Зона `attachments`: приложение
|
||||
|
||||
- [ ] 1.1 `Pass`: хеширование объекта строки в карантине с совпавшим размером и без `--deep`; `_healthy` только после совпавшего хеша
|
||||
- [ ] 1.2 `Pass._rows`: выборка `страница + 1`, без пустой страницы
|
||||
- [ ] 1.3 `StorageReconciler` с портом `EventPublisher`: публикация событий после удаления намерения
|
||||
- [ ] 1.4 Проверка группы: `make lint`
|
||||
- [x] 1.1 `Pass`: хеширование объекта строки в карантине с совпавшим размером и без `--deep`; `_healthy` только после совпавшего хеша
|
||||
- [x] 1.2 `Pass._rows`: выборка `страница + 1`, без пустой страницы
|
||||
- [x] 1.3 `StorageReconciler` с портом `EventPublisher`: публикация событий после удаления намерения
|
||||
- [x] 1.4 Проверка группы: `make lint`
|
||||
|
||||
## 2. Зона `attachments`: точка входа
|
||||
|
||||
- [ ] 2.1 `AttachmentStorageProvider` в `entrypoints/ioc.py`; `ReconcileProvider` и сборка `make_async_container` в `entrypoints/reconcile.py`; журнал удалений через `EventBus`
|
||||
- [ ] 2.2 `main`: любая ошибка прохода → `reconcile.failed`, код `1`
|
||||
- [ ] 2.3 Проверка группы: API-тесты: другие байты той же длины оставляют карантин; восстановленные снимают его без `--deep` одним `GET`; SQL-страниц `⌈N/страница⌉`; событие `reason=reconcile`; ошибка не `Unavailable` → `reconcile.failed`, код `1`
|
||||
- [x] 2.1 `AttachmentStorageProvider` в `entrypoints/ioc.py`; `ReconcileProvider` и сборка `make_async_container` в `entrypoints/reconcile.py`; журнал удалений через `EventBus`
|
||||
- [x] 2.2 `main`: любая ошибка прохода → `reconcile.failed`, код `1`
|
||||
- [x] 2.3 Проверка группы: API-тесты: другие байты той же длины оставляют карантин; восстановленные снимают его без `--deep` одним `GET`; SQL-страниц `⌈N/страница⌉`; событие `reason=reconcile`; ошибка не `Unavailable` → `reconcile.failed`, код `1`
|
||||
|
||||
## 3. Обвязка трека
|
||||
|
||||
|
||||
Reference in New Issue
Block a user