mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Rename two functions that wake up other processes
Instead of talking about setting latches, which is a pretty low-level mechanism, emphasize that they wake up other processes. This is in preparation for replacing Latches with a new abstraction. That's still work in progress, but this seems a little tidier anyway, so let's get this refactoring out of the way already. Discussion: https://www.postgresql.org/message-id/391abe21-413e-4d91-a650-b663af49500c%40iki.fi
This commit is contained in:
@ -6178,7 +6178,7 @@ StartupXLOG(void)
|
|||||||
* Wake up all waiters for replay LSN. They need to report an error that
|
* Wake up all waiters for replay LSN. They need to report an error that
|
||||||
* recovery was ended before reaching the target LSN.
|
* recovery was ended before reaching the target LSN.
|
||||||
*/
|
*/
|
||||||
WaitLSNSetLatches(InvalidXLogRecPtr);
|
WaitLSNWakeup(InvalidXLogRecPtr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shutdown the recovery environment. This must occur after
|
* Shutdown the recovery environment. This must occur after
|
||||||
@ -7303,7 +7303,7 @@ CreateCheckPoint(int flags)
|
|||||||
* until after the above call that flushes the XLOG_CHECKPOINT_ONLINE
|
* until after the above call that flushes the XLOG_CHECKPOINT_ONLINE
|
||||||
* record.
|
* record.
|
||||||
*/
|
*/
|
||||||
SetWalSummarizerLatch();
|
WakeupWalSummarizer();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Let smgr do post-checkpoint cleanup (eg, deleting old files).
|
* Let smgr do post-checkpoint cleanup (eg, deleting old files).
|
||||||
|
@ -1837,7 +1837,7 @@ PerformWalRecovery(void)
|
|||||||
if (waitLSNState &&
|
if (waitLSNState &&
|
||||||
(XLogRecoveryCtl->lastReplayedEndRecPtr >=
|
(XLogRecoveryCtl->lastReplayedEndRecPtr >=
|
||||||
pg_atomic_read_u64(&waitLSNState->minWaitedLSN)))
|
pg_atomic_read_u64(&waitLSNState->minWaitedLSN)))
|
||||||
WaitLSNSetLatches(XLogRecoveryCtl->lastReplayedEndRecPtr);
|
WaitLSNWakeup(XLogRecoveryCtl->lastReplayedEndRecPtr);
|
||||||
|
|
||||||
/* Else, try to fetch the next WAL record */
|
/* Else, try to fetch the next WAL record */
|
||||||
record = ReadRecord(xlogprefetcher, LOG, false, replayTLI);
|
record = ReadRecord(xlogprefetcher, LOG, false, replayTLI);
|
||||||
|
@ -151,7 +151,7 @@ deleteLSNWaiter(void)
|
|||||||
* and set latches for all waiters.
|
* and set latches for all waiters.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
WaitLSNSetLatches(XLogRecPtr currentLSN)
|
WaitLSNWakeup(XLogRecPtr currentLSN)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ProcNumber *wakeUpProcs;
|
ProcNumber *wakeUpProcs;
|
||||||
|
@ -626,7 +626,7 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attempt to set the WAL summarizer's latch.
|
* Wake up the WAL summarizer process.
|
||||||
*
|
*
|
||||||
* This might not work, because there's no guarantee that the WAL summarizer
|
* This might not work, because there's no guarantee that the WAL summarizer
|
||||||
* process was successfully started, and it also might have started but
|
* process was successfully started, and it also might have started but
|
||||||
@ -634,7 +634,7 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
|
|||||||
* latch set, but there's no guarantee.
|
* latch set, but there's no guarantee.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
SetWalSummarizerLatch(void)
|
WakeupWalSummarizer(void)
|
||||||
{
|
{
|
||||||
ProcNumber pgprocno;
|
ProcNumber pgprocno;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ extern PGDLLIMPORT WaitLSNState *waitLSNState;
|
|||||||
|
|
||||||
extern Size WaitLSNShmemSize(void);
|
extern Size WaitLSNShmemSize(void);
|
||||||
extern void WaitLSNShmemInit(void);
|
extern void WaitLSNShmemInit(void);
|
||||||
extern void WaitLSNSetLatches(XLogRecPtr currentLSN);
|
extern void WaitLSNWakeup(XLogRecPtr currentLSN);
|
||||||
extern void WaitLSNCleanup(void);
|
extern void WaitLSNCleanup(void);
|
||||||
extern WaitLSNResult WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
|
extern WaitLSNResult WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ extern void GetWalSummarizerState(TimeLineID *summarized_tli,
|
|||||||
int *summarizer_pid);
|
int *summarizer_pid);
|
||||||
extern XLogRecPtr GetOldestUnsummarizedLSN(TimeLineID *tli,
|
extern XLogRecPtr GetOldestUnsummarizedLSN(TimeLineID *tli,
|
||||||
bool *lsn_is_exact);
|
bool *lsn_is_exact);
|
||||||
extern void SetWalSummarizerLatch(void);
|
extern void WakeupWalSummarizer(void);
|
||||||
extern void WaitForWalSummarization(XLogRecPtr lsn);
|
extern void WaitForWalSummarization(XLogRecPtr lsn);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user