gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

[6X backport] Prevent archive recovery from scanning non-existent WAL files.

Open SunilS26 opened this issue 1 year ago • 0 comments

[!IMPORTANT] Backporting postgres 12 commit https://github.com/postgres/postgres/commit/683e0ef5530 to GPDB 6X_STABLE branch.

Original Commit Message:

Previously when there were multiple timelines listed in the history file of the recovery target timeline, archive recovery searched all of them, starting from the newest timeline to the oldest one, to find the segment to read. That is, archive recovery had to continuously fail scanning the segment until it reached the timeline that the segment belonged to. These scans for non-existent segment could be harmful on the recovery performance especially when archival area was located on the remote storage and each scan could take a long time.

To address the issue, this commit changes archive recovery so that it skips scanning the timeline that the segment to read doesn't belong to.

Per discussion, back-patch to all supported versions.

Author: Kyotaro Horiguchi, tweaked a bit by Fujii Masao Reviewed-by: David Steele, Pavel Suderevsky, Grigory Smolkin Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]


Here are some reminders before you submit the pull request

  • [ ] Add tests for the change
  • [ ] Document changes
  • [ ] Communicate in the mailing list if needed
  • [ ] Pass make installcheck
  • [ ] Review a PR in return to support the community

SunilS26 avatar Dec 14 '23 05:12 SunilS26