Skip to content

Commit 2fa3c14

Browse files
committed
Merge branch 'master' into stable
2 parents a00d4d1 + ee7812c commit 2fa3c14

File tree

4 files changed

+57
-67
lines changed

4 files changed

+57
-67
lines changed

src/backup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ pg_stop_backup(pgBackup *backup)
16631663
TransactionId recovery_xid;
16641664

16651665
if (!backup_in_progress)
1666-
elog(FATAL, "backup is not in progress");
1666+
elog(ERROR, "backup is not in progress");
16671667

16681668
/* For replica we call pg_stop_backup() on master */
16691669
conn = (current.from_replica) ? master_conn : backup_conn;

src/help.c

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ help_pg_probackup(void)
7474

7575
printf(_("\n %s init -B backup-path\n"), PROGRAM_NAME);
7676

77-
printf(_("\n %s set-config -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
77+
printf(_("\n %s set-config -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
7878
printf(_(" [--log-level-console=log-level-console]\n"));
7979
printf(_(" [--log-level-file=log-level-file]\n"));
8080
printf(_(" [--log-filename=log-filename]\n"));
@@ -92,7 +92,7 @@ help_pg_probackup(void)
9292
printf(_(" [--replica-timeout=timeout]\n"));
9393
printf(_(" [--archive-timeout=timeout]\n"));
9494

95-
printf(_("\n %s show-config -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
95+
printf(_("\n %s show-config -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
9696
printf(_(" [--format=format]\n"));
9797

9898
printf(_("\n %s backup -B backup-path -b backup-mode --instance=instance_name\n"), PROGRAM_NAME);
@@ -118,43 +118,45 @@ help_pg_probackup(void)
118118
printf(_(" [--master-port=port] [--master-user=user_name]\n"));
119119
printf(_(" [--replica-timeout=timeout]\n"));
120120

121-
printf(_("\n %s restore -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
122-
printf(_(" [-D pgdata-dir] [-i backup-id] [--progress]\n"));
121+
printf(_("\n %s restore -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
122+
printf(_(" [-D pgdata-path] [-i backup-id] [--progress]\n"));
123123
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
124124
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
125125
printf(_(" [--immediate] [--recovery-target-name=target-name]\n"));
126126
printf(_(" [--recovery-target-action=pause|promote|shutdown]\n"));
127127
printf(_(" [--restore-as-replica]\n"));
128128
printf(_(" [--no-validate]\n"));
129129

130-
printf(_("\n %s validate -B backup-dir [--instance=instance_name]\n"), PROGRAM_NAME);
130+
printf(_("\n %s validate -B backup-path [--instance=instance_name]\n"), PROGRAM_NAME);
131131
printf(_(" [-i backup-id] [--progress]\n"));
132132
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
133133
printf(_(" [--recovery-target-name=target-name]\n"));
134134
printf(_(" [--timeline=timeline]\n"));
135135

136-
printf(_("\n %s show -B backup-dir\n"), PROGRAM_NAME);
136+
printf(_("\n %s show -B backup-path\n"), PROGRAM_NAME);
137137
printf(_(" [--instance=instance_name [-i backup-id]]\n"));
138138
printf(_(" [--format=format]\n"));
139139

140-
printf(_("\n %s delete -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
140+
printf(_("\n %s delete -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
141141
printf(_(" [--wal] [-i backup-id | --expired]\n"));
142-
printf(_("\n %s merge -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
142+
printf(_("\n %s merge -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
143143
printf(_(" -i backup-id\n"));
144144

145-
printf(_("\n %s add-instance -B backup-dir -D pgdata-dir\n"), PROGRAM_NAME);
145+
printf(_("\n %s add-instance -B backup-path -D pgdata-path\n"), PROGRAM_NAME);
146146
printf(_(" --instance=instance_name\n"));
147147

148-
printf(_("\n %s del-instance -B backup-dir\n"), PROGRAM_NAME);
148+
printf(_("\n %s del-instance -B backup-path\n"), PROGRAM_NAME);
149149
printf(_(" --instance=instance_name\n"));
150150

151-
printf(_("\n %s archive-push -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
151+
printf(_("\n %s archive-push -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
152152
printf(_(" --wal-file-path=wal-file-path\n"));
153153
printf(_(" --wal-file-name=wal-file-name\n"));
154-
printf(_(" [--compress [--compress-level=compress-level]]\n"));
154+
printf(_(" [--compress]\n"));
155+
printf(_(" [--compress-algorithm=compress-algorithm]\n"));
156+
printf(_(" [--compress-level=compress-level]\n"));
155157
printf(_(" [--overwrite]\n"));
156158

157-
printf(_("\n %s archive-get -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
159+
printf(_("\n %s archive-get -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
158160
printf(_(" --wal-file-path=wal-file-path\n"));
159161
printf(_(" --wal-file-name=wal-file-name\n"));
160162

@@ -228,10 +230,10 @@ help_backup(void)
228230
printf(_(" --log-directory=log-directory\n"));
229231
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
230232
printf(_(" --log-rotation-size=log-rotation-size\n"));
231-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
232-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
233+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
234+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
233235
printf(_(" --log-rotation-age=log-rotation-age\n"));
234-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
236+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
235237
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
236238

237239
printf(_("\n Retention options:\n"));
@@ -269,8 +271,8 @@ help_backup(void)
269271
static void
270272
help_restore(void)
271273
{
272-
printf(_("%s restore -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
273-
printf(_(" [-D pgdata-dir] [-i backup-id] [--progress]\n"));
274+
printf(_("%s restore -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
275+
printf(_(" [-D pgdata-path] [-i backup-id] [--progress]\n"));
274276
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
275277
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
276278
printf(_(" [--immediate] [--recovery-target-name=target-name]\n"));
@@ -280,7 +282,7 @@ help_restore(void)
280282
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
281283
printf(_(" --instance=instance_name name of the instance\n"));
282284

283-
printf(_(" -D, --pgdata=pgdata-dir location of the database storage area\n"));
285+
printf(_(" -D, --pgdata=pgdata-path location of the database storage area\n"));
284286
printf(_(" -i, --backup-id=backup-id backup to restore\n"));
285287

286288
printf(_(" --progress show progress\n"));
@@ -318,17 +320,17 @@ help_restore(void)
318320
printf(_(" --log-directory=log-directory\n"));
319321
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
320322
printf(_(" --log-rotation-size=log-rotation-size\n"));
321-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
322-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
323+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
324+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
323325
printf(_(" --log-rotation-age=log-rotation-age\n"));
324-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
326+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
325327
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
326328
}
327329

328330
static void
329331
help_validate(void)
330332
{
331-
printf(_("%s validate -B backup-dir [--instance=instance_name]\n"), PROGRAM_NAME);
333+
printf(_("%s validate -B backup-path [--instance=instance_name]\n"), PROGRAM_NAME);
332334
printf(_(" [-i backup-id] [--progress]\n"));
333335
printf(_(" [--time=time|--xid=xid|--lsn=lsn [--inclusive=boolean]]\n"));
334336
printf(_(" [--timeline=timeline]\n\n"));
@@ -361,17 +363,17 @@ help_validate(void)
361363
printf(_(" --log-directory=log-directory\n"));
362364
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
363365
printf(_(" --log-rotation-size=log-rotation-size\n"));
364-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
365-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
366+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
367+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
366368
printf(_(" --log-rotation-age=log-rotation-age\n"));
367-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
369+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
368370
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
369371
}
370372

371373
static void
372374
help_show(void)
373375
{
374-
printf(_("%s show -B backup-dir\n"), PROGRAM_NAME);
376+
printf(_("%s show -B backup-path\n"), PROGRAM_NAME);
375377
printf(_(" [--instance=instance_name [-i backup-id]]\n"));
376378
printf(_(" [--format=format]\n\n"));
377379

@@ -384,7 +386,7 @@ help_show(void)
384386
static void
385387
help_delete(void)
386388
{
387-
printf(_("%s delete -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
389+
printf(_("%s delete -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
388390
printf(_(" [-i backup-id | --expired] [--wal]\n\n"));
389391

390392
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
@@ -409,17 +411,17 @@ help_delete(void)
409411
printf(_(" --log-directory=log-directory\n"));
410412
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
411413
printf(_(" --log-rotation-size=log-rotation-size\n"));
412-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
413-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
414+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
415+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
414416
printf(_(" --log-rotation-age=log-rotation-age\n"));
415-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
417+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
416418
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
417419
}
418420

419421
static void
420422
help_merge(void)
421423
{
422-
printf(_("%s merge -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
424+
printf(_("%s merge -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
423425
printf(_(" -i backup-id [-j num-threads] [--progress]\n"));
424426
printf(_(" [--log-level-console=log-level-console]\n"));
425427
printf(_(" [--log-level-file=log-level-file]\n"));
@@ -451,17 +453,17 @@ help_merge(void)
451453
printf(_(" --log-directory=log-directory\n"));
452454
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
453455
printf(_(" --log-rotation-size=log-rotation-size\n"));
454-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
455-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
456+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
457+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
456458
printf(_(" --log-rotation-age=log-rotation-age\n"));
457-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
459+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
458460
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
459461
}
460462

461463
static void
462464
help_set_config(void)
463465
{
464-
printf(_("%s set-config -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
466+
printf(_("%s set-config -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
465467
printf(_(" [--log-level-console=log-level-console]\n"));
466468
printf(_(" [--log-level-file=log-level-file]\n"));
467469
printf(_(" [--log-filename=log-filename]\n"));
@@ -497,10 +499,10 @@ help_set_config(void)
497499
printf(_(" --log-directory=log-directory\n"));
498500
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
499501
printf(_(" --log-rotation-size=log-rotation-size\n"));
500-
printf(_(" rotate logfile if its size exceed this value; 0 disables; (default: 0)\n"));
501-
printf(_(" available units: 'KB', 'MB', 'GB', 'TB' (default: KB)\n"));
502+
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
503+
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
502504
printf(_(" --log-rotation-age=log-rotation-age\n"));
503-
printf(_(" rotate logfile if its age exceed this value; 0 disables; (default: 0)\n"));
505+
printf(_(" rotate logfile if its age exceeds this value; 0 disables; (default: 0)\n"));
504506
printf(_(" available units: 'ms', 's', 'min', 'h', 'd' (default: min)\n"));
505507

506508
printf(_("\n Retention options:\n"));
@@ -534,7 +536,7 @@ help_set_config(void)
534536
static void
535537
help_show_config(void)
536538
{
537-
printf(_("%s show-config -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
539+
printf(_("%s show-config -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
538540
printf(_(" [--format=format]\n\n"));
539541

540542
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
@@ -545,18 +547,18 @@ help_show_config(void)
545547
static void
546548
help_add_instance(void)
547549
{
548-
printf(_("%s add-instance -B backup-dir -D pgdata-dir\n"), PROGRAM_NAME);
550+
printf(_("%s add-instance -B backup-path -D pgdata-path\n"), PROGRAM_NAME);
549551
printf(_(" --instance=instance_name\n\n"));
550552

551553
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
552-
printf(_(" -D, --pgdata=pgdata-dir location of the database storage area\n"));
554+
printf(_(" -D, --pgdata=pgdata-path location of the database storage area\n"));
553555
printf(_(" --instance=instance_name name of the new instance\n"));
554556
}
555557

556558
static void
557559
help_del_instance(void)
558560
{
559-
printf(_("%s del-instance -B backup-dir --instance=instance_name\n\n"), PROGRAM_NAME);
561+
printf(_("%s del-instance -B backup-path --instance=instance_name\n\n"), PROGRAM_NAME);
560562

561563
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
562564
printf(_(" --instance=instance_name name of the instance to delete\n"));
@@ -565,10 +567,12 @@ help_del_instance(void)
565567
static void
566568
help_archive_push(void)
567569
{
568-
printf(_("\n %s archive-push -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
570+
printf(_("\n %s archive-push -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
569571
printf(_(" --wal-file-path=wal-file-path\n"));
570572
printf(_(" --wal-file-name=wal-file-name\n"));
571-
printf(_(" [--compress [--compress-level=compress-level]]\n"));
573+
printf(_(" [--compress]\n"));
574+
printf(_(" [--compress-algorithm=compress-algorithm]\n"));
575+
printf(_(" [--compress-level=compress-level]\n"));
572576
printf(_(" [--overwrite]\n\n"));
573577

574578
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
@@ -578,6 +582,8 @@ help_archive_push(void)
578582
printf(_(" --wal-file-name=wal-file-name\n"));
579583
printf(_(" name of the WAL file to retrieve from the server\n"));
580584
printf(_(" --compress compress WAL file during archiving\n"));
585+
printf(_(" --compress-algorithm=compress-algorithm\n"));
586+
printf(_(" available options: 'zlib','none'\n"));
581587
printf(_(" --compress-level=compress-level\n"));
582588
printf(_(" level of compression [0-9]\n"));
583589
printf(_(" --overwrite overwrite archived WAL file\n"));
@@ -586,7 +592,7 @@ help_archive_push(void)
586592
static void
587593
help_archive_get(void)
588594
{
589-
printf(_("\n %s archive-get -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
595+
printf(_("\n %s archive-get -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
590596
printf(_(" --wal-file-path=wal-file-path\n"));
591597
printf(_(" --wal-file-name=wal-file-name\n\n"));
592598

src/utils/logger.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ write_elevel(FILE *stream, int elevel)
107107
case ERROR:
108108
fputs("ERROR: ", stream);
109109
break;
110-
case FATAL:
111-
fputs("FATAL: ", stream);
112-
break;
113-
case PANIC:
114-
fputs("PANIC: ", stream);
115-
break;
116110
default:
117111
elog_stderr(ERROR, "invalid logging level: %d", elevel);
118112
break;
@@ -151,7 +145,7 @@ exit_if_necessary(int elevel)
151145
}
152146

153147
/*
154-
* Logs to stderr or to log file and exit if ERROR or FATAL.
148+
* Logs to stderr or to log file and exit if ERROR.
155149
*
156150
* Actual implementation for elog() and pg_log().
157151
*/
@@ -288,7 +282,7 @@ elog_stderr(int elevel, const char *fmt, ...)
288282
}
289283

290284
/*
291-
* Logs to stderr or to log file and exit if ERROR or FATAL.
285+
* Logs to stderr or to log file and exit if ERROR.
292286
*/
293287
void
294288
elog(int elevel, const char *fmt, ...)
@@ -308,7 +302,7 @@ elog(int elevel, const char *fmt, ...)
308302
}
309303

310304
/*
311-
* Logs only to log file and exit if ERROR or FATAL.
305+
* Logs only to log file and exit if ERROR.
312306
*/
313307
void
314308
elog_file(int elevel, const char *fmt, ...)
@@ -399,10 +393,6 @@ parse_log_level(const char *level)
399393
return WARNING;
400394
else if (pg_strncasecmp("error", v, len) == 0)
401395
return ERROR;
402-
else if (pg_strncasecmp("fatal", v, len) == 0)
403-
return FATAL;
404-
else if (pg_strncasecmp("panic", v, len) == 0)
405-
return PANIC;
406396

407397
/* Log level is invalid */
408398
elog(ERROR, "invalid log-level \"%s\"", level);
@@ -431,10 +421,6 @@ deparse_log_level(int level)
431421
return "WARNING";
432422
case ERROR:
433423
return "ERROR";
434-
case FATAL:
435-
return "FATAL";
436-
case PANIC:
437-
return "PANIC";
438424
default:
439425
elog(ERROR, "invalid log-level %d", level);
440426
}
@@ -491,7 +477,7 @@ logfile_open(const char *filename, const char *mode)
491477
{
492478
int save_errno = errno;
493479

494-
elog_stderr(FATAL, "could not open log file \"%s\": %s",
480+
elog_stderr(ERROR, "could not open log file \"%s\": %s",
495481
filename, strerror(errno));
496482
errno = save_errno;
497483
}

src/utils/logger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#define NOTICE (-2)
2222
#define WARNING (-1)
2323
#define ERROR 1
24-
#define FATAL 2
25-
#define PANIC 3
2624
#define LOG_OFF 10
2725

2826
/* Logger parameters */

0 commit comments

Comments
 (0)