1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

pgindent run for 9.6

This commit is contained in:
Robert Haas
2016-06-09 18:02:36 -04:00
parent 9164deea2f
commit 4bc424b968
252 changed files with 2670 additions and 2558 deletions

View File

@@ -117,8 +117,8 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
TimeLineID starttli;
XLogRecPtr endptr;
TimeLineID endtli;
StringInfo labelfile;
StringInfo tblspc_map_file = NULL;
StringInfo labelfile;
StringInfo tblspc_map_file = NULL;
int datadirpathlen;
List *tablespaces = NIL;

View File

@@ -330,7 +330,7 @@ DecodeStandbyOp(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
case XLOG_INVALIDATIONS:
{
xl_invalidations *invalidations =
(xl_invalidations *) XLogRecGetData(r);
(xl_invalidations *) XLogRecGetData(r);
ReorderBufferImmediateInvalidation(
ctx->reorder, invalidations->nmsgs, invalidations->msgs);
@@ -488,12 +488,12 @@ FilterByOrigin(LogicalDecodingContext *ctx, RepOriginId origin_id)
static void
DecodeLogicalMsgOp(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
{
SnapBuild *builder = ctx->snapshot_builder;
SnapBuild *builder = ctx->snapshot_builder;
XLogReaderState *r = buf->record;
TransactionId xid = XLogRecGetXid(r);
uint8 info = XLogRecGetInfo(r) & ~XLR_INFO_MASK;
RepOriginId origin_id = XLogRecGetOrigin(r);
Snapshot snapshot;
TransactionId xid = XLogRecGetXid(r);
uint8 info = XLogRecGetInfo(r) & ~XLR_INFO_MASK;
RepOriginId origin_id = XLogRecGetOrigin(r);
Snapshot snapshot;
xl_logical_message *message;
if (info != XLOG_LOGICAL_MESSAGE)
@@ -522,7 +522,8 @@ DecodeLogicalMsgOp(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
snapshot = SnapBuildGetOrBuildSnapshot(builder, xid);
ReorderBufferQueueMessage(ctx->reorder, xid, snapshot, buf->endptr,
message->transactional,
message->message, /* first part of message is prefix */
message->message, /* first part of message is
* prefix */
message->message_size,
message->message + message->prefix_size);
}
@@ -536,8 +537,8 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
xl_xact_parsed_commit *parsed, TransactionId xid)
{
XLogRecPtr origin_lsn = InvalidXLogRecPtr;
TimestampTz commit_time = parsed->xact_time;
RepOriginId origin_id = XLogRecGetOrigin(buf->record);
TimestampTz commit_time = parsed->xact_time;
RepOriginId origin_id = XLogRecGetOrigin(buf->record);
int i;
if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)

View File

@@ -63,8 +63,8 @@ static void commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
static void change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
Relation relation, ReorderBufferChange *change);
static void message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
XLogRecPtr message_lsn, bool transactional,
const char *prefix, Size message_size, const char *message);
XLogRecPtr message_lsn, bool transactional,
const char *prefix, Size message_size, const char *message);
static void LoadOutputPlugin(OutputPluginCallbacks *callbacks, char *plugin);

View File

@@ -51,7 +51,7 @@ XLogRecPtr
LogLogicalMessage(const char *prefix, const char *message, size_t size,
bool transactional)
{
xl_logical_message xlrec;
xl_logical_message xlrec;
/*
* Force xid to be allocated if we're emitting a transactional message.
@@ -87,7 +87,7 @@ logicalmsg_redo(XLogReaderState *record)
uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
if (info != XLOG_LOGICAL_MESSAGE)
elog(PANIC, "logicalmsg_redo: unknown op code %u", info);
elog(PANIC, "logicalmsg_redo: unknown op code %u", info);
/* This is only interesting for logical decoding, see decode.c. */
}

View File

@@ -148,7 +148,7 @@ typedef struct ReplicationStateCtl
} ReplicationStateCtl;
/* external variables */
RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
RepOriginId replorigin_session_origin = InvalidRepOriginId; /* assumed identity */
XLogRecPtr replorigin_session_origin_lsn = InvalidXLogRecPtr;
TimestampTz replorigin_session_origin_timestamp = 0;

View File

@@ -666,8 +666,8 @@ ReorderBufferQueueMessage(ReorderBuffer *rb, TransactionId xid,
}
else
{
ReorderBufferTXN *txn = NULL;
volatile Snapshot snapshot_now = snapshot;
ReorderBufferTXN *txn = NULL;
volatile Snapshot snapshot_now = snapshot;
if (xid != InvalidTransactionId)
txn = ReorderBufferTXNByXid(rb, xid, true, NULL, lsn, true);
@@ -1836,10 +1836,10 @@ ReorderBufferImmediateInvalidation(ReorderBuffer *rb, uint32 ninvalidations,
BeginInternalSubTransaction("replay");
/*
* Force invalidations to happen outside of a valid transaction - that
* way entries will just be marked as invalid without accessing the
* catalog. That's advantageous because we don't need to setup the
* full state necessary for catalog access.
* Force invalidations to happen outside of a valid transaction - that way
* entries will just be marked as invalid without accessing the catalog.
* That's advantageous because we don't need to setup the full state
* necessary for catalog access.
*/
if (use_subtxn)
AbortCurrentTransaction();
@@ -2543,14 +2543,14 @@ ReorderBufferRestoreChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
change->data.msg.prefix = MemoryContextAlloc(rb->context,
prefix_size);
memcpy(change->data.msg.prefix, data, prefix_size);
Assert(change->data.msg.prefix[prefix_size-1] == '\0');
Assert(change->data.msg.prefix[prefix_size - 1] == '\0');
data += prefix_size;
/* read the messsage */
memcpy(&change->data.msg.message_size, data, sizeof(Size));
data += sizeof(Size);
change->data.msg.message = MemoryContextAlloc(rb->context,
change->data.msg.message_size);
change->data.msg.message_size);
memcpy(change->data.msg.message, data,
change->data.msg.message_size);
data += change->data.msg.message_size;

View File

@@ -230,11 +230,11 @@ ReplicationSlotCreate(const char *name, bool db_specific,
ReplicationSlotValidateName(name, ERROR);
/*
* If some other backend ran this code concurrently with us, we'd likely both
* allocate the same slot, and that would be bad. We'd also be at risk of
* missing a name collision. Also, we don't want to try to create a new
* slot while somebody's busy cleaning up an old one, because we might
* both be monkeying with the same directory.
* If some other backend ran this code concurrently with us, we'd likely
* both allocate the same slot, and that would be bad. We'd also be at
* risk of missing a name collision. Also, we don't want to try to create
* a new slot while somebody's busy cleaning up an old one, because we
* might both be monkeying with the same directory.
*/
LWLockAcquire(ReplicationSlotAllocationLock, LW_EXCLUSIVE);
@@ -352,8 +352,8 @@ ReplicationSlotAcquire(const char *name)
if (active_pid != 0)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("replication slot \"%s\" is active for PID %d",
name, active_pid)));
errmsg("replication slot \"%s\" is active for PID %d",
name, active_pid)));
/* We made this slot active, so it's ours now. */
MyReplicationSlot = slot;
@@ -533,6 +533,7 @@ void
ReplicationSlotMarkDirty(void)
{
ReplicationSlot *slot = MyReplicationSlot;
Assert(MyReplicationSlot != NULL);
SpinLockAcquire(&slot->mutex);

View File

@@ -40,7 +40,7 @@ Datum
pg_create_physical_replication_slot(PG_FUNCTION_ARGS)
{
Name name = PG_GETARG_NAME(0);
bool immediately_reserve = PG_GETARG_BOOL(1);
bool immediately_reserve = PG_GETARG_BOOL(1);
Datum values[2];
bool nulls[2];
TupleDesc tupdesc;

View File

@@ -86,9 +86,9 @@ static void SyncRepCancelWait(void);
static int SyncRepWakeQueue(bool all, int mode);
static bool SyncRepGetOldestSyncRecPtr(XLogRecPtr *writePtr,
XLogRecPtr *flushPtr,
XLogRecPtr *applyPtr,
bool *am_sync);
XLogRecPtr *flushPtr,
XLogRecPtr *applyPtr,
bool *am_sync);
static int SyncRepGetStandbyPriority(void);
#ifdef USE_ASSERT_CHECKING
@@ -212,8 +212,8 @@ SyncRepWaitForLSN(XLogRecPtr lsn, bool commit)
/*
* If a wait for synchronous replication is pending, we can neither
* acknowledge the commit nor raise ERROR or FATAL. The latter would
* lead the client to believe that the transaction aborted, which
* is not true: it's already committed locally. The former is no good
* lead the client to believe that the transaction aborted, which is
* not true: it's already committed locally. The former is no good
* either: the client has requested synchronous replication, and is
* entitled to assume that an acknowledged commit is also replicated,
* which might not be true. So in this case we issue a WARNING (which
@@ -400,8 +400,8 @@ SyncRepReleaseWaiters(void)
/*
* If this WALSender is serving a standby that is not on the list of
* potential sync standbys then we have nothing to do. If we are still
* starting up, still running base backup or the current flush position
* is still invalid, then leave quickly also.
* starting up, still running base backup or the current flush position is
* still invalid, then leave quickly also.
*/
if (MyWalSnd->sync_standby_priority == 0 ||
MyWalSnd->state < WALSNDSTATE_STREAMING ||
@@ -412,21 +412,21 @@ SyncRepReleaseWaiters(void)
}
/*
* We're a potential sync standby. Release waiters if there are
* enough sync standbys and we are considered as sync.
* We're a potential sync standby. Release waiters if there are enough
* sync standbys and we are considered as sync.
*/
LWLockAcquire(SyncRepLock, LW_EXCLUSIVE);
/*
* Check whether we are a sync standby or not, and calculate
* the oldest positions among all sync standbys.
* Check whether we are a sync standby or not, and calculate the oldest
* positions among all sync standbys.
*/
got_oldest = SyncRepGetOldestSyncRecPtr(&writePtr, &flushPtr,
&applyPtr, &am_sync);
/*
* If we are managing a sync standby, though we weren't
* prior to this, then announce we are now a sync standby.
* If we are managing a sync standby, though we weren't prior to this,
* then announce we are now a sync standby.
*/
if (announce_next_takeover && am_sync)
{
@@ -489,8 +489,8 @@ static bool
SyncRepGetOldestSyncRecPtr(XLogRecPtr *writePtr, XLogRecPtr *flushPtr,
XLogRecPtr *applyPtr, bool *am_sync)
{
List *sync_standbys;
ListCell *cell;
List *sync_standbys;
ListCell *cell;
*writePtr = InvalidXLogRecPtr;
*flushPtr = InvalidXLogRecPtr;
@@ -513,12 +513,12 @@ SyncRepGetOldestSyncRecPtr(XLogRecPtr *writePtr, XLogRecPtr *flushPtr,
}
/*
* Scan through all sync standbys and calculate the oldest
* Write, Flush and Apply positions.
* Scan through all sync standbys and calculate the oldest Write, Flush
* and Apply positions.
*/
foreach (cell, sync_standbys)
foreach(cell, sync_standbys)
{
WalSnd *walsnd = &WalSndCtl->walsnds[lfirst_int(cell)];
WalSnd *walsnd = &WalSndCtl->walsnds[lfirst_int(cell)];
XLogRecPtr write;
XLogRecPtr flush;
XLogRecPtr apply;
@@ -554,16 +554,16 @@ SyncRepGetOldestSyncRecPtr(XLogRecPtr *writePtr, XLogRecPtr *flushPtr,
List *
SyncRepGetSyncStandbys(bool *am_sync)
{
List *result = NIL;
List *pending = NIL;
int lowest_priority;
int next_highest_priority;
int this_priority;
int priority;
int i;
bool am_in_pending = false;
volatile WalSnd *walsnd; /* Use volatile pointer to prevent
* code rearrangement */
List *result = NIL;
List *pending = NIL;
int lowest_priority;
int next_highest_priority;
int this_priority;
int priority;
int i;
bool am_in_pending = false;
volatile WalSnd *walsnd; /* Use volatile pointer to prevent code
* rearrangement */
/* Set default result */
if (am_sync != NULL)
@@ -577,9 +577,9 @@ SyncRepGetSyncStandbys(bool *am_sync)
next_highest_priority = lowest_priority + 1;
/*
* Find the sync standbys which have the highest priority (i.e, 1).
* Also store all the other potential sync standbys into the pending list,
* in order to scan it later and find other sync standbys from it quickly.
* Find the sync standbys which have the highest priority (i.e, 1). Also
* store all the other potential sync standbys into the pending list, in
* order to scan it later and find other sync standbys from it quickly.
*/
for (i = 0; i < max_wal_senders; i++)
{
@@ -603,9 +603,9 @@ SyncRepGetSyncStandbys(bool *am_sync)
continue;
/*
* If the priority is equal to 1, consider this standby as sync
* and append it to the result. Otherwise append this standby
* to the pending list to check if it's actually sync or not later.
* If the priority is equal to 1, consider this standby as sync and
* append it to the result. Otherwise append this standby to the
* pending list to check if it's actually sync or not later.
*/
if (this_priority == 1)
{
@@ -615,7 +615,7 @@ SyncRepGetSyncStandbys(bool *am_sync)
if (list_length(result) == SyncRepConfig->num_sync)
{
list_free(pending);
return result; /* Exit if got enough sync standbys */
return result; /* Exit if got enough sync standbys */
}
}
else
@@ -626,10 +626,10 @@ SyncRepGetSyncStandbys(bool *am_sync)
/*
* Track the highest priority among the standbys in the pending
* list, in order to use it as the starting priority for later scan
* of the list. This is useful to find quickly the sync standbys
* from the pending list later because we can skip unnecessary
* scans for the unused priorities.
* list, in order to use it as the starting priority for later
* scan of the list. This is useful to find quickly the sync
* standbys from the pending list later because we can skip
* unnecessary scans for the unused priorities.
*/
if (this_priority < next_highest_priority)
next_highest_priority = this_priority;
@@ -663,9 +663,9 @@ SyncRepGetSyncStandbys(bool *am_sync)
priority = next_highest_priority;
while (priority <= lowest_priority)
{
ListCell *cell;
ListCell *prev = NULL;
ListCell *next;
ListCell *cell;
ListCell *prev = NULL;
ListCell *next;
next_highest_priority = lowest_priority + 1;
@@ -685,8 +685,8 @@ SyncRepGetSyncStandbys(bool *am_sync)
/*
* We should always exit here after the scan of pending list
* starts because we know that the list has enough elements
* to reach SyncRepConfig->num_sync.
* starts because we know that the list has enough elements to
* reach SyncRepConfig->num_sync.
*/
if (list_length(result) == SyncRepConfig->num_sync)
{
@@ -695,8 +695,8 @@ SyncRepGetSyncStandbys(bool *am_sync)
}
/*
* Remove the entry for this sync standby from the list
* to prevent us from looking at the same entry again.
* Remove the entry for this sync standby from the list to
* prevent us from looking at the same entry again.
*/
pending = list_delete_cell(pending, cell, prev);

View File

@@ -463,7 +463,7 @@ WalReceiverMain(void)
*/
Assert(wait_fd != PGINVALID_SOCKET);
rc = WaitLatchOrSocket(&walrcv->latch,
WL_POSTMASTER_DEATH | WL_SOCKET_READABLE |
WL_POSTMASTER_DEATH | WL_SOCKET_READABLE |
WL_TIMEOUT | WL_LATCH_SET,
wait_fd,
NAPTIME_PER_CYCLE);
@@ -475,8 +475,8 @@ WalReceiverMain(void)
/*
* The recovery process has asked us to send apply
* feedback now. Make sure the flag is really set to
* false in shared memory before sending the reply,
* so we don't miss a new request for a reply.
* false in shared memory before sending the reply, so
* we don't miss a new request for a reply.
*/
walrcv->force_reply = false;
pg_memory_barrier();
@@ -1318,10 +1318,10 @@ pg_stat_get_wal_receiver(PG_FUNCTION_ARGS)
TimeLineID receive_start_tli;
XLogRecPtr received_lsn;
TimeLineID received_tli;
TimestampTz last_send_time;
TimestampTz last_receipt_time;
TimestampTz last_send_time;
TimestampTz last_receipt_time;
XLogRecPtr latest_end_lsn;
TimestampTz latest_end_time;
TimestampTz latest_end_time;
char *slotname;
/* No WAL receiver, just return a tuple with NULL values */
@@ -1379,8 +1379,8 @@ pg_stat_get_wal_receiver(PG_FUNCTION_ARGS)
if (!superuser())
{
/*
* Only superusers can see details. Other users only get the pid
* value to know whether it is a WAL receiver, but no details.
* Only superusers can see details. Other users only get the pid value
* to know whether it is a WAL receiver, but no details.
*/
MemSet(&nulls[1], true, PG_STAT_GET_WAL_RECEIVER_COLS - 1);
}
@@ -1422,5 +1422,5 @@ pg_stat_get_wal_receiver(PG_FUNCTION_ARGS)
/* Returns the record as Datum */
PG_RETURN_DATUM(HeapTupleGetDatum(
heap_form_tuple(tupdesc, values, nulls)));
heap_form_tuple(tupdesc, values, nulls)));
}

View File

@@ -464,7 +464,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
pq_beginmessage(&buf, 'D');
pq_sendint(&buf, 2, 2); /* # of columns */
len = strlen(histfname);
pq_sendint(&buf, len, 4); /* col1 len */
pq_sendint(&buf, len, 4); /* col1 len */
pq_sendbytes(&buf, histfname, len);
fd = OpenTransientFile(path, O_RDONLY | PG_BINARY, 0666);
@@ -657,7 +657,7 @@ StartReplication(StartReplicationCmd *cmd)
/* Initialize shared memory status, too */
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
SpinLockAcquire(&walsnd->mutex);
walsnd->sentPtr = sentPtr;
@@ -728,7 +728,7 @@ StartReplication(StartReplicationCmd *cmd)
pq_sendint(&buf, 2, 2); /* number of columns */
len = strlen(tli_str);
pq_sendint(&buf, len, 4); /* length */
pq_sendint(&buf, len, 4); /* length */
pq_sendbytes(&buf, tli_str, len);
len = strlen(startpos_str);
@@ -901,7 +901,7 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
/* slot_name */
len = strlen(NameStr(MyReplicationSlot->data.name));
pq_sendint(&buf, len, 4); /* col1 len */
pq_sendint(&buf, len, 4); /* col1 len */
pq_sendbytes(&buf, NameStr(MyReplicationSlot->data.name), len);
/* consistent wal location */
@@ -1008,7 +1008,7 @@ StartLogicalReplication(StartReplicationCmd *cmd)
/* Also update the sent position status in shared memory */
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
SpinLockAcquire(&walsnd->mutex);
walsnd->sentPtr = MyReplicationSlot->data.restart_lsn;
@@ -1569,7 +1569,7 @@ ProcessStandbyReplyMessage(void)
* standby.
*/
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
SpinLockAcquire(&walsnd->mutex);
walsnd->write = writePtr;
@@ -1948,7 +1948,7 @@ InitWalSenderSlot(void)
*/
for (i = 0; i < max_wal_senders; i++)
{
WalSnd *walsnd = &WalSndCtl->walsnds[i];
WalSnd *walsnd = &WalSndCtl->walsnds[i];
SpinLockAcquire(&walsnd->mutex);
@@ -2161,7 +2161,7 @@ retry:
*/
if (am_cascading_walsender)
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
bool reload;
SpinLockAcquire(&walsnd->mutex);
@@ -2399,7 +2399,7 @@ XLogSendPhysical(void)
/* Update shared memory status */
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
SpinLockAcquire(&walsnd->mutex);
walsnd->sentPtr = sentPtr;
@@ -2461,7 +2461,7 @@ XLogSendLogical(void)
/* Update shared memory status */
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
SpinLockAcquire(&walsnd->mutex);
walsnd->sentPtr = sentPtr;
@@ -2556,7 +2556,7 @@ WalSndRqstFileReload(void)
for (i = 0; i < max_wal_senders; i++)
{
WalSnd *walsnd = &WalSndCtl->walsnds[i];
WalSnd *walsnd = &WalSndCtl->walsnds[i];
if (walsnd->pid == 0)
continue;
@@ -2708,7 +2708,7 @@ WalSndWakeup(void)
void
WalSndSetState(WalSndState state)
{
WalSnd *walsnd = MyWalSnd;
WalSnd *walsnd = MyWalSnd;
Assert(am_walsender);
@@ -2792,7 +2792,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
for (i = 0; i < max_wal_senders; i++)
{
WalSnd *walsnd = &WalSndCtl->walsnds[i];
WalSnd *walsnd = &WalSndCtl->walsnds[i];
XLogRecPtr sentPtr;
XLogRecPtr write;
XLogRecPtr flush;