-- ----------------------------------------------------------------------
|
-- On-disk formats: serialisation, validation
|
-- ----------------------------------------------------------------------
|
-- No format test case may report anything other than "ok".
|
SELECT count(*) AS format_failures
|
FROM cfs_run_format_tests()
|
WHERE result <> 'ok';
|
format_failures
|
-----------------
|
0
|
(1 row)
|
|
SELECT test_name, result
|
FROM cfs_run_format_tests()
|
ORDER BY test_name;
|
test_name | result
|
-----------------------+--------
|
format_block_header | ok
|
format_journal_entry | ok
|
format_journal_header | ok
|
format_map_entry | ok
|
format_map_header | ok
|
(5 rows)
|
|
-- ----------------------------------------------------------------------
|
-- Sidecar path helpers
|
-- ----------------------------------------------------------------------
|
SELECT count(*) AS path_failures
|
FROM cfs_run_path_tests()
|
WHERE result <> 'ok';
|
path_failures
|
---------------
|
0
|
(1 row)
|
|
-- ----------------------------------------------------------------------
|
-- Structural integrity checker
|
-- ----------------------------------------------------------------------
|
SELECT count(*) AS fsck_failures
|
FROM cfs_run_fsck_tests()
|
WHERE result <> 'ok';
|
fsck_failures
|
---------------
|
0
|
(1 row)
|
|
SELECT test_name, result, detail
|
FROM cfs_run_fsck_tests()
|
ORDER BY test_name;
|
test_name | result | detail
|
-------------------------------+--------+---------------------------------------------------
|
fsck_clean_relation | ok | live=1 jrn=1 cfp=1
|
fsck_corrupt_cfp_record | ok | field_failures=1 errors=1
|
fsck_corrupt_map | ok | crc_failures=1
|
fsck_cross_check | ok | cross-check flags bogus offsets, deep mode only
|
fsck_empty_map_no_cfp | ok | empty map without .cfp is clean
|
fsck_journal_bad_new_entry | ok | bad new_entry offset/field flagged
|
fsck_live_entries_missing_cfp | ok | live map + missing .cfp is an error in both modes
|
fsck_offset_out_of_range | ok | offset_oob=1
|
fsck_resize_shrink_grow | ok | shrink then grow keeps the dropped slot healable
|
fsck_torn_cfp_header | ok | torn_tails=1 errors=0
|
fsck_torn_cfp_record | ok | torn_tails=1 errors=0 truncated=0
|
fsck_torn_journal | ok | torn_tails=1 errors=0
|
recovery_scan_strict_names | ok | leading-zero journal ignored, valid name replayed
|
(13 rows)
|