Skip to content

Commit ef1811a

Browse files
committed
pg_verifybackup: Message style improvements
1 parent c893245 commit ef1811a

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/bin/pg_verifybackup/astreamer_verify.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ astreamer_verify_content(astreamer *streamer, astreamer_member *member,
127127

128128
default:
129129
/* Shouldn't happen. */
130-
pg_fatal("unexpected state while parsing tar file");
130+
pg_fatal("unexpected state while parsing tar archive");
131131
}
132132
}
133133

@@ -195,7 +195,7 @@ member_verify_header(astreamer *streamer, astreamer_member *member)
195195
if (m == NULL)
196196
{
197197
report_backup_error(mystreamer->context,
198-
"\"%s\" is present in \"%s\" but not in the manifest",
198+
"file \"%s\" is present in archive \"%s\" but not in the manifest",
199199
member->pathname, mystreamer->archive_name);
200200
return;
201201
}
@@ -208,7 +208,7 @@ member_verify_header(astreamer *streamer, astreamer_member *member)
208208
if (m->size != member->size)
209209
{
210210
report_backup_error(mystreamer->context,
211-
"\"%s\" has size %llu in \"%s\" but size %" PRIu64 " in the manifest",
211+
"file \"%s\" has size %llu in archive \"%s\" but size %" PRIu64 " in the manifest",
212212
member->pathname,
213213
(unsigned long long) member->size,
214214
mystreamer->archive_name,
@@ -297,7 +297,7 @@ member_verify_checksum(astreamer *streamer)
297297
if (mystreamer->checksum_bytes != m->size)
298298
{
299299
report_backup_error(mystreamer->context,
300-
"file \"%s\" in \"%s\" should contain %" PRIu64 " bytes, but read %" PRIu64 " bytes",
300+
"file \"%s\" in archive \"%s\" should contain %" PRIu64 " bytes, but %" PRIu64 " bytes were read",
301301
m->pathname, mystreamer->archive_name,
302302
m->size,
303303
mystreamer->checksum_bytes);
@@ -317,12 +317,12 @@ member_verify_checksum(astreamer *streamer)
317317
/* And check it against the manifest. */
318318
if (checksumlen != m->checksum_length)
319319
report_backup_error(mystreamer->context,
320-
"file \"%s\" in \"%s\" has checksum of length %d, but expected %d",
320+
"file \"%s\" in archive \"%s\" has checksum of length %d, but expected %d",
321321
m->pathname, mystreamer->archive_name,
322322
m->checksum_length, checksumlen);
323323
else if (memcmp(checksumbuf, m->checksum_payload, checksumlen) != 0)
324324
report_backup_error(mystreamer->context,
325-
"checksum mismatch for file \"%s\" in \"%s\"",
325+
"checksum mismatch for file \"%s\" in archive \"%s\"",
326326
m->pathname, mystreamer->archive_name);
327327
}
328328

src/bin/pg_verifybackup/pg_verifybackup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ main(int argc, char **argv)
338338
if (!no_parse_wal && context.format == 't')
339339
{
340340
pg_log_error("pg_waldump cannot read tar files");
341-
pg_log_error_hint("You must use -n or --no-parse-wal when verifying a tar-format backup.");
341+
pg_log_error_hint("You must use -n/--no-parse-wal when verifying a tar-format backup.");
342342
exit(1);
343343
}
344344

@@ -694,11 +694,11 @@ verify_plain_backup_file(verifier_context *context, char *relpath,
694694
return;
695695
}
696696

697-
/* If it's not a directory, it should be a plain file. */
697+
/* If it's not a directory, it should be a regular file. */
698698
if (!S_ISREG(sb.st_mode))
699699
{
700700
report_backup_error(context,
701-
"\"%s\" is not a file or directory",
701+
"\"%s\" is not a regular file or directory",
702702
relpath);
703703
return;
704704
}
@@ -899,11 +899,11 @@ precheck_tar_backup_file(verifier_context *context, char *relpath,
899899
return;
900900
}
901901

902-
/* In a tar format backup, we expect only plain files. */
902+
/* In a tar format backup, we expect only regular files. */
903903
if (!S_ISREG(sb.st_mode))
904904
{
905905
report_backup_error(context,
906-
"\"%s\" is not a plain file",
906+
"file \"%s\" is not a regular file",
907907
relpath);
908908
return;
909909
}

src/bin/pg_verifybackup/t/003_corruption.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,37 @@
3737
'name' => 'extra_file',
3838
'mutilate' => \&mutilate_extra_file,
3939
'fails_like' =>
40-
qr/extra_file.*present (on disk|in "[^"]+") but not in the manifest/
40+
qr/extra_file.*present (on disk|in archive "[^"]+") but not in the manifest/
4141
},
4242
{
4343
'name' => 'extra_tablespace_file',
4444
'mutilate' => \&mutilate_extra_tablespace_file,
4545
'fails_like' =>
46-
qr/extra_ts_file.*present (on disk|in "[^"]+") but not in the manifest/
46+
qr/extra_ts_file.*present (on disk|in archive "[^"]+") but not in the manifest/
4747
},
4848
{
4949
'name' => 'missing_file',
5050
'mutilate' => \&mutilate_missing_file,
5151
'fails_like' =>
52-
qr/pg_xact\/0000.*present in the manifest but not (on disk|in "[^"]+")/
52+
qr/pg_xact\/0000.*present in the manifest but not (on disk|in archive "[^"]+")/
5353
},
5454
{
5555
'name' => 'missing_tablespace',
5656
'mutilate' => \&mutilate_missing_tablespace,
5757
'fails_like' =>
58-
qr/pg_tblspc.*present in the manifest but not (on disk|in "[^"]+")/
58+
qr/pg_tblspc.*present in the manifest but not (on disk|in archive "[^"]+")/
5959
},
6060
{
6161
'name' => 'append_to_file',
6262
'mutilate' => \&mutilate_append_to_file,
6363
'fails_like' =>
64-
qr/has size \d+ (on disk|in "[^"]+") but size \d+ in the manifest/
64+
qr/has size \d+ (on disk|in archive "[^"]+") but size \d+ in the manifest/
6565
},
6666
{
6767
'name' => 'truncate_file',
6868
'mutilate' => \&mutilate_truncate_file,
6969
'fails_like' =>
70-
qr/has size 0 (on disk|in "[^"]+") but size \d+ in the manifest/
70+
qr/has size 0 (on disk|in archive "[^"]+") but size \d+ in the manifest/
7171
},
7272
{
7373
'name' => 'replace_file',

src/bin/pg_verifybackup/t/004_options.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'--no-parse-wal',
5454
$backup_path
5555
],
56-
qr("pg_multixact" is not a plain file),
56+
qr("pg_multixact" is not a regular file),
5757
"does not verify with --format=tar --no-parse-wal");
5858

5959
# Test invalid options

0 commit comments

Comments
 (0)