Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PBCKP-129] change catchup logging levels#473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kulaginm merged 7 commits intoREL_2_5frompbckp-129
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletionssrc/archive.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
* archive.c: - pg_probackup specific archive commands for archive backups.
*
*
* Portions Copyright (c) 2018-2021, Postgres Professional
* Portions Copyright (c) 2018-2022, Postgres Professional
*
*-------------------------------------------------------------------------
*/
Expand DownExpand Up@@ -361,7 +361,7 @@ push_file(WALSegno *xlogfile, const char *archive_status_dir,
canonicalize_path(wal_file_ready);
canonicalize_path(wal_file_done);
/* It is ok to rename status file in archive_status directory */
elog(VERBOSE, "Rename \"%s\" to \"%s\"", wal_file_ready, wal_file_done);
elog(LOG, "Rename \"%s\" to \"%s\"", wal_file_ready, wal_file_done);

/* do not error out, if rename failed */
if (fio_rename(wal_file_ready, wal_file_done, FIO_DB_HOST) < 0)
Expand DownExpand Up@@ -505,7 +505,7 @@ push_file_internal_uncompressed(const char *wal_file_name, const char *pg_xlog_d
}

part_opened:
elog(VERBOSE, "Temp WAL file successfully created: \"%s\"", to_fullpath_part);
elog(LOG, "Temp WAL file successfully created: \"%s\"", to_fullpath_part);
/* Check if possible to skip copying */
if (fileExists(to_fullpath, FIO_BACKUP_HOST))
{
Expand DownExpand Up@@ -595,7 +595,7 @@ push_file_internal_uncompressed(const char *wal_file_name, const char *pg_xlog_d
to_fullpath_part, strerror(errno));
}

elog(VERBOSE, "Rename \"%s\" to \"%s\"", to_fullpath_part, to_fullpath);
elog(LOG, "Rename \"%s\" to \"%s\"", to_fullpath_part, to_fullpath);

//copy_file_attributes(from_path, FIO_DB_HOST, to_path_temp, FIO_BACKUP_HOST, true);

Expand DownExpand Up@@ -752,7 +752,7 @@ push_file_internal_gz(const char *wal_file_name, const char *pg_xlog_dir,
}

part_opened:
elog(VERBOSE, "Temp WAL file successfully created: \"%s\"", to_fullpath_gz_part);
elog(LOG, "Temp WAL file successfully created: \"%s\"", to_fullpath_gz_part);
/* Check if possible to skip copying,
*/
if (fileExists(to_fullpath_gz, FIO_BACKUP_HOST))
Expand DownExpand Up@@ -844,7 +844,7 @@ push_file_internal_gz(const char *wal_file_name, const char *pg_xlog_dir,
to_fullpath_gz_part, strerror(errno));
}

elog(VERBOSE, "Rename \"%s\" to \"%s\"",
elog(LOG, "Rename \"%s\" to \"%s\"",
to_fullpath_gz_part, to_fullpath_gz);

//copy_file_attributes(from_path, FIO_DB_HOST, to_path_temp, FIO_BACKUP_HOST, true);
Expand DownExpand Up@@ -1155,7 +1155,7 @@ do_archive_get(InstanceState *instanceState, InstanceConfig *instance, const cha
if (get_wal_file(wal_file_name, backup_wal_file_path, absolute_wal_file_path, false))
{
fail_count = 0;
elog(INFO, "pg_probackup archive-get copied WAL file %s", wal_file_name);
elog(LOG, "pg_probackup archive-get copied WAL file %s", wal_file_name);
n_fetched++;
break;
}
Expand DownExpand Up@@ -1511,7 +1511,7 @@ get_wal_file_internal(const char *from_path, const char *to_path, FILE *out,
char *buf = pgut_malloc(OUT_BUF_SIZE); /* 1MB buffer */
int exit_code = 0;

elog(VERBOSE, "Attempting to %s WAL file '%s'",
elog(LOG, "Attempting to %s WAL file '%s'",
is_decompress ? "open compressed" : "open", from_path);

/* open source file for read */
Expand Down
35 changes: 17 additions & 18 deletionssrc/backup.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
* backup.c: backup DB cluster, archived WAL
*
* Portions Copyright (c) 2009-2013, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
* Portions Copyright (c) 2015-2019, Postgres Professional
* Portions Copyright (c) 2015-2022, Postgres Professional
*
*-------------------------------------------------------------------------
*/
Expand DownExpand Up@@ -116,7 +116,7 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
charpretty_time[20];
charpretty_bytes[20];

elog(LOG, "Database backup start");
elog(INFO, "Database backup start");
if(current.external_dir_str)
{
external_dirs = make_external_directory_list(current.external_dir_str,
Expand DownExpand Up@@ -336,11 +336,11 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
/* Extract information about files in backup_list parsing their names:*/
parse_filelist_filenames(backup_files_list, instance_config.pgdata);

elog(LOG, "Current Start LSN: %X/%X, TLI: %X",
elog(INFO, "Current Start LSN: %X/%X, TLI: %X",
(uint32) (current.start_lsn >> 32), (uint32) (current.start_lsn),
current.tli);
if (current.backup_mode != BACKUP_MODE_FULL)
elog(LOG, "Parent Start LSN: %X/%X, TLI: %X",
elog(INFO, "Parent Start LSN: %X/%X, TLI: %X",
(uint32) (prev_backup->start_lsn >> 32), (uint32) (prev_backup->start_lsn),
prev_backup->tli);

Expand DownExpand Up@@ -412,7 +412,7 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
else
join_path_components(dirpath, current.database_dir, file->rel_path);

elog(VERBOSE, "Create directory '%s'", dirpath);
elog(LOG, "Create directory '%s'", dirpath);
fio_mkdir(dirpath, DIR_PERMISSION, FIO_BACKUP_HOST);
}

Expand DownExpand Up@@ -673,7 +673,7 @@ pgdata_basic_setup(ConnectionOptions conn_opt, PGNodeInfo *nodeInfo)
nodeInfo->checksum_version = current.checksum_version;

if (current.checksum_version)
elog(LOG, "This PostgreSQL instance was initialized with data block checksums. "
elog(INFO, "This PostgreSQL instance was initialized with data block checksums. "
"Data block corruption will be detected");
else
elog(WARNING, "This PostgreSQL instance was initialized without data block checksums. "
Expand DownExpand Up@@ -1513,7 +1513,7 @@ wait_wal_and_calculate_stop_lsn(const char *xlog_path, XLogRecPtr stop_lsn, pgBa
stop_lsn_exists = true;
}

elog(LOG, "stop_lsn: %X/%X",
elog(INFO, "stop_lsn: %X/%X",
(uint32) (stop_lsn >> 32), (uint32) (stop_lsn));

/*
Expand DownExpand Up@@ -1902,15 +1902,15 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb

backup->recovery_xid = stop_backup_result.snapshot_xid;

elog(LOG, "Getting the Recovery Time from WAL");
elog(INFO, "Getting the Recovery Time from WAL");

/* iterate over WAL from stop_backup lsn to start_backup lsn */
if (!read_recovery_info(xlog_path, backup->tli,
instance_config.xlog_seg_size,
backup->start_lsn, backup->stop_lsn,
&backup->recovery_time))
{
elog(LOG, "Failed to find Recovery Time in WAL, forced to trust current_timestamp");
elog(INFO, "Failed to find Recovery Time in WAL, forced to trust current_timestamp");
backup->recovery_time = stop_backup_result.invocation_time;
}

Expand DownExpand Up@@ -1992,9 +1992,8 @@ backup_files(void *arg)
if (interrupted || thread_interrupted)
elog(ERROR, "interrupted during backup");

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

/* Handle zero sized files */
if (file->size == 0)
Expand DownExpand Up@@ -2064,11 +2063,11 @@ backup_files(void *arg)

if (file->write_size == BYTES_INVALID)
{
elog(VERBOSE, "Skipping the unchanged file: \"%s\"", from_fullpath);
elog(LOG, "Skipping the unchanged file: \"%s\"", from_fullpath);
continue;
}

elog(VERBOSE, "File \"%s\". Copied "INT64_FORMAT " bytes",
elog(LOG, "File \"%s\". Copied "INT64_FORMAT " bytes",
from_fullpath, file->write_size);
}

Expand DownExpand Up@@ -2186,26 +2185,26 @@ set_cfs_datafiles(parray *files, const char *root, char *relative, size_t i)
elog(ERROR, "Out of memory");
len = strlen("/pg_compression");
cfs_tblspc_path[strlen(cfs_tblspc_path) - len] = 0;
elog(VERBOSE, "CFS DIRECTORY %s, pg_compression path: %s", cfs_tblspc_path, relative);
elog(LOG, "CFS DIRECTORY %s, pg_compression path: %s", cfs_tblspc_path, relative);

for (p = (int) i; p >= 0; p--)
{
prev_file = (pgFile *) parray_get(files, (size_t) p);

elog(VERBOSE, "Checking file in cfs tablespace %s", prev_file->rel_path);
elog(LOG, "Checking file in cfs tablespace %s", prev_file->rel_path);

if (strstr(prev_file->rel_path, cfs_tblspc_path) != NULL)
{
if (S_ISREG(prev_file->mode) && prev_file->is_datafile)
{
elog(VERBOSE, "Setting 'is_cfs' on file %s, name %s",
elog(LOG, "Setting 'is_cfs' on file %s, name %s",
prev_file->rel_path, prev_file->name);
prev_file->is_cfs = true;
}
}
else
{
elog(VERBOSE, "Breaking on %s", prev_file->rel_path);
elog(LOG, "Breaking on %s", prev_file->rel_path);
break;
}
}
Expand Down
30 changes: 15 additions & 15 deletionssrc/catchup.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@
*
* catchup.c: sync DB cluster
*
* Copyright (c) 2022, Postgres Professional
* Copyright (c)2021-2022, Postgres Professional
*
*-------------------------------------------------------------------------
*/
Expand DownExpand Up@@ -203,7 +203,7 @@ catchup_preflight_checks(PGNodeInfo *source_node_info, PGconn *source_conn,

/* fill dest_redo.lsn and dest_redo.tli */
get_redo(dest_pgdata, FIO_LOCAL_HOST, &dest_redo);
elog(VERBOSE, "source.tli = %X, dest_redo.lsn = %X/%X, dest_redo.tli = %X",
elog(LOG, "source.tli = %X, dest_redo.lsn = %X/%X, dest_redo.tli = %X",
current.tli, (uint32) (dest_redo.lsn >> 32), (uint32) dest_redo.lsn, dest_redo.tli);

if (current.tli != 1)
Expand DownExpand Up@@ -398,9 +398,8 @@ catchup_thread_runner(void *arg)
if (interrupted || thread_interrupted)
elog(ERROR, "Interrupted during catchup");

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

/* construct destination filepath */
Assert(file->external_dir_num == 0);
Expand DownExpand Up@@ -447,12 +446,12 @@ catchup_thread_runner(void *arg)

if (file->write_size == BYTES_INVALID)
{
elog(VERBOSE, "Skipping the unchanged file: \"%s\", read %li bytes", from_fullpath, file->read_size);
elog(LOG, "Skipping the unchanged file: \"%s\", read %li bytes", from_fullpath, file->read_size);
continue;
}

arguments->transfered_bytes += file->write_size;
elog(VERBOSE, "File \"%s\". Copied "INT64_FORMAT " bytes",
elog(LOG, "File \"%s\". Copied "INT64_FORMAT " bytes",
from_fullpath, file->write_size);
}

Expand DownExpand Up@@ -607,7 +606,7 @@ filter_filelist(parray *filelist, const char *pgdata,
&& parray_bsearch(exclude_relative_paths_list, file->rel_path, pgPrefixCompareString)!= NULL)
)
{
elog(LOG, "%s file \"%s\" excluded with --exclude-path option", logging_string, full_path);
elog(INFO, "%s file \"%s\" excluded with --exclude-path option", logging_string, full_path);
file->excluded = true;
}
}
Expand DownExpand Up@@ -650,7 +649,7 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
if (exclude_relative_paths_list != NULL)
parray_qsort(exclude_relative_paths_list, pgCompareString);

elog(LOG, "Database catchup start");
elog(INFO, "Database catchup start");

if (current.backup_mode != BACKUP_MODE_FULL)
{
Expand DownExpand Up@@ -697,7 +696,7 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,

/* Call pg_start_backup function in PostgreSQL connect */
pg_start_backup(label, smooth_checkpoint, &current, &source_node_info, source_conn);
elog(LOG, "pg_start_backup START LSN %X/%X", (uint32) (current.start_lsn >> 32), (uint32) (current.start_lsn));
elog(INFO, "pg_start_backup START LSN %X/%X", (uint32) (current.start_lsn >> 32), (uint32) (current.start_lsn));
}

/* Sanity: source cluster must be "in future" relatively to dest cluster */
Expand DownExpand Up@@ -772,11 +771,11 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
elog(INFO, "Source PGDATA size: %s (excluded %s)", pretty_source_bytes, pretty_bytes);
}

elog(LOG, "Start LSN (source): %X/%X, TLI: %X",
elog(INFO, "Start LSN (source): %X/%X, TLI: %X",
(uint32) (current.start_lsn >> 32), (uint32) (current.start_lsn),
current.tli);
if (current.backup_mode != BACKUP_MODE_FULL)
elog(LOG, "LSN in destination: %X/%X, TLI: %X",
elog(INFO, "LSN in destination: %X/%X, TLI: %X",
(uint32) (dest_redo.lsn >> 32), (uint32) (dest_redo.lsn),
dest_redo.tli);

Expand DownExpand Up@@ -829,7 +828,8 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
chardirpath[MAXPGPATH];

join_path_components(dirpath, dest_pgdata, file->rel_path);
elog(VERBOSE, "Create directory '%s'", dirpath);

elog(LOG, "Create directory '%s'", dirpath);
if (!dry_run)
fio_mkdir(dirpath, DIR_PERMISSION, FIO_LOCAL_HOST);
}
Expand DownExpand Up@@ -859,7 +859,7 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,

join_path_components(to_path, dest_pgdata, file->rel_path);

elog(VERBOSE, "Create directory \"%s\" and symbolic link \"%s\"",
elog(INFO, "Create directory \"%s\" and symbolic link \"%s\"",
linked_path, to_path);

if (!dry_run)
Expand DownExpand Up@@ -946,7 +946,7 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
{
fio_delete(file->mode, fullpath, FIO_LOCAL_HOST);
}
elog(VERBOSE, "Deleted file \"%s\"", fullpath);
elog(LOG, "Deleted file \"%s\"", fullpath);

/* shrink dest pgdata list */
pgFileFree(file);
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp