Skip to content

Commit d2e7068

Browse files
committed
Fix outdated comment
Commit bc971f4 replaced the latch-setting mechanism that the comment talked about with a condition variable. And before that, commit 2258e76 moved the code so that the comment got detached from the loop that it talked about, so move the comment closer to the loop.
1 parent ad13490 commit d2e7068

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/backend/access/transam/xlogutils.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,6 @@ wal_segment_close(XLogReaderState *state)
840840
*
841841
* Public because it would likely be very helpful for someone writing another
842842
* output method outside walsender, e.g. in a bgworker.
843-
*
844-
* TODO: The walsender has its own version of this, but it relies on the
845-
* walsender's latch being set whenever WAL is flushed. No such infrastructure
846-
* exists for normal backends, so we have to do a check/sleep/repeat style of
847-
* loop for now.
848843
*/
849844
int
850845
read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr,
@@ -884,7 +879,14 @@ read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
884879

885880
loc = targetPagePtr + reqLen;
886881

887-
/* Loop waiting for xlog to be available if necessary */
882+
/*
883+
* Loop waiting for xlog to be available if necessary
884+
*
885+
* TODO: The walsender has its own version of this function, which uses a
886+
* condition variable to wake up whenever WAL is flushed. We could use the
887+
* same infrastructure here, instead of the check/sleep/repeat style of
888+
* loop.
889+
*/
888890
while (1)
889891
{
890892
/*

0 commit comments

Comments
 (0)