Skip to content

log-shipper: ship deletion_ledger_start and duckdb_cache_cleanup_failed (TC-4177, TC-4190) [hash to be recomputed on top of #749 + ingress pin] - #751

Merged
samgbafa merged 7 commits into
mainfrom
aa33/logship-bundle
Nov 25, 2026
Merged

samgbafa merged 7 commits into
mainfrom
aa33/logship-bundle

Conversation

@samgbafa

@samgbafa samgbafa commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

test-ruling: TC-4177 (12:55Z) - log-shipper/profile.test.mjs:28,:30 add 'event_route.deletion_ledger_start' to sinks.betterstack.inputs and 'deletion_ledger_start' to the event_route keys; equality kept, nothing removed.

DRAFT. Merges only after #750 (the deletion_ledger_start line must exist) and the review/CI conditions from the ruling. If main's compose changes again before merge, recompute the hash again (steps below).

What changed

One logship bundle, two events (precedent: #722 / #727, TC-3973 delegation_mode_boot_reindex).

TC-4177: deletion_ledger_start (the info line from #750, log_deletion_ledger_start, target tinycloud, head a556e132):

  • log-shipper/sanitize.vrl: new ledger_start block. Ships ledger_file (missing|empty|present), bytes, operations, key_entries, committed, aborted (integers 0..2^53-1) and newest_deleted_at (none or an RFC 3339 instant by regex), exactly those keys plus event/svc/level/ts. Input must have exactly the 9 node keys (message, event + 7). The failure variant ("deletion ledger counts unavailable at start") ships event + error_kind (the ledger's 8 fixed kinds) only. Message, paths, ids are never copied.
  • scripts/tc959-logship.mjs: gate lets an info line on target tinycloud through only when fields.event == "deletion_ledger_start" (every other info line there is still filtered_level); request_profile event list; new event_route.deletion_ledger_start (no cap, no reducer: the reducer would drop the counts); sink input.
  • log-shipper/ledger.mjs: the constants. cases.mjs: Vector cases (see below). fields.json + canonical.json pin, diagnostics.json untouched for this event (it is info, not a diagnostic count).
  • Fields survive end to end: Vector cases assert the sink-route output carries every count with its value and exactly the key set (keys(.) == [...]), under both profiles.

TC-4190: duckdb_cache_cleanup_failed: tinycloud-core/src/duckdb/database.rs ~:510 is warn! again (it was demoted to debug! in #647; the demotion note at that line and in #647's body matches TC-4190). diagnostics.json maps the exact message "Database cache cleanup failed" to the code; coverage.test.mjs passes with it.

Schema: tinycloud-dev-sam#384 (draft), branch head 764c32a9c3a8cc9f050f10e40a46e47cabfbe9eb (dev-sam main 014b2dc5 merged in, plus the four #756 event codes; earlier heads a33ebf8d, a78ec093, ab0c591b), fields.json sha256 9abea684d4b9e396f67b7a612733d6f788d35f9b1a5ae806430644b6c3a2ba9b. canonical.json pins that head; if #384 is squash-merged, re-pin revision to the merge commit (sha256 unchanged; the revision is not part of any hash here).

Compose / hash: merged origin/main 4e2ca8f4 (#749 cloudflared, #753 ingress pin 7e5dc37a, #746-#748) into this branch (merge commit, no rebase). VECTOR_CONFIG_JSON regenerated in docker-compose.dstack-postgres.yaml and scripts/ci/fixtures/tc959-n0-compose.yaml with recompute-hash.py on the merged compose: git diff origin/main of both files is exactly that one line each (cloudflared service and ingress pin lines untouched). n0_template_hash in docker.yml and the docs/releasing.md table: 693f06e86e0ea576a435b891214e9aaf528204c66131d85f53b4a805f8c47a60 (raw ef81b59ff3034ff17c049ac281173c4ac69ee8036f4d6333b19ed260c60e71b9); main today a6902dd53525d2392146ef913f81bbdd19248116304a7f100fab206666e6b71c (raw a52a126d…). The algorithm reproduces main's a6902dd5… from main's compose. Merge conflicts were text only (docker.yml comment + hash line, CHANGELOG, docs/releasing.md); both sides kept.

Re-recompute the hash (only if main's compose changes again)

git merge origin/main; python3 /var/tmp/aa33-logship/recompute-hash.py <repo> --write (regenerates only the VECTOR_CONFIG_JSON line of both compose files and prints raw sha256 and n0_template_hash); put the printed hash into .github/workflows/docker.yml (n0_template_hash) and docs/releasing.md (table + "redeploys exactly main's raw compose"); run node scripts/tc959-check.mjs, python3 scripts/ci/test-deploy-recovery.py, node --test log-shipper/*.test.mjs.

Existing tests (ruled, edited)

Naomi ruled YES (12:55Z). log-shipper/profile.test.mjs:28 and :30 now include the new entries, each with a // test-ruling: TC-4177 … trailing comment (commit 1e9aa4741f). Equality kept, nothing removed. New test file log-shipper/ledger-start.test.mjs (4 tests) is registered in .github/workflows/logship.yml.

Ran locally

  • node --test log-shipper/*.test.mjs: 31 tests, 31 pass, after the ruled profile.test.mjs edit (before it: 30 pass, 1 fail). The vector test run below was on 595e00d5; since then: the ruled test edit, the merge of main, and the recompute (the VRL/gate/cases are unchanged by the merge: git diff 1e9aa474 HEAD -- log-shipper/sanitize.vrl log-shipper/cases.mjs is empty). vector test was NOT re-run on the merged head.
  • node --test scripts/tc959-docker.test.mjs scripts/tc959-readiness.test.mjs: 26/26 pass.
  • node scripts/tc959-check.mjs: pass (schema pin, compose isolation, image pins, embedded Vector parity), also on the TC-4194 P1: cloudflared connector in N0 compose, secret wiring, template hash #749 trial merge.
  • python3 scripts/ci/test-deploy-recovery.py: 35/35 OK.
  • vector test (Vector 0.59.0 gnu, LOCAL): profile errors_slow 466 passed / 0 failed, profile all_requests 466 passed / 0 failed. Includes the new start-line cases (3 file states, failure variant, free-text file state not routed) and the whole-event-drop reject cases at the allowlist level.

Not run

Rollback

Revert the commit; compose/hash revert with it. The Rust change only restores the previous log level. Deployed N0 needs a compose redeploy either way (the hash gate).

Details: TC-4177, TC-4190

After the merge with main (b925c14)

  • LOCAL: node --test log-shipper/*.test.mjs scripts/tc959-docker.test.mjs scripts/tc959-readiness.test.mjs 57/57 pass; node scripts/tc959-check.mjs pass; scripts/ci/test-deploy-recovery.py 35/35 OK, test-cloudflared-connector.py 6/6 OK, test-docker-tags.py ok. Not run on the merged head: vector test, cargo, tc959-docker.mjs.

Four TC-1491 P4.2a codes folded in (Naomi ruling 02:15Z; head 5a95c4da9643e5f5e2fb4f6a182a9f3cf890a20d)

So node #756 needs no second schema pin. event_code enum (schema #384 and log-shipper/fields.json) gains, inserted after shadow_drained_behind_pg: store_master_mode_unreadable_refused, store_master_backstop_rotation_failed, shadow_local_working_copy_missing, shadow_local_read_failed. log-shipper/diagnostics.json exact gains the four messages (taken from #756's draft patch, only these four of its nine):

  • "sql store mode unreadable; refusing the request" (warn) -> store_master_mode_unreadable_refused
  • "store-master backstop rotation failed" (warn) -> store_master_backstop_rotation_failed
  • "sql_store: a store-master database has no working copy" (error) -> shadow_local_working_copy_missing
  • "sql_store local source could not read a working copy" (warn) -> shadow_local_read_failed

The log lines do not exist on main yet (they arrive with #756). node --test log-shipper/*.test.mjs (coverage.test.mjs: one-directional "every warn/error line has a code" and "every mapped code is a schema event_code"; tc959-check.mjs: same direction) passes with entries that have no emitter: 58/58 with the new test. New test in log-shipper/ledger-start.test.mjs pins the four mappings. #756 should merge after this and rebase on canonical.json; its own hash commit lands last.

CI timeout (Naomi go 03:33Z; head 1e2234e2227e43f5911764662a81542555af541e)

.github/workflows/logship.yml: boundary job timeout-minutes 20 -> 35, nothing else in that commit. The job already took 16-19 min on main; with the added Vector cases it hit 20 min and CI cancelled it (run 45446418043, 17:14:52Z-17:35:07Z; both vector test profiles and cap-check had passed; hosted-compose-proof was skipped as a result).

…che cleanup warning (TC-4177, TC-4190)

- log-shipper: individual event deletion_ledger_start (target tinycloud, info) with ledger_file, bytes, operations, key_entries, committed, aborted, newest_deleted_at; failure variant carries error_kind only. Gate, sanitize.vrl block, own route and sink input, cases.mjs Vector cases.
- log-shipper: diagnostics.json maps 'Database cache cleanup failed' to duckdb_cache_cleanup_failed; the line at duckdb/database.rs is a warn! again (#647 demoted it).
- Schema pinned to tinycloud-dev-sam ab0c591b (fields.json sha256 4143ff50...), regenerated VECTOR_CONFIG_JSON in the compose and the N0 fixture, n0_template_hash and docs/releasing.md for THIS branch on main; the hash is recomputed once on top of the ingress changes before merge.
- New log-shipper/ledger-start.test.mjs (schema carries every shipped field, own route, gate, TC-4190 mapping), registered in logship.yml.

Details: TC-4177, TC-4190
…e (TC-4177)

- Test-ruling TC-4177 (Naomi, 12:55Z): the existing assertion gains the new entry; equality kept, nothing removed.

Details: TC-4177
…mplate hash (TC-4177, TC-4190)

Compose: only the VECTOR_CONFIG_JSON line differs from main (cloudflared and the TC-4249 ingress pin untouched).
n0_template_hash 4520ee72189db061788d2a3f09c742fdae5aa8709717a5d983c6ee77e91ca4d0 (raw fdcf54f255fd529f029fa1e3e66b5c0ecd5f3b4d3e8f0af96582ae213bd9f46b); was a6902dd5 on main.
canonical.json re-pinned to schema merge head a33ebf8d (fields.json sha256 unchanged).

Details: TC-4177, TC-4190
… bundle; recompute N0 template hash

- fields.json: event_code gains store_master_mode_unreadable_refused, store_master_backstop_rotation_failed, shadow_local_working_copy_missing, shadow_local_read_failed (schema dev-sam 764c32a9, fields.json sha256 9abea684...).
- diagnostics.json: four exact message entries for them (messages arrive with node #756; coverage and the ledger test do not require an emitter).
- Compose VECTOR_CONFIG_JSON and the N0 fixture regenerated; n0_template_hash 693f06e86e0ea576a435b891214e9aaf528204c66131d85f53b4a805f8c47a60 (raw ef81b59ff3034ff17c049ac281173c4ac69ee8036f4d6333b19ed260c60e71b9).
- New test in log-shipper/ledger-start.test.mjs for the four mappings.

Details: TC-4177
- The job already ran 16-19 min on main; the added Vector cases for deletion_ledger_start pushed it past 20 and CI cancelled it (run 45446418043, 17:14:52Z-17:35:07Z). CI-only change, nothing else.

Details: TC-4177
…18 (TC-4177)

- revision 764c32a9 (branch head) -> 72947b183d4aa0df5ba6e3ddf42583888b4a3cd9 (squash merge of dev-sam #384). fields.json at that commit hashes to 9abea684d4b9e396f67b7a612733d6f788d35f9b1a5ae806430644b6c3a2ba9b, unchanged; nothing else derives from the revision.

Details: TC-4177
No conflicts. #750's startup line and ledger summary are already on main; the compose inputs of n0_template_hash did not change, so the hash stays 693f06e86e0ea576a435b891214e9aaf528204c66131d85f53b4a805f8c47a60 (recompute-hash.py: already current).

Details: TC-4177
@samgbafa
samgbafa marked this pull request as ready for review November 25, 2026 14:12
@samgbafa
samgbafa merged commit 1c0777b into main Nov 25, 2026
37 checks passed
samgbafa pushed a commit that referenced this pull request Nov 25, 2026
recompute-hash.py after merging main (#751): allowlist status gate < 400 -> < 400 || >= 500,
node_request_5xx cap 10 -> 8; n0_template_hash 693f06e86e0ea576... -> 5323f6267154b950...
(raw ef81b59f... -> 763caa5b...). docker.yml, docs/releasing.md and the CHANGELOG entry carry the new hash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant