|
51 | 51 | SELECT MAX(end_lsn) AS summarized_lsn FROM pg_available_wal_summaries()
|
52 | 52 | EOM
|
53 | 53 | note("after insert, summarized through $summarized_lsn");
|
54 |
| -note_wal_summary_dir("after insert", $node1); |
55 | 54 |
|
56 | 55 | # Update a row in the first block of the table and trigger a checkpoint.
|
57 | 56 | $node1->safe_psql('postgres', <<EOM);
|
|
78 | 77 | is(0+@lines, 1, "got exactly one new WAL summary");
|
79 | 78 | my ($tli, $start_lsn, $end_lsn) = split(/\|/, $lines[0]);
|
80 | 79 | note("examining summary for TLI $tli from $start_lsn to $end_lsn");
|
81 |
| -note_wal_summary_dir("after new summary", $node1); |
82 | 80 |
|
83 | 81 | # Reconstruct the full pathname for the WAL summary file.
|
84 | 82 | my $filename = sprintf "%s/pg_wal/summaries/%08s%08s%08s%08s%08s.summary",
|
85 | 83 | $node1->data_dir, $tli,
|
86 | 84 | split(m@/@, $start_lsn),
|
87 | 85 | split(m@/@, $end_lsn);
|
88 | 86 | ok(-f $filename, "WAL summary file exists");
|
89 |
| -note_wal_summary_dir("after existence check", $node1); |
90 | 87 |
|
91 | 88 | # Run pg_walsummary on it. We expect exactly two blocks to be modified,
|
92 | 89 | # block 0 and one other.
|
|
96 | 93 | like($stdout, qr/FORK main: block 0$/m, "stdout shows block 0 modified");
|
97 | 94 | is($stderr, '', 'stderr is empty');
|
98 | 95 | is(0+@lines, 2, "UPDATE modified 2 blocks");
|
99 |
| -note_wal_summary_dir("after pg_walsummary run", $node1); |
100 | 96 |
|
101 | 97 | done_testing();
|
102 |
| - |
103 |
| -# XXX. Temporary debugging code. |
104 |
| -sub note_wal_summary_dir |
105 |
| -{ |
106 |
| - my ($flair, $node) = @_; |
107 |
| - |
108 |
| - my $wsdir = sprintf "%s/pg_wal/summaries", $node->data_dir; |
109 |
| - my @wsfiles = grep { $_ ne '.' && $_ ne '..' } slurp_dir($wsdir); |
110 |
| - note("$flair pg_wal/summaries has: @wsfiles"); |
111 |
| -} |
0 commit comments