mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Remove tabs after spaces in C comments
This was not changed in HEAD, but will be done later as part of a pgindent run. Future pgindent runs will also do this. Report by Tom Lane Backpatch through all supported branches, but not HEAD
This commit is contained in:
@ -94,7 +94,7 @@ bool XLOG_DEBUG = false;
|
||||
* future XLOG segment as long as there aren't already XLOGfileslop future
|
||||
* segments; else we'll delete it. This could be made a separate GUC
|
||||
* variable, but at present I think it's sufficient to hardwire it as
|
||||
* 2*CheckPointSegments+1. Under normal conditions, a checkpoint will free
|
||||
* 2*CheckPointSegments+1. Under normal conditions, a checkpoint will free
|
||||
* no more than 2*CheckPointSegments log segments, and we want to recycle all
|
||||
* of them; the +1 allows boundary cases to happen without wasting a
|
||||
* delete/create-segment cycle.
|
||||
@ -183,7 +183,7 @@ static bool LocalHotStandbyActive = false;
|
||||
* 0: unconditionally not allowed to insert XLOG
|
||||
* -1: must check RecoveryInProgress(); disallow until it is false
|
||||
* Most processes start with -1 and transition to 1 after seeing that recovery
|
||||
* is not in progress. But we can also force the value for special cases.
|
||||
* is not in progress. But we can also force the value for special cases.
|
||||
* The coding in XLogInsertAllowed() depends on the first two of these states
|
||||
* being numerically the same as bool true and false.
|
||||
*/
|
||||
@ -248,7 +248,7 @@ static bool recoveryStopAfter;
|
||||
*
|
||||
* expectedTLEs: a list of TimeLineHistoryEntries for recoveryTargetTLI and the timelines of
|
||||
* its known parents, newest first (so recoveryTargetTLI is always the
|
||||
* first list member). Only these TLIs are expected to be seen in the WAL
|
||||
* first list member). Only these TLIs are expected to be seen in the WAL
|
||||
* segments we read, and indeed only these TLIs will be considered as
|
||||
* candidate WAL files to open at all.
|
||||
*
|
||||
@ -277,9 +277,9 @@ XLogRecPtr XactLastRecEnd = InvalidXLogRecPtr;
|
||||
/*
|
||||
* RedoRecPtr is this backend's local copy of the REDO record pointer
|
||||
* (which is almost but not quite the same as a pointer to the most recent
|
||||
* CHECKPOINT record). We update this from the shared-memory copy,
|
||||
* CHECKPOINT record). We update this from the shared-memory copy,
|
||||
* XLogCtl->Insert.RedoRecPtr, whenever we can safely do so (ie, when we
|
||||
* hold the Insert lock). See XLogInsert for details. We are also allowed
|
||||
* hold the Insert lock). See XLogInsert for details. We are also allowed
|
||||
* to update from XLogCtl->Insert.RedoRecPtr if we hold the info_lck;
|
||||
* see GetRedoRecPtr. A freshly spawned backend obtains the value during
|
||||
* InitXLOGAccess.
|
||||
@ -1428,10 +1428,10 @@ AdvanceXLInsertBuffer(bool new_segment)
|
||||
* WAL records beginning in this page have removable backup blocks. This
|
||||
* allows the WAL archiver to know whether it is safe to compress archived
|
||||
* WAL data by transforming full-block records into the non-full-block
|
||||
* format. It is sufficient to record this at the page level because we
|
||||
* format. It is sufficient to record this at the page level because we
|
||||
* force a page switch (in fact a segment switch) when starting a backup,
|
||||
* so the flag will be off before any records can be written during the
|
||||
* backup. At the end of a backup, the last page will be marked as all
|
||||
* backup. At the end of a backup, the last page will be marked as all
|
||||
* unsafe when perhaps only part is unsafe, but at worst the archiver
|
||||
* would miss the opportunity to compress a few records.
|
||||
*/
|
||||
@ -1711,7 +1711,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
|
||||
{
|
||||
/*
|
||||
* Could get here without iterating above loop, in which case we might
|
||||
* have no open file or the wrong one. However, we do not need to
|
||||
* have no open file or the wrong one. However, we do not need to
|
||||
* fsync more than one file.
|
||||
*/
|
||||
if (sync_method != SYNC_METHOD_OPEN &&
|
||||
@ -1780,7 +1780,7 @@ XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN)
|
||||
|
||||
/*
|
||||
* If the WALWriter is sleeping, we should kick it to make it come out of
|
||||
* low-power mode. Otherwise, determine whether there's a full page of
|
||||
* low-power mode. Otherwise, determine whether there's a full page of
|
||||
* WAL available to write.
|
||||
*/
|
||||
if (!sleeping)
|
||||
@ -2058,9 +2058,9 @@ XLogFlush(XLogRecPtr record)
|
||||
* We normally flush only completed blocks; but if there is nothing to do on
|
||||
* that basis, we check for unflushed async commits in the current incomplete
|
||||
* block, and flush through the latest one of those. Thus, if async commits
|
||||
* are not being used, we will flush complete blocks only. We can guarantee
|
||||
* are not being used, we will flush complete blocks only. We can guarantee
|
||||
* that async commits reach disk after at most three cycles; normally only
|
||||
* one or two. (When flushing complete blocks, we allow XLogWrite to write
|
||||
* one or two. (When flushing complete blocks, we allow XLogWrite to write
|
||||
* "flexibly", meaning it can stop at the end of the buffer ring; this makes a
|
||||
* difference only with very high load or long wal_writer_delay, but imposes
|
||||
* one extra cycle for the worst case for async commits.)
|
||||
@ -2228,7 +2228,7 @@ XLogNeedsFlush(XLogRecPtr record)
|
||||
* log, seg: identify segment to be created/opened.
|
||||
*
|
||||
* *use_existent: if TRUE, OK to use a pre-existing file (else, any
|
||||
* pre-existing file will be deleted). On return, TRUE if a pre-existing
|
||||
* pre-existing file will be deleted). On return, TRUE if a pre-existing
|
||||
* file was used.
|
||||
*
|
||||
* use_lock: if TRUE, acquire ControlFileLock while moving file into
|
||||
@ -2295,11 +2295,11 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
|
||||
errmsg("could not create file \"%s\": %m", tmppath)));
|
||||
|
||||
/*
|
||||
* Zero-fill the file. We have to do this the hard way to ensure that all
|
||||
* Zero-fill the file. We have to do this the hard way to ensure that all
|
||||
* the file space has really been allocated --- on platforms that allow
|
||||
* "holes" in files, just seeking to the end doesn't allocate intermediate
|
||||
* space. This way, we know that we have all the space and (after the
|
||||
* fsync below) that all the indirect blocks are down on disk. Therefore,
|
||||
* fsync below) that all the indirect blocks are down on disk. Therefore,
|
||||
* fdatasync(2) or O_DSYNC will be sufficient to sync future writes to the
|
||||
* log file.
|
||||
*
|
||||
@ -2391,7 +2391,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
|
||||
* a different timeline)
|
||||
*
|
||||
* Currently this is only used during recovery, and so there are no locking
|
||||
* considerations. But we should be just as tense as XLogFileInit to avoid
|
||||
* considerations. But we should be just as tense as XLogFileInit to avoid
|
||||
* emplacing a bogus file.
|
||||
*/
|
||||
static void
|
||||
@ -2709,13 +2709,13 @@ XLogFileReadAnyTLI(XLogSegNo segno, int emode, int source)
|
||||
* the timelines listed in expectedTLEs.
|
||||
*
|
||||
* We expect curFileTLI on entry to be the TLI of the preceding file in
|
||||
* sequence, or 0 if there was no predecessor. We do not allow curFileTLI
|
||||
* sequence, or 0 if there was no predecessor. We do not allow curFileTLI
|
||||
* to go backwards; this prevents us from picking up the wrong file when a
|
||||
* parent timeline extends to higher segment numbers than the child we
|
||||
* want to read.
|
||||
*
|
||||
* If we haven't read the timeline history file yet, read it now, so that
|
||||
* we know which TLIs to scan. We don't save the list in expectedTLEs,
|
||||
* we know which TLIs to scan. We don't save the list in expectedTLEs,
|
||||
* however, unless we actually find a valid segment. That way if there is
|
||||
* neither a timeline history file nor a WAL segment in the archive, and
|
||||
* streaming replication is set up, we'll read the timeline history file
|
||||
@ -2779,7 +2779,7 @@ XLogFileClose(void)
|
||||
|
||||
/*
|
||||
* WAL segment files will not be re-read in normal operation, so we advise
|
||||
* the OS to release any cached pages. But do not do so if WAL archiving
|
||||
* the OS to release any cached pages. But do not do so if WAL archiving
|
||||
* or streaming is active, because archiver and walsender process could
|
||||
* use the cache to read the WAL segment.
|
||||
*/
|
||||
@ -2924,7 +2924,7 @@ RemoveOldXlogFiles(XLogSegNo segno, XLogRecPtr endptr)
|
||||
{
|
||||
/*
|
||||
* We ignore the timeline part of the XLOG segment identifiers in
|
||||
* deciding whether a segment is still needed. This ensures that we
|
||||
* deciding whether a segment is still needed. This ensures that we
|
||||
* won't prematurely remove a segment from a parent timeline. We could
|
||||
* probably be a little more proactive about removing segments of
|
||||
* non-parent timelines, but that would be a whole lot more
|
||||
@ -3458,7 +3458,7 @@ rescanLatestTimeLine(void)
|
||||
* I/O routines for pg_control
|
||||
*
|
||||
* *ControlFile is a buffer in shared memory that holds an image of the
|
||||
* contents of pg_control. WriteControlFile() initializes pg_control
|
||||
* contents of pg_control. WriteControlFile() initializes pg_control
|
||||
* given a preloaded buffer, ReadControlFile() loads the buffer from
|
||||
* the pg_control file (during postmaster or standalone-backend startup),
|
||||
* and UpdateControlFile() rewrites pg_control after we modify xlog state.
|
||||
@ -3863,7 +3863,7 @@ check_wal_buffers(int *newval, void **extra, GucSource source)
|
||||
{
|
||||
/*
|
||||
* If we haven't yet changed the boot_val default of -1, just let it
|
||||
* be. We'll fix it when XLOGShmemSize is called.
|
||||
* be. We'll fix it when XLOGShmemSize is called.
|
||||
*/
|
||||
if (XLOGbuffers == -1)
|
||||
return true;
|
||||
@ -4367,7 +4367,7 @@ readRecoveryCommandFile(void)
|
||||
|
||||
/*
|
||||
* If user specified recovery_target_timeline, validate it or compute the
|
||||
* "latest" value. We can't do this until after we've gotten the restore
|
||||
* "latest" value. We can't do this until after we've gotten the restore
|
||||
* command and set InArchiveRecovery, because we need to fetch timeline
|
||||
* history files from the archive.
|
||||
*/
|
||||
@ -4926,7 +4926,7 @@ StartupXLOG(void)
|
||||
ValidateXLOGDirectoryStructure();
|
||||
|
||||
/*
|
||||
* Clear out any old relcache cache files. This is *necessary* if we do
|
||||
* Clear out any old relcache cache files. This is *necessary* if we do
|
||||
* any WAL replay, since that would probably result in the cache files
|
||||
* being out of sync with database reality. In theory we could leave them
|
||||
* in place if the database had been cleanly shut down, but it seems
|
||||
@ -5805,8 +5805,8 @@ StartupXLOG(void)
|
||||
/*
|
||||
* Consider whether we need to assign a new timeline ID.
|
||||
*
|
||||
* If we are doing an archive recovery, we always assign a new ID. This
|
||||
* handles a couple of issues. If we stopped short of the end of WAL
|
||||
* If we are doing an archive recovery, we always assign a new ID. This
|
||||
* handles a couple of issues. If we stopped short of the end of WAL
|
||||
* during recovery, then we are clearly generating a new timeline and must
|
||||
* assign it a unique new ID. Even if we ran to the end, modifying the
|
||||
* current last segment is problematic because it may result in trying to
|
||||
@ -5879,7 +5879,7 @@ StartupXLOG(void)
|
||||
|
||||
/*
|
||||
* Tricky point here: readBuf contains the *last* block that the LastRec
|
||||
* record spans, not the one it starts in. The last block is indeed the
|
||||
* record spans, not the one it starts in. The last block is indeed the
|
||||
* one we want to use.
|
||||
*/
|
||||
if (EndOfLog % XLOG_BLCKSZ == 0)
|
||||
@ -5915,7 +5915,7 @@ StartupXLOG(void)
|
||||
* Write.curridx must point to the *next* page (see XLogWrite()).
|
||||
*
|
||||
* Note: it might seem we should do AdvanceXLInsertBuffer() here, but
|
||||
* this is sufficient. The first actual attempt to insert a log
|
||||
* this is sufficient. The first actual attempt to insert a log
|
||||
* record will advance the insert state.
|
||||
*/
|
||||
XLogCtl->Write.curridx = NextBufIdx(0);
|
||||
@ -6094,7 +6094,7 @@ StartupXLOG(void)
|
||||
XLogReportParameters();
|
||||
|
||||
/*
|
||||
* All done. Allow backends to write WAL. (Although the bool flag is
|
||||
* All done. Allow backends to write WAL. (Although the bool flag is
|
||||
* probably atomic in itself, we use the info_lck here to ensure that
|
||||
* there are no race conditions concerning visibility of other recent
|
||||
* updates to shared memory.)
|
||||
@ -6254,7 +6254,7 @@ RecoveryInProgress(void)
|
||||
/*
|
||||
* Initialize TimeLineID and RedoRecPtr when we discover that recovery
|
||||
* is finished. InitPostgres() relies upon this behaviour to ensure
|
||||
* that InitXLOGAccess() is called at backend startup. (If you change
|
||||
* that InitXLOGAccess() is called at backend startup. (If you change
|
||||
* this, see also LocalSetXLogInsertAllowed.)
|
||||
*/
|
||||
if (!LocalRecoveryInProgress)
|
||||
@ -6886,7 +6886,7 @@ CreateCheckPoint(int flags)
|
||||
/*
|
||||
* If this isn't a shutdown or forced checkpoint, and we have not inserted
|
||||
* any XLOG records since the start of the last checkpoint, skip the
|
||||
* checkpoint. The idea here is to avoid inserting duplicate checkpoints
|
||||
* checkpoint. The idea here is to avoid inserting duplicate checkpoints
|
||||
* when the system is idle. That wastes log space, and more importantly it
|
||||
* exposes us to possible loss of both current and previous checkpoint
|
||||
* records if the machine crashes just as we're writing the update.
|
||||
@ -6991,7 +6991,7 @@ CreateCheckPoint(int flags)
|
||||
* performing those groups of actions.
|
||||
*
|
||||
* One example is end of transaction, so we must wait for any transactions
|
||||
* that are currently in commit critical sections. If an xact inserted
|
||||
* that are currently in commit critical sections. If an xact inserted
|
||||
* its commit record into XLOG just before the REDO point, then a crash
|
||||
* restart from the REDO point would not replay that record, which means
|
||||
* that our flushing had better include the xact's update of pg_clog. So
|
||||
@ -7186,9 +7186,9 @@ CreateCheckPoint(int flags)
|
||||
|
||||
/*
|
||||
* Truncate pg_subtrans if possible. We can throw away all data before
|
||||
* the oldest XMIN of any running transaction. No future transaction will
|
||||
* the oldest XMIN of any running transaction. No future transaction will
|
||||
* attempt to reference any pg_subtrans entry older than that (see Asserts
|
||||
* in subtrans.c). During recovery, though, we mustn't do this because
|
||||
* in subtrans.c). During recovery, though, we mustn't do this because
|
||||
* StartupSUBTRANS hasn't been called yet.
|
||||
*/
|
||||
if (!RecoveryInProgress())
|
||||
@ -7558,9 +7558,9 @@ CreateRestartPoint(int flags)
|
||||
|
||||
/*
|
||||
* Truncate pg_subtrans if possible. We can throw away all data before
|
||||
* the oldest XMIN of any running transaction. No future transaction will
|
||||
* the oldest XMIN of any running transaction. No future transaction will
|
||||
* attempt to reference any pg_subtrans entry older than that (see Asserts
|
||||
* in subtrans.c). When hot standby is disabled, though, we mustn't do
|
||||
* in subtrans.c). When hot standby is disabled, though, we mustn't do
|
||||
* this because StartupSUBTRANS hasn't been called yet.
|
||||
*/
|
||||
if (EnableHotStandby)
|
||||
@ -7633,7 +7633,7 @@ XLogPutNextOid(Oid nextOid)
|
||||
* We need not flush the NEXTOID record immediately, because any of the
|
||||
* just-allocated OIDs could only reach disk as part of a tuple insert or
|
||||
* update that would have its own XLOG record that must follow the NEXTOID
|
||||
* record. Therefore, the standard buffer LSN interlock applied to those
|
||||
* record. Therefore, the standard buffer LSN interlock applied to those
|
||||
* records will ensure no such OID reaches disk before the NEXTOID record
|
||||
* does.
|
||||
*
|
||||
@ -7969,7 +7969,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
|
||||
/*
|
||||
* We used to try to take the maximum of ShmemVariableCache->nextOid
|
||||
* and the recorded nextOid, but that fails if the OID counter wraps
|
||||
* around. Since no OID allocation should be happening during replay
|
||||
* around. Since no OID allocation should be happening during replay
|
||||
* anyway, better to just believe the record exactly. We still take
|
||||
* OidGenLock while setting the variable, just in case.
|
||||
*/
|
||||
@ -8310,7 +8310,7 @@ get_sync_bit(int method)
|
||||
|
||||
/*
|
||||
* Optimize writes by bypassing kernel cache with O_DIRECT when using
|
||||
* O_SYNC/O_FSYNC and O_DSYNC. But only if archiving and streaming are
|
||||
* O_SYNC/O_FSYNC and O_DSYNC. But only if archiving and streaming are
|
||||
* disabled, otherwise the archive command or walsender process will read
|
||||
* the WAL soon after writing it, which is guaranteed to cause a physical
|
||||
* read if we bypassed the kernel cache. We also skip the
|
||||
@ -8514,7 +8514,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
|
||||
* during an on-line backup even if not doing so at other times, because
|
||||
* it's quite possible for the backup dump to obtain a "torn" (partially
|
||||
* written) copy of a database page if it reads the page concurrently with
|
||||
* our write to the same page. This can be fixed as long as the first
|
||||
* our write to the same page. This can be fixed as long as the first
|
||||
* write to the page in the WAL sequence is a full-page write. Hence, we
|
||||
* turn on forcePageWrites and then force a CHECKPOINT, to ensure there
|
||||
* are no dirty pages in shared memory that might get dumped while the
|
||||
@ -8558,7 +8558,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
|
||||
* old timeline IDs. That would otherwise happen if you called
|
||||
* pg_start_backup() right after restoring from a PITR archive: the
|
||||
* first WAL segment containing the startup checkpoint has pages in
|
||||
* the beginning with the old timeline ID. That can cause trouble at
|
||||
* the beginning with the old timeline ID. That can cause trouble at
|
||||
* recovery: we won't have a history file covering the old timeline if
|
||||
* pg_xlog directory was not included in the base backup and the WAL
|
||||
* archive was cleared too before starting the backup.
|
||||
@ -8581,7 +8581,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
|
||||
bool checkpointfpw;
|
||||
|
||||
/*
|
||||
* Force a CHECKPOINT. Aside from being necessary to prevent torn
|
||||
* Force a CHECKPOINT. Aside from being necessary to prevent torn
|
||||
* page problems, this guarantees that two successive backup runs
|
||||
* will have different checkpoint positions and hence different
|
||||
* history file names, even if nothing happened in between.
|
||||
@ -9234,7 +9234,7 @@ GetOldestRestartPoint(XLogRecPtr *oldrecptr, TimeLineID *oldtli)
|
||||
*
|
||||
* If we see a backup_label during recovery, we assume that we are recovering
|
||||
* from a backup dump file, and we therefore roll forward from the checkpoint
|
||||
* identified by the label file, NOT what pg_control says. This avoids the
|
||||
* identified by the label file, NOT what pg_control says. This avoids the
|
||||
* problem that pg_control might have been archived one or more checkpoints
|
||||
* later than the start of the dump, and so if we rely on it as the start
|
||||
* point, we will fail to restore a consistent database state.
|
||||
@ -9839,11 +9839,11 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
||||
if (havedata)
|
||||
{
|
||||
/*
|
||||
* Great, streamed far enough. Open the file if it's
|
||||
* Great, streamed far enough. Open the file if it's
|
||||
* not open already. Also read the timeline history
|
||||
* file if we haven't initialized timeline history
|
||||
* yet; it should be streamed over and present in
|
||||
* pg_xlog by now. Use XLOG_FROM_STREAM so that
|
||||
* pg_xlog by now. Use XLOG_FROM_STREAM so that
|
||||
* source info is set correctly and XLogReceiptTime
|
||||
* isn't changed.
|
||||
*/
|
||||
@ -9916,9 +9916,9 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
||||
* in the current WAL page, previously read by XLogPageRead().
|
||||
*
|
||||
* 'emode' is the error mode that would be used to report a file-not-found
|
||||
* or legitimate end-of-WAL situation. Generally, we use it as-is, but if
|
||||
* or legitimate end-of-WAL situation. Generally, we use it as-is, but if
|
||||
* we're retrying the exact same record that we've tried previously, only
|
||||
* complain the first time to keep the noise down. However, we only do when
|
||||
* complain the first time to keep the noise down. However, we only do when
|
||||
* reading from pg_xlog, because we don't expect any invalid records in archive
|
||||
* or in records streamed from master. Files in the archive should be complete,
|
||||
* and we should never hit the end of WAL because we stop and wait for more WAL
|
||||
|
Reference in New Issue
Block a user