Repository navigation
Fail the process when imported data verification fails - #771
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. The fix is small and well-scoped, and the tests are what I'd want to see: they check the parsed JSON counters as well as the exit status, and the description says 5 of the 7 new cases fail on baseline. Mostly questions:
The core fix looks solid. I'd mainly like the (Would file this as a comment, not a formal block.) |
|
Thanks. The partial-pass concern was real: a peer returning one matching GET and dropping the next left The README now calls out imported expiry and Validation is complete and the PR body is updated: 10/10 standalone, 9/9 TLS (scripted Unix peer skips), 12/12 unit tests, eight existing Prometheus teardown iterations. Actual scripted-peer baseline/fix runs retain exit 2 for a benchmark stage abort followed by failed verification, and exit 1 for a worker drop followed by failed verification. Successful verification with an output write failure also remains exit 1. Independent review and CI are still running. |
|
Addressed the current review on final head 762c20d, after a normal merge of master bc8e316:
The owner pass also aligns help/man wording with incomplete verification and checks that successful verification emits no incomplete-pass diagnostic. Final merged-tree build and unit tests pass 13/13; focused verification passes 10/10. The independent seven-lens reviews have converged, with a focused final-merge recheck in progress. CI still gates merging. |
Problem
--data-verifyand--verify-onlyreport missing keys, mismatched values, and error replies but exit 0. A pass receiving no verification replies also appears successful to shell callers.Root cause
main()prints the verification counters and destroys the verifier without using those counters in the final exit status.Fix
Preserve a verification-failure flag until normal teardown completes. Any failed key, a pass with zero verified keys, or a partial pass interrupted by connection loss exits 1, with a concise stderr summary. Completion uses the configured generated-request budget and the actual verification GET count, preserving default-ratio skips and repeated passes over the import file. Successful verification stays at 0; benchmark connection-stage aborts retain exit 2 precedence, and existing worker/output failures still fail the process. Existing text and JSON counters remain unchanged. Help, man page, and README document the status contract.
The Prometheus teardown tests now preload matching fixture data so their expected successful verification remains meaningful. Import/verification remain unsupported in cluster mode.
Tests
On baseline
dc79a95, the seven new RLTest cases give 5 failures / 2 passes: missing keys, wrong values, WRONGTYPE replies, post-benchmark verification errors, and zero replies all incorrectly return 0. On this change they give 7 passes / 0 failures (4 seconds), checking parsed JSON counters as well as status and diagnostics. Successful standalone verification and successful post-benchmark verification are controls. The follow-up partial-disconnect regression also fails on baseline (one match, zero failures, incorrect exit 0). The final suite passes 10/10 standalone and 9/9 TLS (the plaintext Unix peer case skips TLS), including default-ratio and import-wrap controls. After a normal merge of current masterbc8e316, the final head762c20dpasses 13/13 unit tests and 10/10 focused verification tests. The earlier TLS result remains 9/9 with one plaintext-peer skip. Format check passes. Scripted-peer comparisons on baseline and fix preserve abort exit 2 and worker-failure exit 1, even when verification subsequently fails. A successful verification with/dev/fulloutput still exits 1. The existing Prometheus teardown case passes its eight iterations with matching data (local auth adapter only). Cluster/import rejection remains unchanged on baseline and fix.Compatibility / release note
Verification now exits 1 for failed, empty, or incomplete verification. This is intentional for existing callers too: an opt-in or warn-only default would preserve the false-success bug for scripts that depend on process status. Callers deliberately accepting stale data can handle status 1 explicitly and inspect the existing verification counters; no new tolerance flag is added. A zero-SET-position ratio intentionally fails because it checks no keys.
Timed verification with
--test-timeand no request limit already fails to terminate on both baseline and this change: its verifier does not use the benchmark deadline and the import reader wraps. This existing limitation is tracked separately; this PR does not promise timed verification support or weaken incomplete-pass detection.Affected versions
Introduced by
af97483("Add data verification options.", 2013-08-14).git tag --contains af97483includes every release from 1.1.0 through 2.5.2; current masterdc79a95is affected too.Fixes #768
🤖 Generated with Claude Code