summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2025-03-04 13:33:19 +0000
committerHeikki Linnakangas2025-03-04 13:33:19 +0000
commitd2e7068392b22218b83b7e275b77968027ac3d29 (patch)
tree3d382a6129a5a2b358ee8f5049581baef69c524a
parentad13490be0005b0f467879d8f88db003b7494138 (diff)
Fix outdated comment
Commit bc971f4025 replaced the latch-setting mechanism that the comment talked about with a condition variable. And before that, commit 2258e76f90 moved the code so that the comment got detached from the loop that it talked about, so move the comment closer to the loop.
-rw-r--r--src/backend/access/transam/xlogutils.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index b61a0eb4014..c389b27f77d 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -840,11 +840,6 @@ wal_segment_close(XLogReaderState *state)
*
* Public because it would likely be very helpful for someone writing another
* output method outside walsender, e.g. in a bgworker.
- *
- * TODO: The walsender has its own version of this, but it relies on the
- * walsender's latch being set whenever WAL is flushed. No such infrastructure
- * exists for normal backends, so we have to do a check/sleep/repeat style of
- * loop for now.
*/
int
read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr,
@@ -884,7 +879,14 @@ read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
loc = targetPagePtr + reqLen;
- /* Loop waiting for xlog to be available if necessary */
+ /*
+ * Loop waiting for xlog to be available if necessary
+ *
+ * TODO: The walsender has its own version of this function, which uses a
+ * condition variable to wake up whenever WAL is flushed. We could use the
+ * same infrastructure here, instead of the check/sleep/repeat style of
+ * loop.
+ */
while (1)
{
/*