Skip to content

Commit c0b8eb7

Browse files
author
s.fukanchik
committed
PBCKP-91 fix grammar in probackup's log messages
1 parent 91ebe71 commit c0b8eb7

23 files changed

+117
-104
lines changed

Diff for: src/archive.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ push_file_internal_uncompressed(WALSegno *wal_file, const char *pg_xlog_dir,
614614
if (thread_interrupted || interrupted)
615615
{
616616
pg_atomic_write_u32(&wal_file->done, 1);
617-
elog(ERROR, "terminated while waiting for prev file");
617+
elog(ERROR, "Terminated while waiting for prev file");
618618
}
619619
usleep(250);
620620
}
@@ -903,7 +903,7 @@ push_file_internal_gz(WALSegno *wal_file, const char *pg_xlog_dir,
903903
if (thread_interrupted || interrupted)
904904
{
905905
pg_atomic_write_u32(&wal_file->done, 1);
906-
elog(ERROR, "terminated while waiting for prev file");
906+
elog(ERROR, "Terminated while waiting for prev file");
907907
}
908908
usleep(250);
909909
}

Diff for: src/backup.c

+17-16
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ backup_stopbackup_callback(bool fatal, void *userdata)
8484
*/
8585
if (backup_in_progress)
8686
{
87-
elog(WARNING, "backup in progress, stop backup");
87+
elog(WARNING, "A backup is in progress, stopping it.");
8888
/* don't care about stop_lsn in case of error */
8989
pg_stop_backup_send(st->conn, st->server_version, current.from_replica, exclusive_backup, NULL);
9090
}
@@ -711,8 +711,9 @@ do_backup(InstanceState *instanceState, pgSetBackupParams *set_backup_params,
711711
char pretty_bytes[20];
712712

713713
if (!instance_config.pgdata)
714-
elog(ERROR, "required parameter not specified: PGDATA "
715-
"(-D, --pgdata)");
714+
elog(ERROR, "No postgres data directory specified.\n"
715+
"Please specify it either using environment variable PGDATA or\n"
716+
"command line option --pgdata (-D)");
716717

717718
/* Initialize PGInfonode */
718719
pgNodeInit(&nodeInfo);
@@ -936,12 +937,12 @@ check_server_version(PGconn *conn, PGNodeInfo *nodeInfo)
936937

937938
if (nodeInfo->server_version < 90500)
938939
elog(ERROR,
939-
"server version is %s, must be %s or higher",
940+
"Server version is %s, must be %s or higher",
940941
nodeInfo->server_version_str, "9.5");
941942

942943
if (current.from_replica && nodeInfo->server_version < 90600)
943944
elog(ERROR,
944-
"server version is %s, must be %s or higher for backup from replica",
945+
"Server version is %s, must be %s or higher for backup from replica",
945946
nodeInfo->server_version_str, "9.6");
946947

947948
if (nodeInfo->pgpro_support)
@@ -1050,7 +1051,7 @@ confirm_block_size(PGconn *conn, const char *name, int blcksz)
10501051

10511052
res = pgut_execute(conn, "SELECT pg_catalog.current_setting($1)", 1, &name);
10521053
if (PQntuples(res) != 1 || PQnfields(res) != 1)
1053-
elog(ERROR, "cannot get %s: %s", name, PQerrorMessage(conn));
1054+
elog(ERROR, "Cannot get %s: %s", name, PQerrorMessage(conn));
10541055

10551056
block_size = strtol(PQgetvalue(res, 0, 0), &endp, 10);
10561057
if ((endp && *endp) || block_size != blcksz)
@@ -1439,7 +1440,7 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
14391440
}
14401441

14411442
if (!current.stream && is_start_lsn && try_count == 30)
1442-
elog(WARNING, "By default pg_probackup assume WAL delivery method to be ARCHIVE. "
1443+
elog(WARNING, "By default pg_probackup assumes that WAL delivery method to be ARCHIVE. "
14431444
"If continuous archiving is not set up, use '--stream' option to make autonomous backup. "
14441445
"Otherwise check that continuous archiving works correctly.");
14451446

@@ -1775,9 +1776,9 @@ pg_stop_backup_consume(PGconn *conn, int server_version,
17751776
{
17761777
pgut_cancel(conn);
17771778
#if PG_VERSION_NUM >= 150000
1778-
elog(ERROR, "interrupted during waiting for pg_backup_stop");
1779+
elog(ERROR, "Interrupted during waiting for pg_backup_stop");
17791780
#else
1780-
elog(ERROR, "interrupted during waiting for pg_stop_backup");
1781+
elog(ERROR, "Interrupted during waiting for pg_stop_backup");
17811782
#endif
17821783
}
17831784

@@ -1823,7 +1824,7 @@ pg_stop_backup_consume(PGconn *conn, int server_version,
18231824
case PGRES_TUPLES_OK:
18241825
break;
18251826
default:
1826-
elog(ERROR, "query failed: %s query was: %s",
1827+
elog(ERROR, "Query failed: %s query was: %s",
18271828
PQerrorMessage(conn), query_text);
18281829
}
18291830
backup_in_progress = false;
@@ -1834,13 +1835,13 @@ pg_stop_backup_consume(PGconn *conn, int server_version,
18341835
/* get&check recovery_xid */
18351836
if (sscanf(PQgetvalue(query_result, 0, recovery_xid_colno), XID_FMT, &result->snapshot_xid) != 1)
18361837
elog(ERROR,
1837-
"result of txid_snapshot_xmax() is invalid: %s",
1838+
"Result of txid_snapshot_xmax() is invalid: %s",
18381839
PQgetvalue(query_result, 0, recovery_xid_colno));
18391840

18401841
/* get&check recovery_time */
18411842
if (!parse_time(PQgetvalue(query_result, 0, recovery_time_colno), &result->invocation_time, true))
18421843
elog(ERROR,
1843-
"result of current_timestamp is invalid: %s",
1844+
"Result of current_timestamp is invalid: %s",
18441845
PQgetvalue(query_result, 0, recovery_time_colno));
18451846

18461847
/* get stop_backup_lsn */
@@ -1898,13 +1899,13 @@ pg_stop_backup_write_file_helper(const char *path, const char *filename, const c
18981899
join_path_components(full_filename, path, filename);
18991900
fp = fio_fopen(full_filename, PG_BINARY_W, FIO_BACKUP_HOST);
19001901
if (fp == NULL)
1901-
elog(ERROR, "can't open %s file \"%s\": %s",
1902+
elog(ERROR, "Can't open %s file \"%s\": %s",
19021903
error_msg_filename, full_filename, strerror(errno));
19031904

19041905
if (fio_fwrite(fp, data, len) != len ||
19051906
fio_fflush(fp) != 0 ||
19061907
fio_fclose(fp))
1907-
elog(ERROR, "can't write %s file \"%s\": %s",
1908+
elog(ERROR, "Can't write %s file \"%s\": %s",
19081909
error_msg_filename, full_filename, strerror(errno));
19091910

19101911
/*
@@ -1943,7 +1944,7 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
19431944

19441945
/* Remove it ? */
19451946
if (!backup_in_progress)
1946-
elog(ERROR, "backup is not in progress");
1947+
elog(ERROR, "Backup is not in progress");
19471948

19481949
pg_silent_client_messages(pg_startbackup_conn);
19491950

@@ -2098,7 +2099,7 @@ backup_files(void *arg)
20982099

20992100
/* check for interrupt */
21002101
if (interrupted || thread_interrupted)
2101-
elog(ERROR, "interrupted during backup");
2102+
elog(ERROR, "Interrupted during backup");
21022103

21032104
elog(progress ? INFO : LOG, "Progress: (%d/%d). Process file \"%s\"",
21042105
i + 1, n_backup_files_list, file->rel_path);

Diff for: src/catalog.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ get_backup_filelist(pgBackup *backup, bool strict)
10551055

10561056
fp = fio_open_stream(backup_filelist_path, FIO_BACKUP_HOST);
10571057
if (fp == NULL)
1058-
elog(ERROR, "cannot open \"%s\": %s", backup_filelist_path, strerror(errno));
1058+
elog(ERROR, "Cannot open \"%s\": %s", backup_filelist_path, strerror(errno));
10591059

10601060
/* enable stdio buffering for local file */
10611061
if (!fio_is_remote(FIO_BACKUP_HOST))
@@ -2841,7 +2841,7 @@ parse_backup_mode(const char *value)
28412841
return BACKUP_MODE_DIFF_DELTA;
28422842

28432843
/* Backup mode is invalid, so leave with an error */
2844-
elog(ERROR, "invalid backup-mode \"%s\"", value);
2844+
elog(ERROR, "Invalid backup-mode \"%s\"", value);
28452845
return BACKUP_MODE_INVALID;
28462846
}
28472847

@@ -2876,7 +2876,7 @@ parse_compress_alg(const char *arg)
28762876
len = strlen(arg);
28772877

28782878
if (len == 0)
2879-
elog(ERROR, "compress algorithm is empty");
2879+
elog(ERROR, "Compress algorithm is empty");
28802880

28812881
if (pg_strncasecmp("zlib", arg, len) == 0)
28822882
return ZLIB_COMPRESS;
@@ -2885,7 +2885,7 @@ parse_compress_alg(const char *arg)
28852885
else if (pg_strncasecmp("none", arg, len) == 0)
28862886
return NONE_COMPRESS;
28872887
else
2888-
elog(ERROR, "invalid compress algorithm value \"%s\"", arg);
2888+
elog(ERROR, "Invalid compress algorithm value \"%s\"", arg);
28892889

28902890
return NOT_DEFINED_COMPRESS;
28912891
}

Diff for: src/catchup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ catchup_preflight_checks(PGNodeInfo *source_node_info, PGconn *source_conn,
184184
if (source_node_info->ptrack_version_num == 0)
185185
elog(ERROR, "This PostgreSQL instance does not support ptrack");
186186
else if (source_node_info->ptrack_version_num < 200)
187-
elog(ERROR, "ptrack extension is too old.\n"
187+
elog(ERROR, "Ptrack extension is too old.\n"
188188
"Upgrade ptrack to version >= 2");
189189
else if (!source_node_info->is_ptrack_enabled)
190190
elog(ERROR, "Ptrack is disabled");

Diff for: src/checkdb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ check_files(void *arg)
145145

146146
/* check for interrupt */
147147
if (interrupted || thread_interrupted)
148-
elog(ERROR, "interrupted during checkdb");
148+
elog(ERROR, "Interrupted during checkdb");
149149

150150
/* No need to check directories */
151151
if (S_ISDIR(file->mode))
@@ -750,7 +750,7 @@ do_checkdb(bool need_amcheck,
750750
if (!skip_block_validation)
751751
{
752752
if (!pgdata)
753-
elog(ERROR, "required parameter not specified: PGDATA "
753+
elog(ERROR, "Required parameter not specified: PGDATA "
754754
"(-D, --pgdata)");
755755

756756
/* get node info */

Diff for: src/dir.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pgFileNew(const char *path, const char *rel_path, bool follow_symlink,
182182
/* file not found is not an error case */
183183
if (errno == ENOENT)
184184
return NULL;
185-
elog(ERROR, "cannot stat file \"%s\": %s", path,
185+
elog(ERROR, "Cannot stat file \"%s\": %s", path,
186186
strerror(errno));
187187
}
188188

@@ -787,14 +787,14 @@ opt_path_map(ConfigOption *opt, const char *arg, TablespaceList *list,
787787
for (arg_ptr = arg; *arg_ptr; arg_ptr++)
788788
{
789789
if (dst_ptr - dst >= MAXPGPATH)
790-
elog(ERROR, "directory name too long");
790+
elog(ERROR, "Directory name too long");
791791

792792
if (*arg_ptr == '\\' && *(arg_ptr + 1) == '=')
793793
; /* skip backslash escaping = */
794794
else if (*arg_ptr == '=' && (arg_ptr == arg || *(arg_ptr - 1) != '\\'))
795795
{
796796
if (*cell->new_dir)
797-
elog(ERROR, "multiple \"=\" signs in %s mapping\n", type);
797+
elog(ERROR, "Multiple \"=\" signs in %s mapping\n", type);
798798
else
799799
dst = dst_ptr = cell->new_dir;
800800
}
@@ -803,7 +803,7 @@ opt_path_map(ConfigOption *opt, const char *arg, TablespaceList *list,
803803
}
804804

805805
if (!*cell->old_dir || !*cell->new_dir)
806-
elog(ERROR, "invalid %s mapping format \"%s\", "
806+
elog(ERROR, "Invalid %s mapping format \"%s\", "
807807
"must be \"OLDDIR=NEWDIR\"", type, arg);
808808
canonicalize_path(cell->old_dir);
809809
canonicalize_path(cell->new_dir);
@@ -815,11 +815,11 @@ opt_path_map(ConfigOption *opt, const char *arg, TablespaceList *list,
815815
* consistent with the new_dir check.
816816
*/
817817
if (!is_absolute_path(cell->old_dir))
818-
elog(ERROR, "old directory is not an absolute path in %s mapping: %s\n",
818+
elog(ERROR, "Old directory is not an absolute path in %s mapping: %s\n",
819819
type, cell->old_dir);
820820

821821
if (!is_absolute_path(cell->new_dir))
822-
elog(ERROR, "new directory is not an absolute path in %s mapping: %s\n",
822+
elog(ERROR, "New directory is not an absolute path in %s mapping: %s\n",
823823
type, cell->new_dir);
824824

825825
if (list->tail)
@@ -1046,7 +1046,7 @@ read_tablespace_map(parray *links, const char *backup_dir)
10461046
int i = 0;
10471047

10481048
if (sscanf(buf, "%s %n", link_name, &n) != 1)
1049-
elog(ERROR, "invalid format found in \"%s\"", map_path);
1049+
elog(ERROR, "Invalid format found in \"%s\"", map_path);
10501050

10511051
path = buf + n;
10521052

@@ -1438,7 +1438,7 @@ get_control_value_str(const char *str, const char *name,
14381438
{
14391439
/* verify if value_str not exceeds value_str_size limits */
14401440
if (value_str - value_str_start >= value_str_size - 1) {
1441-
elog(ERROR, "field \"%s\" is out of range in the line %s of the file %s",
1441+
elog(ERROR, "Field \"%s\" is out of range in the line %s of the file %s",
14421442
name, str, DATABASE_FILE_LIST);
14431443
}
14441444
*value_str = *buf;
@@ -1463,7 +1463,7 @@ get_control_value_str(const char *str, const char *name,
14631463

14641464
/* Did not find target field */
14651465
if (is_mandatory)
1466-
elog(ERROR, "field \"%s\" is not found in the line %s of the file %s",
1466+
elog(ERROR, "Field \"%s\" is not found in the line %s of the file %s",
14671467
name, str, DATABASE_FILE_LIST);
14681468
return false;
14691469
}
@@ -1490,7 +1490,7 @@ dir_is_empty(const char *path, fio_location location)
14901490
/* Directory in path doesn't exist */
14911491
if (errno == ENOENT)
14921492
return true;
1493-
elog(ERROR, "cannot open directory \"%s\": %s", path, strerror(errno));
1493+
elog(ERROR, "Cannot open directory \"%s\": %s", path, strerror(errno));
14941494
}
14951495

14961496
errno = 0;
@@ -1506,7 +1506,7 @@ dir_is_empty(const char *path, fio_location location)
15061506
return false;
15071507
}
15081508
if (errno)
1509-
elog(ERROR, "cannot read directory \"%s\": %s", path, strerror(errno));
1509+
elog(ERROR, "Cannot read directory \"%s\": %s", path, strerror(errno));
15101510

15111511
fio_closedir(dir);
15121512

Diff for: src/fetch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fetchFile(PGconn *conn, const char *filename, size_t *filesize)
9292

9393
/* sanity check the result set */
9494
if (PQntuples(res) != 1 || PQgetisnull(res, 0, 0))
95-
elog(ERROR, "unexpected result set while fetching remote file \"%s\"",
95+
elog(ERROR, "Unexpected result set while fetching remote file \"%s\"",
9696
filename);
9797

9898
/* Read result to local variables */

Diff for: src/init.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ do_init(CatalogState *catalogState)
2424
results = pg_check_dir(catalogState->catalog_path);
2525

2626
if (results == 4) /* exists and not empty*/
27-
elog(ERROR, "backup catalog already exist and it's not empty");
27+
elog(ERROR, "The backup catalog already exists and is not empty");
2828
else if (results == -1) /*trouble accessing directory*/
2929
{
3030
int errno_tmp = errno;
31-
elog(ERROR, "cannot open backup catalog directory \"%s\": %s",
31+
elog(ERROR, "Cannot open backup catalog directory \"%s\": %s",
3232
catalogState->catalog_path, strerror(errno_tmp));
3333
}
3434

@@ -41,7 +41,7 @@ do_init(CatalogState *catalogState)
4141
/* create backup catalog wal directory */
4242
dir_create_dir(catalogState->wal_subdir_path, DIR_PERMISSION, false);
4343

44-
elog(INFO, "Backup catalog '%s' successfully inited", catalogState->catalog_path);
44+
elog(INFO, "Backup catalog '%s' successfully initialized", catalogState->catalog_path);
4545
return 0;
4646
}
4747

@@ -53,8 +53,9 @@ do_add_instance(InstanceState *instanceState, InstanceConfig *instance)
5353

5454
/* PGDATA is always required */
5555
if (instance->pgdata == NULL)
56-
elog(ERROR, "Required parameter not specified: PGDATA "
57-
"(-D, --pgdata)");
56+
elog(ERROR, "No postgres data directory specified.\n"
57+
"Please specify it either using environment variable PGDATA or\n"
58+
"command line option --pgdata (-D)");
5859

5960
/* Read system_identifier from PGDATA */
6061
instance->system_identifier = get_system_identifier(instance->pgdata, FIO_DB_HOST, false);
@@ -121,6 +122,6 @@ do_add_instance(InstanceState *instanceState, InstanceConfig *instance)
121122
/* pgdata was set through command line */
122123
do_set_config(instanceState, true);
123124

124-
elog(INFO, "Instance '%s' successfully inited", instanceState->instance_name);
125+
elog(INFO, "Instance '%s' successfully initialized", instanceState->instance_name);
125126
return 0;
126127
}

Diff for: src/merge.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ do_merge(InstanceState *instanceState, time_t backup_id, bool no_validate, bool
7979
int i;
8080

8181
if (backup_id == INVALID_BACKUP_ID)
82-
elog(ERROR, "required parameter is not specified: --backup-id");
82+
elog(ERROR, "Required parameter is not specified: --backup-id");
8383

8484
if (instanceState == NULL)
85-
elog(ERROR, "required parameter is not specified: --instance");
85+
elog(ERROR, "Required parameter is not specified: --instance");
8686

8787
elog(INFO, "Merge started");
8888

0 commit comments

Comments
 (0)