Skip to content
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

Resolve archive_mode always conflicts for 6.27.1-sync #957

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

InnerLife0
Copy link

@InnerLife0 InnerLife0 commented May 28, 2024

Our patches related to archive_mode always where reverted in #956 due to conflicts with upstream commits.
The reason of conflicts is commit 4f2db19 with the previous job done in commit 5e3e0f7.
After fixing the conflicts with our fa759d1, all other commits (62ab24a and 71a4062) where applied without additional changes.


Resolved conflicts:
In 5e3e0f7 close logic was moved to a new
function: XLogWalRcvClose(). As upstream has no archive_mode always in 6x, the
branch for XLogArchiveMode != ARCHIVE_MODE_ALWAYS was removed by them during
back-port. It was restored later in 4f2db19,
but in a modified way according to commit needs. According to our needs,
XLogArchiveNotify() should be called for ARCHIVE_MODE_ALWAYS too. The
condition was slightly reworked to back-port current patch. The same was done
for changes in WalReceiverMain().


This patch contains 3 commits which should be merged as is without squash.

@InnerLife0 InnerLife0 force-pushed the ADBDEV-5709 branch 5 times, most recently from a052179 to 5a0ffbc Compare May 28, 2024 13:24
@red1452 red1452 force-pushed the 6.27.1-sync branch 6 times, most recently from d6a8d70 to 4c02e81 Compare May 31, 2024 04:35
@InnerLife0 InnerLife0 force-pushed the ADBDEV-5709 branch 2 times, most recently from 1c4a846 to ab92a7c Compare May 31, 2024 12:51
@InnerLife0 InnerLife0 changed the base branch from 6.27.1-sync to adb-6.x May 31, 2024 15:18
@BenderArenadata
Copy link

Allure report https://allure.adsw.io/launch/72018

@BenderArenadata
Copy link

Failed job Regression tests with Postgres on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1463265

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1463267

@BenderArenadata
Copy link

Failed job Regression tests with ORCA on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1463268

hlinnaka and others added 2 commits June 3, 2024 10:19
In 'always' mode, the standby independently archives all files it receives
from the primary.

Original patch by Fujii Masao, docs and review by me.

(cherry picked from commit fa759d1)

Resolved conflicts:
In 5e3e0f7 close logic was moved to a new
function: `XLogWalRcvClose()`. As upstream has no archive_mode `always` in 6x, the
branch for `XLogArchiveMode != ARCHIVE_MODE_ALWAYS` was removed by them during
back-port. It was restored later in 4f2db19,
but in a modified way according to commit needs. According to our needs,
`XLogArchiveNotify()` should be called for `ARCHIVE_MODE_ALWAYS` too. The
condition was slightly reworked to back-port current patch. The same was done
for changes in `WalReceiverMain()`.
A restart point or a checkpoint recycling WAL segments treats segments
marked with neither ".done" (archiving is done) or ".ready" (segment is
ready to be archived) in archive_status the same way for archive_mode
being "on" or "always".  While for a primary this is fine, a standby
running a restart point with archive_mode = on would try to mark such a
segment as ready for archiving, which is something that will never
happen except after the standby is promoted.

Note that this problem applies only to WAL segments coming from the
local pg_wal the first time archive recovery is run.  Segments part of a
self-contained base backup are the most common case where this could
happen, however even in this case normally the .done markers would be
most likely part of the backup.  Segments recovered from an archive are
marked as .ready or .done by the startup process, and segments finished
streaming are marked as such by the WAL receiver, so they are handled
already.

Reported-by: Haruka Takatsuka
Author: Michael Paquier
Discussion: https://postgr.es/m/15402-a453c90ed4cf88b2@postgresql.org
Backpatch-through: 9.5, where archive_mode = always has been added.

(cherry picked from commit 62ab24a)
@InnerLife0 InnerLife0 changed the base branch from adb-6.x to 6.27.1-sync June 3, 2024 05:20
@InnerLife0 InnerLife0 changed the base branch from 6.27.1-sync to adb-6.x June 3, 2024 05:23
@BenderArenadata
Copy link

Allure report https://allure.adsw.io/launch/72109

@InnerLife0 InnerLife0 marked this pull request as ready for review June 3, 2024 08:01
@InnerLife0 InnerLife0 changed the base branch from adb-6.x to 6.27.1-sync June 3, 2024 08:03
…very.

After the archiver dies, postmaster tries to start a new one immediately.
But previously this could happen only while server was running normally
even though archiving was enabled always (i.e., archive_mode was set to
always). So the archiver running during recovery could not restart soon
after it died. This is an oversight in commit ffd3774.

This commit changes reaper(), postmaster's signal handler to cleanup
after a child process dies, so that it tries to a new archiver even during
recovery if necessary.

Patch by me. Review by Alvaro Herrera.

(cherry picked from commit 71a4062)
@InnerLife0 InnerLife0 merged commit 884350d into 6.27.1-sync Jun 3, 2024
4 of 5 checks passed
@InnerLife0 InnerLife0 deleted the ADBDEV-5709 branch June 3, 2024 10:33
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.

None yet

6 participants