1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-18 21:28:07 +02:00

checkdb: close initial connection, skipped db in amcheck now counts as fatal error

This commit is contained in:
Grigory Smolkin 2019-04-13 22:33:04 +03:00
parent e5e16320fd
commit 2e639a81fe
2 changed files with 9 additions and 8 deletions

View File

@ -1063,6 +1063,7 @@ do_amcheck(void)
0, NULL);
n_databases = PQntuples(res_db);
PQclear(res_db);
elog(INFO, "Start amchecking PostgreSQL instance");
@ -1134,14 +1135,17 @@ do_amcheck(void)
break;
}
/* close initial connection to pgdatabase */
pgut_disconnect(backup_conn);
/* TODO write better info message */
if (db_skipped)
elog(WARNING, "Some databases were not checked");
if (!check_isok)
if (!check_isok || db_skipped)
elog(ERROR, "Checkdb --amcheck failed");
else
elog(INFO, "Checkdb --amcheck executed");
elog(INFO, "Checkdb --amcheck executed successfully");
/* We cannot state that all indexes are ok
* without checking indexes in all databases
@ -1151,7 +1155,7 @@ do_amcheck(void)
}
/* Entry point of pg_probackup CHECKDB subcommand. */
int
void
do_checkdb(bool need_amcheck)
{
@ -1165,9 +1169,6 @@ do_checkdb(bool need_amcheck)
if (need_amcheck)
do_amcheck();
/* TODO: need to exit with 1 if some corruption is found */
return 0;
}
/*

View File

@ -421,7 +421,7 @@ extern const char *pgdata_exclude_dir[];
/* in backup.c */
extern int do_backup(time_t start_time);
extern int do_checkdb(bool need_amcheck);
extern void do_checkdb(bool need_amcheck);
extern BackupMode parse_backup_mode(const char *value);
extern const char *deparse_backup_mode(BackupMode mode);
extern void process_block_change(ForkNumber forknum, RelFileNode rnode,