Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
-- ----------------------------------------------------------------------
-- 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)