Skip to main content

Module doctor

Module doctor 

Source
Expand description

doctor — run every table’s VERIFY and turn the counters into an exit code.

Lesson 8 of the migration playbook: make VERIFY part of operations, not part of the migration. The counters are fresh on every call and cheap enough for a cron; what was missing is the shell that turns them into something a cron can act on.

The mapping is the lesson’s own words, not a new opinion:

  • drift and missing should be zero forever — non-zero is a failure;
  • non-zero duplicates on an ORDERPATH means pagination needs a bounded tie-break — a warning about a design choice, not a corruption;
  • absent / excluded / coerce_failures name the rows each exclusion cause claimed — reported, never failed on, because every one of them is a legitimate state.

And one thing the lesson could not have known: TABLE.VERIFY answers -INDEXBUILDING while a backfill is still running. A cron that read that as a failure would page someone every time an index was declared, so it is its own outcome.

Structs§

TableHealth
One table’s name and what was concluded about it.

Enums§

Health
What doctor concluded about one table.

Functions§

check_table
Verify one table and read its counters against lesson 8’s mapping.
run
Check every table and print one line each. Exit non-zero only on drift — a warning is information, and a cron that fails on information stops being read.
run_doctor_cli
doctor [-h host] [-p port] [--warn-is-failure]
table_names
Every declared table’s name, in declaration order.