|
48 | 48 | EOM
|
49 | 49 | ($summarized_tli, $summarized_lsn) = split(/\|/, $progress);
|
50 | 50 | note("after insert, summarized TLI $summarized_tli through $summarized_lsn");
|
| 51 | +note_wal_summary_dir("after insert", $node1); |
51 | 52 |
|
52 | 53 | # Update a row in the first block of the table and trigger a checkpoint.
|
53 | 54 | $node1->safe_psql('postgres', <<EOM);
|
|
70 | 71 | EOM
|
71 | 72 | my ($tli, $start_lsn, $end_lsn) = split(/\|/, $details);
|
72 | 73 | note("examining summary for TLI $tli from $start_lsn to $end_lsn");
|
| 74 | +note_wal_summary_dir("after new summary", $node1); |
73 | 75 |
|
74 | 76 | # Reconstruct the full pathname for the WAL summary file.
|
75 | 77 | my $filename = sprintf "%s/pg_wal/summaries/%08s%08s%08s%08s%08s.summary",
|
76 | 78 | $node1->data_dir, $tli,
|
77 | 79 | split(m@/@, $start_lsn),
|
78 | 80 | split(m@/@, $end_lsn);
|
79 | 81 | ok(-f $filename, "WAL summary file exists");
|
| 82 | +note_wal_summary_dir("after existence check", $node1); |
80 | 83 |
|
81 | 84 | # Run pg_walsummary on it. We expect block 0 to be modified, but depending
|
82 | 85 | # on where the new tuple ends up, block 1 might also be modified, so we
|
83 | 86 | # pass -i to pg_walsummary to make sure we don't end up with a 0..1 range.
|
84 | 87 | my ($stdout, $stderr) = run_command([ 'pg_walsummary', '-i', $filename ]);
|
85 | 88 | like($stdout, qr/FORK main: block 0$/m, "stdout shows block 0 modified");
|
86 | 89 | is($stderr, '', 'stderr is empty');
|
| 90 | +note_wal_summary_dir("after pg_walsummary run", $node1); |
87 | 91 |
|
88 | 92 | done_testing();
|
| 93 | + |
| 94 | +# XXX. Temporary debugging code. |
| 95 | +sub note_wal_summary_dir |
| 96 | +{ |
| 97 | + my ($flair, $node) = @_; |
| 98 | + |
| 99 | + my $wsdir = sprintf "%s/pg_wal/summaries", $node->data_dir; |
| 100 | + my @wsfiles = grep { $_ ne '.' && $_ ne '..' } slurp_dir($wsdir); |
| 101 | + note("$flair pg_wal/summaries has: @wsfiles"); |
| 102 | +} |
0 commit comments