1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-28 11:44:57 +03:00

Pre-beta mechanical code beautification.

Run pgindent, pgperltidy, and reformat-dat-files.
I manually fixed a couple of comments that pgindent uglified.
This commit is contained in:
Tom Lane
2022-05-12 15:17:30 -04:00
parent 93909599cd
commit 23e7b38bfe
287 changed files with 5193 additions and 3549 deletions

View File

@@ -38,7 +38,7 @@
#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask,decode) \
{ name, redo, desc, identify, startup, cleanup, mask, decode },
RmgrData RmgrTable[RM_MAX_ID + 1] = {
RmgrData RmgrTable[RM_MAX_ID + 1] = {
#include "access/rmgrlist.h"
};
@@ -125,8 +125,8 @@ RegisterCustomRmgr(RmgrId rmid, RmgrData *rmgr)
if (!pg_strcasecmp(RmgrTable[existing_rmid].rm_name, rmgr->rm_name))
ereport(ERROR,
(errmsg("failed to register custom resource manager \"%s\" with ID %d", rmgr->rm_name, rmid),
errdetail("Existing resource manager with ID %d has the same name.", existing_rmid)));
(errmsg("failed to register custom resource manager \"%s\" with ID %d", rmgr->rm_name, rmid),
errdetail("Existing resource manager with ID %d has the same name.", existing_rmid)));
}
/* register it */

View File

@@ -1119,7 +1119,7 @@ StartPrepare(GlobalTransaction gxact)
if (hdr.nabortstats > 0)
{
save_state_data(abortstats,
hdr.nabortstats * sizeof(xl_xact_stats_item));
hdr.nabortstats * sizeof(xl_xact_stats_item));
pfree(abortstats);
}
if (hdr.ninvalmsgs > 0)
@@ -1529,9 +1529,9 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
bufptr += MAXALIGN(hdr->ncommitrels * sizeof(RelFileNode));
abortrels = (RelFileNode *) bufptr;
bufptr += MAXALIGN(hdr->nabortrels * sizeof(RelFileNode));
commitstats = (xl_xact_stats_item*) bufptr;
commitstats = (xl_xact_stats_item *) bufptr;
bufptr += MAXALIGN(hdr->ncommitstats * sizeof(xl_xact_stats_item));
abortstats = (xl_xact_stats_item*) bufptr;
abortstats = (xl_xact_stats_item *) bufptr;
bufptr += MAXALIGN(hdr->nabortstats * sizeof(xl_xact_stats_item));
invalmsgs = (SharedInvalidationMessage *) bufptr;
bufptr += MAXALIGN(hdr->ninvalmsgs * sizeof(SharedInvalidationMessage));

View File

@@ -435,10 +435,10 @@ typedef struct XLogCtlInsert
bool fullPageWrites;
/*
* runningBackups is a counter indicating the number of backups currently in
* progress. forcePageWrites is set to true when runningBackups is non-zero.
* lastBackupStart is the latest checkpoint redo location used as a starting
* point for an online backup.
* runningBackups is a counter indicating the number of backups currently
* in progress. forcePageWrites is set to true when runningBackups is
* non-zero. lastBackupStart is the latest checkpoint redo location used
* as a starting point for an online backup.
*/
int runningBackups;
XLogRecPtr lastBackupStart;
@@ -5307,14 +5307,14 @@ StartupXLOG(void)
* When recovering from a backup (we are in recovery, and archive recovery
* was requested), complain if we did not roll forward far enough to reach
* the point where the database is consistent. For regular online
* backup-from-primary, that means reaching the end-of-backup WAL record (at
* which point we reset backupStartPoint to be Invalid), for
* backup-from-primary, that means reaching the end-of-backup WAL record
* (at which point we reset backupStartPoint to be Invalid), for
* backup-from-replica (which can't inject records into the WAL stream),
* that point is when we reach the minRecoveryPoint in pg_control (which
* we purposfully copy last when backing up from a replica). For pg_rewind
* (which creates a backup_label with a method of "pg_rewind") or
* snapshot-style backups (which don't), backupEndRequired will be set to
* false.
* we purposefully copy last when backing up from a replica). For
* pg_rewind (which creates a backup_label with a method of "pg_rewind")
* or snapshot-style backups (which don't), backupEndRequired will be set
* to false.
*
* Note: it is indeed okay to look at the local variable
* LocalMinRecoveryPoint here, even though ControlFile->minRecoveryPoint
@@ -5328,8 +5328,8 @@ StartupXLOG(void)
/*
* Ran off end of WAL before reaching end-of-backup WAL record, or
* minRecoveryPoint. That's a bad sign, indicating that you tried to
* recover from an online backup but never called pg_backup_stop(),
* or you didn't archive all the WAL needed.
* recover from an online backup but never called pg_backup_stop(), or
* you didn't archive all the WAL needed.
*/
if (ArchiveRecoveryRequested || ControlFile->backupEndRequired)
{
@@ -8481,8 +8481,8 @@ do_pg_backup_stop(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
WALInsertLockAcquireExclusive();
/*
* It is expected that each do_pg_backup_start() call is matched by exactly
* one do_pg_backup_stop() call.
* It is expected that each do_pg_backup_start() call is matched by
* exactly one do_pg_backup_stop() call.
*/
Assert(XLogCtl->Insert.runningBackups > 0);
XLogCtl->Insert.runningBackups--;

View File

@@ -497,15 +497,15 @@ XLogArchiveNotify(const char *xlog)
}
/*
* Timeline history files are given the highest archival priority to
* lower the chance that a promoted standby will choose a timeline that
* is already in use. However, the archiver ordinarily tries to gather
* Timeline history files are given the highest archival priority to lower
* the chance that a promoted standby will choose a timeline that is
* already in use. However, the archiver ordinarily tries to gather
* multiple files to archive from each scan of the archive_status
* directory, which means that newly created timeline history files
* could be left unarchived for a while. To ensure that the archiver
* picks up timeline history files as soon as possible, we force the
* archiver to scan the archive_status directory the next time it looks
* for a file to archive.
* directory, which means that newly created timeline history files could
* be left unarchived for a while. To ensure that the archiver picks up
* timeline history files as soon as possible, we force the archiver to
* scan the archive_status directory the next time it looks for a file to
* archive.
*/
if (IsTLHistoryFileName(xlog))
PgArchForceDirScan();

View File

@@ -74,8 +74,8 @@ pg_backup_start(PG_FUNCTION_ARGS)
errmsg("a backup is already in progress in this session")));
/*
* Label file and tablespace map file need to be long-lived, since
* they are read in pg_backup_stop.
* Label file and tablespace map file need to be long-lived, since they
* are read in pg_backup_stop.
*/
oldcontext = MemoryContextSwitchTo(TopMemoryContext);
label_file = makeStringInfo();
@@ -127,8 +127,8 @@ pg_backup_stop(PG_FUNCTION_ARGS)
errhint("Did you call pg_backup_start()?")));
/*
* Stop the backup. Return a copy of the backup label and tablespace map so
* they can be written to disk by the caller.
* Stop the backup. Return a copy of the backup label and tablespace map
* so they can be written to disk by the caller.
*/
stoppoint = do_pg_backup_stop(label_file->data, waitforarchive, NULL);

View File

@@ -1205,9 +1205,9 @@ read_backup_label(XLogRecPtr *checkPointLoc, TimeLineID *backupLabelTLI,
* method was used) or if this label came from somewhere else (the only
* other option today being from pg_rewind). If this was a streamed
* backup then we know that we need to play through until we get to the
* end of the WAL which was generated during the backup (at which point
* we will have reached consistency and backupEndRequired will be reset
* to be false).
* end of the WAL which was generated during the backup (at which point we
* will have reached consistency and backupEndRequired will be reset to be
* false).
*/
if (fscanf(lfp, "BACKUP METHOD: %19s\n", backuptype) == 1)
{
@@ -2055,10 +2055,9 @@ CheckRecoveryConsistency(void)
/*
* Have we passed our safe starting point? Note that minRecoveryPoint is
* known to be incorrectly set if recovering from a backup, until
* the XLOG_BACKUP_END arrives to advise us of the correct
* minRecoveryPoint. All we know prior to that is that we're not
* consistent yet.
* known to be incorrectly set if recovering from a backup, until the
* XLOG_BACKUP_END arrives to advise us of the correct minRecoveryPoint.
* All we know prior to that is that we're not consistent yet.
*/
if (!reachedConsistency && !backupEndRequired &&
minRecoveryPoint <= lastReplayedEndRecPtr)
@@ -3802,7 +3801,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
HandleStartupProcInterrupts();
}
return XLREAD_FAIL; /* not reached */
return XLREAD_FAIL; /* not reached */
}

View File

@@ -22,7 +22,7 @@ void
XLogRecGetLen(XLogReaderState *record, uint32 *rec_len,
uint32 *fpi_len)
{
int block_id;
int block_id;
/*
* Calculate the amount of FPI data in the record.
@@ -53,10 +53,10 @@ XLogRecGetLen(XLogReaderState *record, uint32 *rec_len,
void
XLogRecStoreStats(XLogStats *stats, XLogReaderState *record)
{
RmgrId rmid;
uint8 recid;
uint32 rec_len;
uint32 fpi_len;
RmgrId rmid;
uint8 recid;
uint32 rec_len;
uint32 fpi_len;
Assert(stats != NULL && record != NULL);

View File

@@ -80,10 +80,9 @@ typedef struct xl_invalid_page
static HTAB *invalid_page_tab = NULL;
static int
read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
int reqLen, XLogRecPtr targetRecPtr,
char *cur_page, bool wait_for_wal);
static int read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
int reqLen, XLogRecPtr targetRecPtr,
char *cur_page, bool wait_for_wal);
/* Report a reference to an invalid page */
static void
@@ -940,8 +939,8 @@ read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
* archive in the timeline will get renamed to .partial by
* StartupXLOG().
*
* If that happens after our caller determined the TLI but before
* we actually read the xlog page, we might still try to read from the
* If that happens after our caller determined the TLI but before we
* actually read the xlog page, we might still try to read from the
* old (now renamed) segment and fail. There's not much we can do
* about this, but it can only happen when we're a leaf of a cascading
* standby whose primary gets promoted while we're decoding, so a
@@ -965,7 +964,7 @@ read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
* end of WAL has been reached.
*/
private_data = (ReadLocalXLogPageNoWaitPrivate *)
state->private_data;
state->private_data;
private_data->end_of_wal = true;
break;
}