From: | Thunder <thunder1(at)126(dot)com> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Improve the performance to create END_OF_RECOVERY checkpoint |
Date: | 2020-12-22 07:50:48 |
Message-ID: | 104e675c.41b1.176896de1d9.Coremail.thunder1@126.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Dear All
In startup process we only launch bgwriter when ArchiveRecoveryRequested is true, which means we will not lauch bgwriter in master node.
The bgwriters can write the dirty buffers to disk which helps startup process to do less IO when we complete xlog replay and request to do END_OF_RECOVERY checkpoint.
So can we delete the limit of ArchiveRecoveryRequested, and enable launch bgwriter in master node ?
7128 /*
7129 * Let postmaster know we've started redo now, so that it can launch
7130 * checkpointer to perform restartpoints. We don't bother during
7131 * crash recovery as restartpoints can only be performed during
7132 * archive recovery. And we'd like to keep crash recovery simple, to
7133 * avoid introducing bugs that could affect you when recovering after
7134 * crash.
7135 *
7136 * After this point, we can no longer assume that we're the only
7137 * process in addition to postmaster! Also, fsync requests are
7138 * subsequently to be handled by the checkpointer, not locally.
7139 */
7140 if (ArchiveRecoveryRequested && IsUnderPostmaster)
7141 {
7142 PublishStartupProcessInformation();
7143 EnableSyncRequestForwarding();
7144 SendPostmasterSignal(PMSIGNAL_RECOVERY_STARTED);
7145 bgwriterLaunched = true;
7146 }
Thanks
Ray
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2020-12-22 07:57:30 | Re: a misbehavior of partition row movement (?) |
Previous Message | Amit Langote | 2020-12-22 07:16:44 | Re: a misbehavior of partition row movement (?) |