Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 368d827

Browse files
committed
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
1 parent a9c546a commit 368d827

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6178,7 +6178,7 @@ StartupXLOG(void)
61786178
* Wake up all waiters for replay LSN. They need to report an error that
61796179
* recovery was ended before reaching the target LSN.
61806180
*/
6181-
WaitLSNSetLatches(InvalidXLogRecPtr);
6181+
WaitLSNWakeup(InvalidXLogRecPtr);
61826182

61836183
/*
61846184
* Shutdown the recovery environment. This must occur after
@@ -7303,7 +7303,7 @@ CreateCheckPoint(int flags)
73037303
* until after the above call that flushes the XLOG_CHECKPOINT_ONLINE
73047304
* record.
73057305
*/
7306-
SetWalSummarizerLatch();
7306+
WakeupWalSummarizer();
73077307

73087308
/*
73097309
* Let smgr do post-checkpoint cleanup (eg, deleting old files).

src/backend/access/transam/xlogrecovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ PerformWalRecovery(void)
18371837
if (waitLSNState &&
18381838
(XLogRecoveryCtl->lastReplayedEndRecPtr >=
18391839
pg_atomic_read_u64(&waitLSNState->minWaitedLSN)))
1840-
WaitLSNSetLatches(XLogRecoveryCtl->lastReplayedEndRecPtr);
1840+
WaitLSNWakeup(XLogRecoveryCtl->lastReplayedEndRecPtr);
18411841

18421842
/* Else, try to fetch the next WAL record */
18431843
record = ReadRecord(xlogprefetcher, LOG, false, replayTLI);

src/backend/access/transam/xlogwait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ deleteLSNWaiter(void)
151151
* and set latches for all waiters.
152152
*/
153153
void
154-
WaitLSNSetLatches(XLogRecPtr currentLSN)
154+
WaitLSNWakeup(XLogRecPtr currentLSN)
155155
{
156156
int i;
157157
ProcNumber *wakeUpProcs;

src/backend/postmaster/walsummarizer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,15 +626,15 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
626626
}
627627

628628
/*
629-
* Attempt to set the WAL summarizer's latch.
629+
* Wake up the WAL summarizer process.
630630
*
631631
* This might not work, because there's no guarantee that the WAL summarizer
632632
* process was successfully started, and it also might have started but
633633
* subsequently terminated. So, under normal circumstances, this will get the
634634
* latch set, but there's no guarantee.
635635
*/
636636
void
637-
SetWalSummarizerLatch(void)
637+
WakeupWalSummarizer(void)
638638
{
639639
ProcNumber pgprocno;
640640

src/include/access/xlogwait.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extern PGDLLIMPORT WaitLSNState *waitLSNState;
8282

8383
extern Size WaitLSNShmemSize(void);
8484
extern void WaitLSNShmemInit(void);
85-
extern void WaitLSNSetLatches(XLogRecPtr currentLSN);
85+
extern void WaitLSNWakeup(XLogRecPtr currentLSN);
8686
extern void WaitLSNCleanup(void);
8787
extern WaitLSNResult WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
8888

src/include/postmaster/walsummarizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern void GetWalSummarizerState(TimeLineID *summarized_tli,
2929
int *summarizer_pid);
3030
extern XLogRecPtr GetOldestUnsummarizedLSN(TimeLineID *tli,
3131
bool *lsn_is_exact);
32-
extern void SetWalSummarizerLatch(void);
32+
extern void WakeupWalSummarizer(void);
3333
extern void WaitForWalSummarization(XLogRecPtr lsn);
3434

3535
#endif

0 commit comments

Comments
 (0)