docs: record track2-reconcile-cost verify fix evidence and numbers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 20:26:54 +03:00
co-authored by Claude Opus 5.5
parent ca0c4b2f71
commit fd03b84b68
7 changed files with 277 additions and 102 deletions
+127 -66
View File
@@ -1,29 +1,32 @@
# `make failure_checks`: проверки отказов с уборщиком, согласованностью БД и S3, местами загрузки, сверкой и простоем S3
- Дата: 2026-10-23, ~15:55–16:07:13 UTC.
- Commit: `0072dbe` (change `track2-reconcile-cost`: код — `8d4cf7e`,
после него `src` не менялся; `d8b8ae3` и `0072dbe` — проверка строк
стенда `bench/` и каталог метки). Рабочее дерево чистое, образ
`mtusi-messenger:lab4` собран из него.
- Дата: 2026-10-23, 17:06:13–17:21:11 UTC.
- Commit: `ca0c4b2` (правки по verify change `track2-reconcile-cost`).
Рабочее дерево чистое, образ `mtusi-messenger:lab4` собран из него.
- Стенд отказов — как в снимке `723b6c3` ниже: проект
`mtusi-lab4-failures`, свои PostgreSQL, Valkey и S3 с bootstrap,
уборщик с grace 20 с, интервалом 1 с и без плановой сверки, четыре
API. Рабочий стенд `mtusi-lab4` в это время запущен на том же образе
(`make run_docker APP_OUT_PORT=8090`: реплики `api-27`, `api-28`,
уборщик, LB на `127.0.0.1:8090`), до и после прогона — те же
API. Рабочий стенд `mtusi-lab4` в это время запущен на том же коде
(`make rolling_update APP_OUT_PORT=8090`: реплики `api-29`, `api-30`,
уборщик пересоздан, LB на `127.0.0.1:8090`), до и после прогона — те же
контейнеры.
- +5 проверок change `track2-reconcile-cost`:
`test_reconcile_head_strategy_same_findings`,
- Проверки change `track2-reconcile-cost` — 5 исходных
(`test_reconcile_head_strategy_same_findings`,
`test_reconcile_deep_checksum`,
`test_reconcile_restore_needs_same_bytes`, `test_reconcile_rate_limit`,
`test_reconcile_limit_stops_rechecks`. Их красный прогон на коде до
change — раздел «Красный прогон до кода `track2-reconcile-cost`» в
конце файла.
`test_reconcile_limit_stops_rechecks`) и 2 по замечаниям verify
(`test_reconcile_row_with_other_id_key`,
`test_reconcile_fresh_overwrite_untouched`). Красные прогоны — разделы
«Красный прогон до кода `track2-reconcile-cost`» и «Красный прогон
тестов verify» в конце файла.
- Прежний снимок с `0072dbe` (до правок по verify): 54 из 54, pytest
712 с.
## Итог: код 0, 54 из 54
## Итог: код 0, 56 из 56
Код команды — 0, pytest — 712 с (49 из 49 за 552 с в снимке
`723b6c3`: +5 проверок сверки, ~2,5 мин — ожидания grace стенда). Ниже
Код команды — 0, pytest — 877 с, вся команда — 898 с (54 из 54 за 712 с
на `0072dbe`: +2 проверки verify, ~1,5 мин, остальное — разброс шумного
хоста; 49 из 49 за 552 с в снимке `723b6c3`). Ниже
— вывод от запуска pytest до конца. Опущены сборка образа (из кэша),
старт хранилищ, миграции, bootstrap S3 и уборщик: они те же, что в
полном выводе снимка `723b6c3`. Путь к рабочему каталогу в строках
@@ -42,7 +45,7 @@ python3 student-tests/run_failures.py
[failure_checks] start cleaner: grace 20 s, interval 1 s, reconcile interval 0 s (0 — off)
…
[failure_checks] start api containers
[failure_checks] ready: api=http://127.0.0.1:51536 tight=http://127.0.0.1:51544 uploads=http://127.0.0.1:51549 s3=http://127.0.0.1:51555
[failure_checks] ready: api=http://127.0.0.1:60328 tight=http://127.0.0.1:60332 uploads=http://127.0.0.1:60336 s3=http://127.0.0.1:60340
[failure_checks] pytest -m fault
============================= test session starts ==============================
platform darwin -- Python 3.12.12, pytest-9.1.1, pluggy-1.6.0 -- …/.venv/bin/python
@@ -51,66 +54,68 @@ rootdir: …
configfile: pyproject.toml
testpaths: student-tests
plugins: anyio-4.15.1
collecting ... collected 252 items / 198 deselected / 54 selected
collecting ... collected 254 items / 198 deselected / 56 selected
student-tests/test_failures.py::test_expired_token PASSED [ 1%]
student-tests/test_failures.py::test_use_does_not_extend_session PASSED [ 3%]
student-tests/test_failures.py::test_token_while_database_stopped PASSED [ 5%]
student-tests/test_failures.py::test_members_failure_rolls_back_chat PASSED [ 7%]
student-tests/test_failures.py::test_database_stopped_and_back PASSED [ 9%]
student-tests/test_failures.py::test_pool_exhausted PASSED [ 11%]
student-tests/test_failures.py::test_database_stopped_and_back PASSED [ 8%]
student-tests/test_failures.py::test_pool_exhausted PASSED [ 10%]
student-tests/test_failures.py::test_connection_limit_reached PASSED [ 12%]
student-tests/test_failures.py::test_pool_keeps_connections PASSED [ 14%]
student-tests/test_failures.py::test_readiness_without_database PASSED [ 16%]
student-tests/test_failures.py::test_readiness_without_cache PASSED [ 18%]
student-tests/test_failures.py::test_readiness_without_object_storage[stop] PASSED [ 20%]
student-tests/test_failures.py::test_readiness_without_object_storage[pause] PASSED [ 22%]
student-tests/test_failures.py::test_flush_cache PASSED [ 24%]
student-tests/test_failures.py::test_readiness_without_cache PASSED [ 17%]
student-tests/test_failures.py::test_readiness_without_object_storage[stop] PASSED [ 19%]
student-tests/test_failures.py::test_readiness_without_object_storage[pause] PASSED [ 21%]
student-tests/test_failures.py::test_flush_cache PASSED [ 23%]
student-tests/test_failures.py::test_valkey_stopped PASSED [ 25%]
student-tests/test_failures.py::test_valkey_paused PASSED [ 27%]
student-tests/test_failures.py::test_valkey_back PASSED [ 29%]
student-tests/test_failures.py::test_message_failure_keeps_key_free PASSED [ 31%]
student-tests/test_failures.py::test_database_outage_keeps_key_free PASSED [ 33%]
student-tests/test_failures.py::test_key_free_after_ttl PASSED [ 35%]
student-tests/test_failures.py::test_upload_with_object_storage_stopped PASSED [ 37%]
student-tests/test_failures.py::test_rejected_uploads_leave_nothing PASSED [ 38%]
student-tests/test_failures.py::test_metadata_insert_failure PASSED [ 40%]
student-tests/test_failures.py::test_interrupted_body PASSED [ 42%]
student-tests/test_failures.py::test_ready_failure_compensated PASSED [ 44%]
student-tests/test_failures.py::test_killed_between_put_and_ready PASSED [ 46%]
student-tests/test_failures.py::test_ready_commit_outcome_unknown PASSED [ 48%]
student-tests/test_failures.py::test_upload_outlives_grace PASSED [ 50%]
student-tests/test_failures.py::test_cleaner_failure_after_object_delete PASSED [ 51%]
student-tests/test_failures.py::test_cleaner_survives_outages PASSED [ 53%]
student-tests/test_failures.py::test_object_storage_stopped PASSED [ 55%]
student-tests/test_failures.py::test_environment_does_not_change_limits PASSED [ 57%]
student-tests/test_failures.py::test_object_storage_paused PASSED [ 59%]
student-tests/test_failures.py::test_upload_slots_busy PASSED [ 61%]
student-tests/test_failures.py::test_rejections_before_queue PASSED [ 62%]
student-tests/test_failures.py::test_upload_waits_for_slot PASSED [ 64%]
student-tests/test_failures.py::test_slot_released_after_failures PASSED [ 66%]
student-tests/test_failures.py::test_slow_body PASSED [ 68%]
student-tests/test_failures.py::test_upload_after_idle_s3 PASSED [ 70%]
student-tests/test_failures.py::test_reconcile_finds_and_fixes PASSED [ 72%]
student-tests/test_failures.py::test_reconcile_keeps_fresh_used_and_unknown PASSED [ 74%]
student-tests/test_failures.py::test_reconcile_restored_original PASSED [ 75%]
student-tests/test_failures.py::test_reconcile_change_limit PASSED [ 77%]
student-tests/test_failures.py::test_reconcile_keeps_referenced_objects PASSED [ 79%]
student-tests/test_failures.py::test_reconcile_limit_keeps_cleanup PASSED [ 81%]
student-tests/test_failures.py::test_reconcile_foreign_key_untouched PASSED [ 83%]
student-tests/test_failures.py::test_reconcile_object_storage_stopped PASSED [ 85%]
student-tests/test_failures.py::test_reconcile_interrupted_by_database PASSED [ 87%]
student-tests/test_failures.py::test_reconcile_under_load PASSED [ 88%]
student-tests/test_failures.py::test_scheduled_reconcile PASSED [ 90%]
student-tests/test_failures.py::test_reconcile_head_strategy_same_findings PASSED [ 92%]
student-tests/test_failures.py::test_reconcile_deep_checksum PASSED [ 94%]
student-tests/test_failures.py::test_reconcile_restore_needs_same_bytes PASSED [ 96%]
student-tests/test_failures.py::test_reconcile_rate_limit PASSED [ 98%]
student-tests/test_failures.py::test_reconcile_limit_stops_rechecks PASSED [100%]
student-tests/test_failures.py::test_valkey_paused PASSED [ 26%]
student-tests/test_failures.py::test_valkey_back PASSED [ 28%]
student-tests/test_failures.py::test_message_failure_keeps_key_free PASSED [ 30%]
student-tests/test_failures.py::test_database_outage_keeps_key_free PASSED [ 32%]
student-tests/test_failures.py::test_key_free_after_ttl PASSED [ 33%]
student-tests/test_failures.py::test_upload_with_object_storage_stopped PASSED [ 35%]
student-tests/test_failures.py::test_rejected_uploads_leave_nothing PASSED [ 37%]
student-tests/test_failures.py::test_metadata_insert_failure PASSED [ 39%]
student-tests/test_failures.py::test_interrupted_body PASSED [ 41%]
student-tests/test_failures.py::test_ready_failure_compensated PASSED [ 42%]
student-tests/test_failures.py::test_killed_between_put_and_ready PASSED [ 44%]
student-tests/test_failures.py::test_ready_commit_outcome_unknown PASSED [ 46%]
student-tests/test_failures.py::test_upload_outlives_grace PASSED [ 48%]
student-tests/test_failures.py::test_cleaner_failure_after_object_delete PASSED [ 50%]
student-tests/test_failures.py::test_cleaner_survives_outages PASSED [ 51%]
student-tests/test_failures.py::test_object_storage_stopped PASSED [ 53%]
student-tests/test_failures.py::test_environment_does_not_change_limits PASSED [ 55%]
student-tests/test_failures.py::test_object_storage_paused PASSED [ 57%]
student-tests/test_failures.py::test_upload_slots_busy PASSED [ 58%]
student-tests/test_failures.py::test_rejections_before_queue PASSED [ 60%]
student-tests/test_failures.py::test_upload_waits_for_slot PASSED [ 62%]
student-tests/test_failures.py::test_slot_released_after_failures PASSED [ 64%]
student-tests/test_failures.py::test_slow_body PASSED [ 66%]
student-tests/test_failures.py::test_upload_after_idle_s3 PASSED [ 67%]
student-tests/test_failures.py::test_reconcile_finds_and_fixes PASSED [ 69%]
student-tests/test_failures.py::test_reconcile_keeps_fresh_used_and_unknown PASSED [ 71%]
student-tests/test_failures.py::test_reconcile_restored_original PASSED [ 73%]
student-tests/test_failures.py::test_reconcile_change_limit PASSED [ 75%]
student-tests/test_failures.py::test_reconcile_keeps_referenced_objects PASSED [ 76%]
student-tests/test_failures.py::test_reconcile_limit_keeps_cleanup PASSED [ 78%]
student-tests/test_failures.py::test_reconcile_foreign_key_untouched PASSED [ 80%]
student-tests/test_failures.py::test_reconcile_object_storage_stopped PASSED [ 82%]
student-tests/test_failures.py::test_reconcile_interrupted_by_database PASSED [ 83%]
student-tests/test_failures.py::test_reconcile_under_load PASSED [ 85%]
student-tests/test_failures.py::test_scheduled_reconcile PASSED [ 87%]
student-tests/test_failures.py::test_reconcile_head_strategy_same_findings PASSED [ 89%]
student-tests/test_failures.py::test_reconcile_deep_checksum PASSED [ 91%]
student-tests/test_failures.py::test_reconcile_restore_needs_same_bytes PASSED [ 92%]
student-tests/test_failures.py::test_reconcile_rate_limit PASSED [ 94%]
student-tests/test_failures.py::test_reconcile_limit_stops_rechecks PASSED [ 96%]
student-tests/test_failures.py::test_reconcile_row_with_other_id_key PASSED [ 98%]
student-tests/test_failures.py::test_reconcile_fresh_overwrite_untouched PASSED [100%]
==================================== PASSES ====================================
================ 54 passed, 198 deselected in 712.49s (0:11:52) ================
[failure_checks] postgres log: 461 lines, crash markers 0; "too many clients" 30, "administrator command" 147
================ 56 passed, 198 deselected in 877.24s (0:14:37) ================
[failure_checks] postgres log: 466 lines, crash markers 0; "too many clients" 32, "administrator command" 148
[failure_checks] cleanup
…
Volume mtusi-lab4-failures_s3_data Removed
@@ -1079,3 +1084,59 @@ make: *** [failure_checks] Error 1
Стенд отказов после прогона убран. Зелёный прогон всех пяти на коде
change — раздел «Итог» в начале файла (вместе с остальными 49).
## Красный прогон тестов verify `track2-reconcile-cost` (2026-10-23)
Тесты по замечаниям verify W2 и S1 — в их окончательном виде (commit
`ca0c4b2`) — против `src` на `16f2cde`, коде до правки: дерево `git
archive 16f2cde` во временном каталоге, поверх — `student-tests/` из
`ca0c4b2`; образ `mtusi-messenger:lab4` собран `make failure_checks` из
этого дерева. 2026-10-23 ~17:00 UTC, стенд отказов — тот же проект
`mtusi-lab4-failures`. После — образ пересобран из `ca0c4b2` до замены
реплик и полного прогона выше. `.env` временного дерева — свои случайные
секреты, каталог удалён.
```
$ make failure_checks FAULT_ARGS='-k "row_with_other_id_key or fresh_overwrite_untouched"'
…
collecting ... collected 254 items / 252 deselected / 2 selected
student-tests/test_failures.py::test_reconcile_row_with_other_id_key FAILED [ 50%]
student-tests/test_failures.py::test_reconcile_fresh_overwrite_untouched FAILED [100%]
…
> assert own_findings(batch, FOUND, keys.values()) == expected
E AssertionError: assert {('unknown_ob...20e65b34a17')} == {('checksum_m...20e65b34a17')}
E Extra items in the right set:
E ('checksum_mismatch', 'messenger/attachments/a0ccf942-ff0b-4556-84bd-2d7488cd883c/original', 'b279c2a6-a273-42d7-8cf1-d2e8c81d9010')
E ('size_mismatch', 'messenger/attachments/c0a74af8-d37a-42dc-b03a-a20e65b34a17/original', '640601f0-ad14-4436-9af1-94f57dd06609')
…
> assert not run.about(FIXED, ids=ids), run.finished
E AssertionError: {'event': 'Finished reconcile pass', …}
E assert not [{'event': 'Fixed storage discrepancy', …}]
====================== 2 failed, 252 deselected in 44.01s ======================
…
[failure_checks] results: {'fault': 1, 'postgres': 0}
```
Причины — те, что ожидались:
- `…_row_with_other_id_key` (W2): `batch` не сравнил Y1 и Y2 с объектами
`<Z1>/original` и `<Z2>/original`, на которые они ссылаются: в его
отчёте только четыре чужих объекта, `size_mismatch` Y1 и
`checksum_mismatch` Y2 нет (стратегия `head` их находила);
- `…_fresh_overwrite_untouched` (S1): первый проход `--deep --apply`
пометил потерянным вложение, объект которого только что перезаписан
байтами другого размера: запись «Fixed storage discrepancy» —
`size_mismatch`, `marked_lost`, `size_bytes` 9332, `stored_size` 9333.
Первый красный прогон (16:30 UTC, дерево с `src` `16f2cde` до правки)
был с прежним видом `…_fresh_overwrite_untouched`: оба прохода в одном
окне grace. Падения те же. Тест поменян после него не из-за красного:
на коде с правкой два глубоких прохода подряд заняли 23,4 с, больше
grace стенда 20 с (глубокий проход читает весь bucket), и проверка
времени срабатывала раньше проверок сверки. Теперь объекты
перезаписываются перед каждым проходом. Поэтому этот красный прогон
снят заново с окончательной версией.
W1 (сигнал в паузе предела) тестом отказов не проверяется — hook не
шлёт сигнал посреди прохода. Красный и зелёный прогоны — `driver.py
reconcile-signal --pace [--apply]`, `evidence/reconcile/service.md`.