Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd231be0

Browse files
committed
Run pgindent on xlog.c.
To tidy up after some recent refactorings in xlog.c. These would befixed by the pgindent run we do at the end of the development cycle,but I want to clean these up now as I'm about to do some more bigrefactorings on xlog.c.
1 parent27d195a commitd231be0

File tree

1 file changed

+47
-47
lines changed
  • src/backend/access/transam

1 file changed

+47
-47
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ static void checkTimeLineSwitch(XLogRecPtr lsn, TimeLineID newTLI,
911911
TimeLineIDprevTLI,TimeLineIDreplayTLI);
912912
staticvoidVerifyOverwriteContrecord(xl_overwrite_contrecord*xlrec,
913913
XLogReaderState*state);
914-
staticintLocalSetXLogInsertAllowed(void);
914+
staticintLocalSetXLogInsertAllowed(void);
915915
staticvoidCreateEndOfRecoveryRecord(void);
916916
staticXLogRecPtrCreateOverwriteContrecordRecord(XLogRecPtraborted_lsn);
917917
staticvoidCheckPointGuts(XLogRecPtrcheckPointRedo,intflags);
@@ -5814,38 +5814,38 @@ CleanupAfterArchiveRecovery(TimeLineID EndOfLogTLI, XLogRecPtr EndOfLog,
58145814
* We switched to a new timeline. Clean up segments on the old timeline.
58155815
*
58165816
* If there are any higher-numbered segments on the old timeline, remove
5817-
* them. They might contain valid WAL, but they might also be pre-allocated
5818-
* files containing garbage. In any case, they are not part of the new
5819-
* timeline's history so we don't need them.
5817+
* them. They might contain valid WAL, but they might also be
5818+
*pre-allocatedfiles containing garbage. In any case, they are not part
5819+
*of the newtimeline's history so we don't need them.
58205820
*/
58215821
RemoveNonParentXlogFiles(EndOfLog,newTLI);
58225822

58235823
/*
58245824
* If the switch happened in the middle of a segment, what to do with the
58255825
* last, partial segment on the old timeline? If we don't archive it, and
5826-
* the server that created the WAL never archives it either (e.g. because it
5827-
* was hit by a meteor), it will never make it to the archive. That's OK
5828-
* from our point of view, because the new segment that we created with the
5829-
* new TLI contains all the WAL from the old timeline up to the switch
5826+
* the server that created the WAL never archives it either (e.g. because
5827+
*itwas hit by a meteor), it will never make it to the archive. That's
5828+
*OKfrom our point of view, because the new segment that we created with
5829+
*thenew TLI contains all the WAL from the old timeline up to the switch
58305830
* point. But if you later try to do PITR to the "missing" WAL on the old
5831-
* timeline, recovery won't find it in the archive. It's physically present
5832-
* in the new file with new TLI, but recovery won't look there when it's
5833-
* recovering to the older timeline. On the other hand, if we archive the
5834-
* partial segment, and the original server on that timeline is still
5835-
* running and archives the completed version of the same segment later, it
5836-
* will fail. (We used to do that in 9.4 and below, and it caused such
5837-
* problems).
5831+
* timeline, recovery won't find it in the archive. It's physically
5832+
*presentin the new file with new TLI, but recovery won't look there
5833+
*when it'srecovering to the older timeline. On the other hand, if we
5834+
*archive thepartial segment, and the original server on that timeline
5835+
*is stillrunning and archives the completed version of the same segment
5836+
*later, itwill fail. (We used to do that in 9.4 and below, and it
5837+
*caused suchproblems).
58385838
*
5839-
* As a compromise, we rename the last segment with the .partial suffix, and
5840-
* archive it. Archive recovery will never try to read .partial segments, so
5841-
* they will normally go unused. But in the odd PITR case, the administrator
5842-
* can copy them manually to the pg_wal directory (removing the suffix).
5843-
* They can be useful in debugging, too.
5839+
* As a compromise, we rename the last segment with the .partial suffix,
5840+
*andarchive it. Archive recovery will never try to read .partial
5841+
*segments, sothey will normally go unused. But in the odd PITR case,
5842+
*the administratorcan copy them manually to the pg_wal directory
5843+
*(removing the suffix).They can be useful in debugging, too.
58445844
*
58455845
* If a .done or .ready file already exists for the old timeline, however,
5846-
* we had already determined that the segment is complete, so we can let it
5847-
* be archived normally. (In particular, if it was restored from the archive
5848-
* to begin with, it's expected to have a .done file).
5846+
* we had already determined that the segment is complete, so we can let
5847+
*itbe archived normally. (In particular, if it was restored from the
5848+
*archiveto begin with, it's expected to have a .done file).
58495849
*/
58505850
if (XLogSegmentOffset(EndOfLog,wal_segment_size)!=0&&
58515851
XLogArchivingActive())
@@ -7657,10 +7657,10 @@ StartupXLOG(void)
76577657
* Before replaying this record, check if this record causes
76587658
* the current timeline to change. The record is already
76597659
* considered to be part of the new timeline, so we update
7660-
* replayTLI before replaying it. That's important so
7661-
*thatreplayEndTLI, which is recorded as the minimum
7662-
*recoverypoint's TLI if recovery stops after this record,
7663-
*is setcorrectly.
7660+
* replayTLI before replaying it. That's important so that
7661+
* replayEndTLI, which is recorded as the minimum recovery
7662+
* point's TLI if recovery stops after this record, is set
7663+
* correctly.
76647664
*/
76657665
if (record->xl_rmid==RM_XLOG_ID)
76667666
{
@@ -8166,10 +8166,10 @@ StartupXLOG(void)
81668166
* Emit checkpoint or end-of-recovery record in XLOG, if required.
81678167
*
81688168
* XLogCtl->lastReplayedEndRecPtr will be a valid LSN if and only if we
8169-
* entered recovery. Even if we ultimately replayed no WAL records, it will
8170-
* have been initialized based on where replay was due to start. We don't
8171-
* need a lock to access this, since this can't change any more by the time
8172-
* we reach this code.
8169+
* entered recovery. Even if we ultimately replayed no WAL records, it
8170+
*willhave been initialized based on where replay was due to start. We
8171+
*don'tneed a lock to access this, since this can't change any more by
8172+
*the timewe reach this code.
81738173
*/
81748174
if (!XLogRecPtrIsInvalid(XLogCtl->lastReplayedEndRecPtr))
81758175
promoted=PerformRecoveryXLogAction();
@@ -8357,15 +8357,15 @@ PerformRecoveryXLogAction(void)
83578357
/*
83588358
* Perform a checkpoint to update all our recovery activity to disk.
83598359
*
8360-
* Note that we write a shutdown checkpoint rather than an on-line one. This
8361-
* is not particularly critical, but since we may be assigning a new TLI,
8362-
* using a shutdown checkpoint allows us to have the rule that TLI only
8363-
* changes in shutdown checkpoints, which allows some extra error checking
8364-
* in xlog_redo.
8360+
* Note that we write a shutdown checkpoint rather than an on-line one.
8361+
*Thisis not particularly critical, but since we may be assigning a new
8362+
*TLI,using a shutdown checkpoint allows us to have the rule that TLI
8363+
*onlychanges in shutdown checkpoints, which allows some extra error
8364+
*checkingin xlog_redo.
83658365
*
8366-
* In promotion, only create a lightweight end-of-recovery record instead of
8367-
* a full checkpoint. A checkpoint is requested later, after we're fully out
8368-
* of recovery mode and already accepting queries.
8366+
* In promotion, only create a lightweight end-of-recovery record instead
8367+
*ofa full checkpoint. A checkpoint is requested later, after we're
8368+
*fully outof recovery mode and already accepting queries.
83698369
*/
83708370
if (ArchiveRecoveryRequested&&IsUnderPostmaster&&
83718371
LocalPromoteIsTriggered)
@@ -8375,11 +8375,11 @@ PerformRecoveryXLogAction(void)
83758375
/*
83768376
* Insert a special WAL record to mark the end of recovery, since we
83778377
* aren't doing a checkpoint. That means that the checkpointer process
8378-
* may likely be in the middle of a time-smoothed restartpoint and could
8379-
* continue to be for minutes after this. That sounds strange, but the
8380-
* effect is roughly the same and it would be stranger to try to come
8381-
* out of the restartpoint and then checkpoint. We request a checkpoint
8382-
* later anyway, just for safety.
8378+
* may likely be in the middle of a time-smoothed restartpoint and
8379+
*couldcontinue to be for minutes after this. That sounds strange,
8380+
*but theeffect is roughly the same and it would be stranger to try
8381+
*to comeout of the restartpoint and then checkpoint. We request a
8382+
*checkpointlater anyway, just for safety.
83838383
*/
83848384
CreateEndOfRecoveryRecord();
83858385
}
@@ -8531,7 +8531,7 @@ XLogInsertAllowed(void)
85318531
staticint
85328532
LocalSetXLogInsertAllowed(void)
85338533
{
8534-
intoldXLogAllowed=LocalXLogInsertAllowed;
8534+
intoldXLogAllowed=LocalXLogInsertAllowed;
85358535

85368536
LocalXLogInsertAllowed=1;
85378537

@@ -8718,8 +8718,8 @@ GetFlushRecPtr(TimeLineID *insertTLI)
87188718
SpinLockRelease(&XLogCtl->info_lck);
87198719

87208720
/*
8721-
* If we're writing and flushing WAL, the time line can't be changing,
8722-
*sono lock is required.
8721+
* If we're writing and flushing WAL, the time line can't be changing, so
8722+
* no lock is required.
87238723
*/
87248724
if (insertTLI)
87258725
*insertTLI=XLogCtl->InsertTimeLineID;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp