Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 4, 2022
Merged

[PBCKP-129] change catchup logging levels #473

merged 7 commits into from
Aug 4, 2022

Conversation

kulaginm
Copy link
Member

No description provided.

@kulaginm kulaginm added this to the 2.5.6 milestone Feb 17, 2022
kulaginm and others added 2 commits May 23, 2022 05:52
INFO – common information
LOG – same as INFO + info about files
VERBOSE – same as LOG + info about block and SQL queries
@MetalDream666 MetalDream666 self-requested a review May 26, 2022 13:08
@MetalDream666
Copy link
Contributor

MetalDream666 commented May 27, 2022

Нашла следующие возможные исправления

Поменять elog(VERBOSE..) на LOG:
(Переименование файлов тоже под elog(LOG..) должно быть)

src/restore.c
846: elog(VERBOSE, "Create external directory "%s"", dirpath);
926: elog(VERBOSE, "Deleted file "%s"", fullpath);

src/merge.c
813: elog(VERBOSE, "Deleted "%s"", full_file_path);
1147: elog(VERBOSE, "Deleted "%s"", full_path);
1196: elog(VERBOSE, "Rename %s to %s", old_path, new_path);

src/backup.c
415: elog(VERBOSE, "Create directory '%s'", dirpath);
2067: elog(VERBOSE, "Skipping the unchanged file: "%s"", from_fullpath);
2071: elog(VERBOSE, "File "%s". Copied "INT64_FORMAT " bytes",

src/dir.c
1137: elog(VERBOSE, "Create directory "%s" and symbolic link "%s"",
1154: elog(VERBOSE, "Create directory "%s"", dir->rel_path);
1892: elog(VERBOSE, "Deleted file "%s"", fullpath);

src/archive.c
364: elog(VERBOSE, "Rename "%s" to "%s"", wal_file_ready, wal_file_done);

Поменять elog(LOG..) на INFO (скорее всего):

src/backup.c
119: elog(LOG, "Database backup start");
339: elog(LOG, "Current Start LSN: %X/%X, TLI: %X",
343: elog(LOG, "Parent Start LSN: %X/%X, TLI: %X",
676: elog(LOG, "This PostgreSQL instance was initialized with data block checksums. "
743: elog(LOG, "Backup destination is initialized");
1516: elog(LOG, "stop_lsn: %X/%X",

Поменять elog(INFO..) на что-то другое:

src/util.c
592: elog(INFO, " block %u", blocknum); -- здесь инфа по блокам, VERBOSE

src/data.c
1767: elog(INFO, "Block %u of "%s" is truncated",

@kulaginm
Copy link
Member Author

Исправил по замечаниям ревью, внёс изменения и для других команд (не только для catchup)

@MetalDream666
Copy link
Contributor

MetalDream666 commented May 30, 2022

Новая партия предложенных правок

(аналогичные сообщения стоят под VERBOSE)

Поменять на VERBOSE (информация по блокам, тредам, WAL):

src/backup.c
1274: elog(LOG, "Looking for segment: %s", wal_segment);
1276: elog(LOG, "Looking for LSN %X/%X in segment: %s",
1297: elog(LOG, "Found compressed WAL segment: %s", wal_segment_path);
1301: elog(LOG, "Found WAL segment: %s", wal_segment_path);
1318: elog(LOG, "Found LSN: %X/%X", (uint32) (target_lsn >> 32), (uint32) target_lsn);
1347: elog(LOG, "Found prior LSN: %X/%X",
1415: elog(LOG, "Invalid offset in stop_lsn value %X/%X, trying to fix",

src/data.c
1838: elog(LOG, "File "%s", block %u, page is NULL", file->rel_path, blknum);
1841: elog(LOG, "File: %s blknum %u, empty zeroed page", file->rel_path, blknum);

src/archive.c
470: elog(LOG, "Temp WAL file already exists, waiting on it %u seconds: "%s"",
499: elog(LOG, "Reusing stale temp WAL file "%s"", to_fullpath_part);
520: elog(LOG, "WAL file already exists in archive with the same "
531: elog(LOG, "WAL file already exists in archive with "
716: elog(LOG, "Temp WAL file already exists, waiting on it %u seconds: "%s"",
745: elog(LOG, "Reusing stale temp WAL file "%s"", to_fullpath_gz_part);
769: elog(LOG, "WAL file already exists in archive with the same "
780: elog(LOG, "WAL file already exists in archive with "
1165: elog(LOG, "Failed to get WAL file %s, retry %i/3", wal_file_name, fail_count);
1240: elog(LOG, "Thread [%d]: Failed to prefetch WAL segment %s", 0, xlogfile->name);
1317: elog(LOG, "Failed to prefetch WAL segment %s", xlogfile->name);
1449: elog(LOG, "Target WAL file is missing: %s", filename);
1489: elog(LOG, "WAL file successfully %s: %s",
1663: elog(LOG, "Prefetched WAL segment %s is invalid, cannot use it", wal_file_name);

src/parsexlog.c
691: elog(LOG, "First record in WAL segment "%s": %X/%X", wal_segment,
787: elog(LOG, "Record %X/%X is next after target LSN %X/%X",
913: elog(LOG, "Record %X/%X has endpoint %X/%X which is equal or greater than requested LSN %X/%X",
1039: elog(LOG, "Thread [%d]: Opening WAL segment "%s"",
1058: elog(LOG, "Thread [%d]: Opening compressed WAL segment "%s"",
1491: elog(LOG, "Thread [%d]: Endpoint %X/%X is not inclusive, switch to the next timeline",

src/stream.c
248: elog(LOG, "started streaming WAL at %X/%X (timeline %u) using%s slot %s",
258: elog(LOG, "started streaming WAL at %X/%X (timeline %u)",
340: elog(LOG, "finished streaming WAL at %X/%X (timeline %u)",
393: elog(LOG, _("switched to timeline %u at %X/%X\n"),

src/data.c
1767: elog(INFO, "Block %u of "%s" is truncated",

@kulaginm kulaginm modified the milestones: 2.5.6, 2.5.7 Jun 1, 2022
@kulaginm
Copy link
Member Author

kulaginm commented Aug 2, 2022

Посмотрел последний комментарий @MetalDream666 (и указанный там код), но ничего не стал менять в коде, по одной из двух встречающихся причин:

  1. некоторые сообщения уже были VERBOSE
  2. WAL segment -- это файл, соответственно уровень логирования -- не ниже LOG, а чаще даже информация касается общего процесса выполнения (например обработка в команде archive_push)

Copy link
Contributor

@MetalDream666 MetalDream666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Окей, соглашусь. Перепровепила еще раз все сообщения, думаю, можно мерджить

@kulaginm kulaginm changed the base branch from release_2_5_6 to release_2_5_7 August 4, 2022 12:18
@kulaginm kulaginm changed the base branch from release_2_5_7 to REL_2_5 August 4, 2022 14:13
@kulaginm kulaginm merged commit 2e1950a into REL_2_5 Aug 4, 2022
kulaginm added a commit to pgtoolz/pg_backup that referenced this pull request Mar 25, 2023
* [PBCKP-129] change catchup logging level verbosity:
INFO – common information
LOG – same as INFO + info about files
VERBOSE – same as LOG + info about block and SQL queries
gsmolk pushed a commit to pgtoolz/pg_backup that referenced this pull request Mar 25, 2023
* [PBCKP-129] change catchup logging level verbosity:
INFO – common information
LOG – same as INFO + info about files
VERBOSE – same as LOG + info about block and SQL queries
gsmolk pushed a commit to pgtoolz/pg_backup that referenced this pull request Apr 27, 2023
* [PBCKP-129] change catchup logging level verbosity:
INFO – common information
LOG – same as INFO + info about files
VERBOSE – same as LOG + info about block and SQL queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants