1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-11 05:41:32 +03:00

pgindent, because I forgot to do that.

Commit 065583cf460f980a182498941ac52810f709a897 should have
included these changes.
This commit is contained in:
Robert Haas 2024-06-28 10:45:51 -04:00
parent 716bd12d22
commit b48f275f18

View File

@ -505,10 +505,10 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
return InvalidXLogRecPtr; return InvalidXLogRecPtr;
/* /*
* If we are not the WAL summarizer process, then we normally just want * If we are not the WAL summarizer process, then we normally just want to
* to read the values from shared memory. However, as an exception, if * read the values from shared memory. However, as an exception, if shared
* shared memory hasn't been initialized yet, then we need to do that so * memory hasn't been initialized yet, then we need to do that so that we
* that we can read legal values and not remove any WAL too early. * can read legal values and not remove any WAL too early.
*/ */
if (!am_wal_summarizer) if (!am_wal_summarizer)
{ {
@ -532,8 +532,8 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
* Find the oldest timeline on which WAL still exists, and the earliest * Find the oldest timeline on which WAL still exists, and the earliest
* segment for which it exists. * segment for which it exists.
* *
* Note that we do this every time the WAL summarizer process restarts * Note that we do this every time the WAL summarizer process restarts or
* or recovers from an error, in case the contents of pg_wal have changed * recovers from an error, in case the contents of pg_wal have changed
* under us e.g. if some files were removed, either manually - which * under us e.g. if some files were removed, either manually - which
* shouldn't really happen, but might - or by postgres itself, if * shouldn't really happen, but might - or by postgres itself, if
* summarize_wal was turned off and then back on again. * summarize_wal was turned off and then back on again.
@ -582,16 +582,15 @@ GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
errmsg_internal("no WAL found on timeline %u", latest_tli)); errmsg_internal("no WAL found on timeline %u", latest_tli));
/* /*
* If we're the WAL summarizer, we always want to store the values we * If we're the WAL summarizer, we always want to store the values we just
* just computed into shared memory, because those are the values we're * computed into shared memory, because those are the values we're going
* going to use to drive our operation, and so they are the authoritative * to use to drive our operation, and so they are the authoritative
* values. Otherwise, we only store values into shared memory if shared * values. Otherwise, we only store values into shared memory if shared
* memory is uninitialized. Our values are not canonical in such a case, * memory is uninitialized. Our values are not canonical in such a case,
* but it's better to have something than nothing, to guide WAL * but it's better to have something than nothing, to guide WAL retention.
* retention.
*/ */
LWLockAcquire(WALSummarizerLock, LW_EXCLUSIVE); LWLockAcquire(WALSummarizerLock, LW_EXCLUSIVE);
if (am_wal_summarizer|| !WalSummarizerCtl->initialized) if (am_wal_summarizer || !WalSummarizerCtl->initialized)
{ {
WalSummarizerCtl->initialized = true; WalSummarizerCtl->initialized = true;
WalSummarizerCtl->summarized_lsn = unsummarized_lsn; WalSummarizerCtl->summarized_lsn = unsummarized_lsn;