Adds worker-memory, freeze-sessions and freeze-lb driver commands, retakes the evidence they produce, and fills the report header. src/ and bench/ are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
2.9 KiB
Markdown
24 lines
2.9 KiB
Markdown
# Кэш карточки чата
|
||
|
||
- Команды: `make test_isolated` (ключи временной базы), затем `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 cache-check --require-test-keys`
|
||
- Дата: 2026-11-01; `make test_isolated` 10:29:02–10:31:48 UTC, `cache-check` 10:33:20–10:33:45 UTC, код выхода `cache-check` 0
|
||
- Код выхода `make test_isolated` 2 и только по одной причине: 1 failed (`test_exclusion_evidence_exists`: этого файла и двух соседних ещё не было), 217 passed, 6 skipped (тесты реплик), 147 deselected; публичный `make test` в нём — код 0. Снятие файла этой команды требует её прогона, поэтому поменять порядок нельзя
|
||
- Commit: `9639aa1` (ветка `feat/track1-queue-overload`), код `src/` и `bench/` тот же, что на `5ee3257`; на рабочем дереве изменён только `.claude/skills/run-mtusi-messenger/driver.py`, команда `cache-check` не менялась
|
||
- Стенд: проект compose `mtusi-lab5`, две реплики за HAProxy, собран `make run_docker` из `HEAD`; пользователи и чат синтетические
|
||
- Спеки: `chat-cache`, «Чтение из кэша», «Срок записи», «Временная база» (исключения сверки покрытия: по HTTP ответ из кэша не отличить от ответа из PostgreSQL)
|
||
|
||
Итог: на 50 чтений карточки через LB — одно чтение таблицы `chats` (первое, ключ перед этим удалён), +49 попаданий и +1 промах Valkey; срок ключа не больше настроенного, чтения его не продлевают; ключи рабочей и временной базы под разными префиксами.
|
||
|
||
```text
|
||
users alice_… (creator) and bob_… (reader), chat baf5835e-a6d9-430f-81bd-a8133f510fac
|
||
key messenger:v1:messenger:chat:baf5835e-a6d9-430f-81bd-a8133f510fac
|
||
right after 201: EXISTS 1, TTL 3600 s (configured [cache] chat_ttl_seconds 3600 s in the replica); value keys ['created_at', 'id', 'member_ids', 'title'], member_ids in creation order: yes
|
||
DEL key: the first read is a miss; waiting 11 s
|
||
50 × GET /api/v1/chats/{id} by the reader through LB: 50 equal to the creation response; by replica 5de01d9e5999 25, 7f8add826e12 25
|
||
after 11 s: reads of table chats (seq_scan + idx_scan) +1, keyspace_hits +49, keyspace_misses +1
|
||
TTL 3588 s, then 10 more reads, TTL 3588 s: reads do not extend the key
|
||
keys messenger:v1:messenger:chat:*: 1
|
||
keys messenger:v1:test_messenger:chat:*: 166
|
||
PASS: one read of chats, the rest from Valkey; TTL is bounded; temporary database: 166 keys under its own prefix
|
||
```
|