diff options
Diffstat (limited to 'src/backend/replication')
-rw-r--r-- | src/backend/replication/basebackup.c | 39 | ||||
-rw-r--r-- | src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 6 | ||||
-rw-r--r-- | src/backend/replication/logical/logical.c | 2 | ||||
-rw-r--r-- | src/backend/replication/logical/proto.c | 4 | ||||
-rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 52 | ||||
-rw-r--r-- | src/backend/replication/logical/worker.c | 22 | ||||
-rw-r--r-- | src/backend/replication/pgoutput/pgoutput.c | 4 | ||||
-rw-r--r-- | src/backend/replication/slotfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/replication/walreceiver.c | 4 | ||||
-rw-r--r-- | src/backend/replication/walsender.c | 8 |
10 files changed, 72 insertions, 73 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index a79048d233d..bc9f585b85b 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -243,8 +243,8 @@ perform_base_backup(basebackup_options *opt) /* * Once do_pg_start_backup has been called, ensure that any failure causes * us to abort the backup so we don't "leak" a backup counter. For this - * reason, *all* functionality between do_pg_start_backup() and - * the end of do_pg_stop_backup() should be inside the error cleanup block! + * reason, *all* functionality between do_pg_start_backup() and the end of + * do_pg_stop_backup() should be inside the error cleanup block! */ PG_ENSURE_ERROR_CLEANUP(base_backup_cleanup, (Datum) 0); @@ -598,7 +598,7 @@ perform_base_backup(basebackup_options *opt) { if (total_checksum_failures > 1) { - char buf[64]; + char buf[64]; snprintf(buf, sizeof(buf), INT64_FORMAT, total_checksum_failures); @@ -1015,15 +1015,15 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces, char pathbuf[MAXPGPATH * 2]; struct stat statbuf; int64 size = 0; - const char *lastDir; /* Split last dir from parent path. */ - bool isDbDir = false; /* Does this directory contain relations? */ + const char *lastDir; /* Split last dir from parent path. */ + bool isDbDir = false; /* Does this directory contain relations? */ /* - * Determine if the current path is a database directory that can - * contain relations. + * Determine if the current path is a database directory that can contain + * relations. * - * Start by finding the location of the delimiter between the parent - * path and the current path. + * Start by finding the location of the delimiter between the parent path + * and the current path. */ lastDir = last_dir_separator(path); @@ -1032,7 +1032,7 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces, strspn(lastDir + 1, "0123456789") == strlen(lastDir + 1)) { /* Part of path that contains the parent directory. */ - int parentPathLen = lastDir - path; + int parentPathLen = lastDir - path; /* * Mark path as a database directory if the parent path is either @@ -1051,7 +1051,7 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces, { int excludeIdx; bool excludeFound; - ForkNumber relForkNum; /* Type of fork if file is a relation */ + ForkNumber relForkNum; /* Type of fork if file is a relation */ int relOidChars; /* Chars in filename that are the rel oid */ /* Skip special stuff */ @@ -1104,8 +1104,8 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces, /* Never exclude init forks */ if (relForkNum != INIT_FORKNUM) { - char initForkFile[MAXPGPATH]; - char relOid[OIDCHARS + 1]; + char initForkFile[MAXPGPATH]; + char relOid[OIDCHARS + 1]; /* * If any other type of fork, check if there is an init fork @@ -1417,10 +1417,10 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf while ((cnt = fread(buf, 1, Min(sizeof(buf), statbuf->st_size - len), fp)) > 0) { /* - * The checksums are verified at block level, so we iterate over - * the buffer in chunks of BLCKSZ, after making sure that - * TAR_SEND_SIZE/buf is divisible by BLCKSZ and we read a multiple - * of BLCKSZ bytes. + * The checksums are verified at block level, so we iterate over the + * buffer in chunks of BLCKSZ, after making sure that + * TAR_SEND_SIZE/buf is divisible by BLCKSZ and we read a multiple of + * BLCKSZ bytes. */ Assert(TAR_SEND_SIZE % BLCKSZ == 0); @@ -1445,9 +1445,8 @@ sendFile(const char *readfilename, const char *tarfilename, struct stat *statbuf * start of the base backup. Otherwise, they might have been * written only halfway and the checksum would not be valid. * However, replaying WAL would reinstate the correct page in - * this case. - * We also skip completely new pages, since they don't have - * a checksum yet. + * this case. We also skip completely new pages, since they + * don't have a checksum yet. */ if (!PageIsNew(page) && PageGetLSN(page) < startptr) { diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c index e4d261bd793..bd489061602 100644 --- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c +++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c @@ -54,7 +54,7 @@ static WalReceiverConn *libpqrcv_connect(const char *conninfo, static void libpqrcv_check_conninfo(const char *conninfo); static char *libpqrcv_get_conninfo(WalReceiverConn *conn); static void libpqrcv_get_senderinfo(WalReceiverConn *conn, - char **sender_host, int *sender_port); + char **sender_host, int *sender_port); static char *libpqrcv_identify_system(WalReceiverConn *conn, TimeLineID *primary_tli, int *server_version); @@ -291,9 +291,9 @@ libpqrcv_get_conninfo(WalReceiverConn *conn) */ static void libpqrcv_get_senderinfo(WalReceiverConn *conn, char **sender_host, - int *sender_port) + int *sender_port) { - char *ret = NULL; + char *ret = NULL; *sender_host = NULL; *sender_port = 0; diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 0737c7b1e75..13935915382 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -63,7 +63,7 @@ static void commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, static void change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); static void truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, - int nrelations, Relation relations[], ReorderBufferChange *change); + int nrelations, Relation relations[], 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); diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c index edc97a7662b..19451714dad 100644 --- a/src/backend/replication/logical/proto.c +++ b/src/backend/replication/logical/proto.c @@ -305,7 +305,7 @@ logicalrep_write_truncate(StringInfo out, bool cascade, bool restart_seqs) { int i; - uint8 flags = 0; + uint8 flags = 0; pq_sendbyte(out, 'T'); /* action TRUNCATE */ @@ -332,7 +332,7 @@ logicalrep_read_truncate(StringInfo in, int i; int nrelids; List *relids = NIL; - uint8 flags; + uint8 flags; nrelids = pq_getmsgint(in, 4); diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 596c91e9a95..e2f59bf5808 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -1493,36 +1493,36 @@ ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid, break; case REORDER_BUFFER_CHANGE_TRUNCATE: - { - int i; - int nrelids = change->data.truncate.nrelids; - int nrelations = 0; - Relation *relations; - - relations = palloc0(nrelids * sizeof(Relation)); - for (i = 0; i < nrelids; i++) { - Oid relid = change->data.truncate.relids[i]; - Relation relation; + int i; + int nrelids = change->data.truncate.nrelids; + int nrelations = 0; + Relation *relations; - relation = RelationIdGetRelation(relid); + relations = palloc0(nrelids * sizeof(Relation)); + for (i = 0; i < nrelids; i++) + { + Oid relid = change->data.truncate.relids[i]; + Relation relation; - if (relation == NULL) - elog(ERROR, "could not open relation with OID %u", relid); + relation = RelationIdGetRelation(relid); - if (!RelationIsLogicallyLogged(relation)) - continue; + if (relation == NULL) + elog(ERROR, "could not open relation with OID %u", relid); - relations[nrelations++] = relation; - } + if (!RelationIsLogicallyLogged(relation)) + continue; - rb->apply_truncate(rb, txn, nrelations, relations, change); + relations[nrelations++] = relation; + } - for (i = 0; i < nrelations; i++) - RelationClose(relations[i]); + rb->apply_truncate(rb, txn, nrelations, relations, change); - break; - } + for (i = 0; i < nrelations; i++) + RelationClose(relations[i]); + + break; + } case REORDER_BUFFER_CHANGE_MESSAGE: rb->message(rb, txn, change->lsn, true, @@ -1744,7 +1744,7 @@ ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid) if (txn->serialized && txn->final_lsn == 0) { ReorderBufferChange *last = - dlist_tail_element(ReorderBufferChange, node, &txn->changes); + dlist_tail_element(ReorderBufferChange, node, &txn->changes); txn->final_lsn = last->lsn; } @@ -2660,9 +2660,9 @@ ReorderBufferSerializedPath(char *path, ReplicationSlot *slot, TransactionId xid XLogSegNoOffsetToRecPtr(segno, 0, recptr, wal_segment_size); snprintf(path, MAXPGPATH, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap", - NameStr(MyReplicationSlot->data.name), - xid, - (uint32) (recptr >> 32), (uint32) recptr); + NameStr(MyReplicationSlot->data.name), + xid, + (uint32) (recptr >> 32), (uint32) recptr); } /* diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 2bcf56ca2ff..2ed81444973 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -899,14 +899,14 @@ apply_handle_delete(StringInfo s) static void apply_handle_truncate(StringInfo s) { - bool cascade = false; - bool restart_seqs = false; - List *remote_relids = NIL; - List *remote_rels = NIL; - List *rels = NIL; - List *relids = NIL; - List *relids_logged = NIL; - ListCell *lc; + bool cascade = false; + bool restart_seqs = false; + List *remote_relids = NIL; + List *remote_rels = NIL; + List *rels = NIL; + List *relids = NIL; + List *relids_logged = NIL; + ListCell *lc; ensure_transaction(); @@ -936,9 +936,9 @@ apply_handle_truncate(StringInfo s) } /* - * Even if we used CASCADE on the upstream master we explicitly - * default to replaying changes without further cascading. - * This might be later changeable with a user specified option. + * Even if we used CASCADE on the upstream master we explicitly default to + * replaying changes without further cascading. This might be later + * changeable with a user specified option. */ ExecuteTruncateGuts(rels, relids, relids_logged, DROP_RESTRICT, restart_seqs); diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 06dfbc082f2..a3e5300679f 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -40,8 +40,8 @@ static void pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation rel, ReorderBufferChange *change); static void pgoutput_truncate(LogicalDecodingContext *ctx, - ReorderBufferTXN *txn, int nrelations, Relation relations[], - ReorderBufferChange *change); + ReorderBufferTXN *txn, int nrelations, Relation relations[], + ReorderBufferChange *change); static bool pgoutput_origin_filter(LogicalDecodingContext *ctx, RepOriginId origin_id); diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index e873dd1f81a..d9e10263bb7 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -342,8 +342,8 @@ static XLogRecPtr pg_logical_replication_slot_advance(XLogRecPtr startlsn, XLogRecPtr moveto) { LogicalDecodingContext *ctx; - ResourceOwner old_resowner = CurrentResourceOwner; - XLogRecPtr retlsn = InvalidXLogRecPtr; + ResourceOwner old_resowner = CurrentResourceOwner; + XLogRecPtr retlsn = InvalidXLogRecPtr; PG_TRY(); { diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index b9dab322d6b..987bb84683c 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -1461,8 +1461,8 @@ pg_stat_get_wal_receiver(PG_FUNCTION_ARGS) { /* * Only superusers and members of pg_read_all_stats can see details. - * Other users only get the pid value - * to know whether it is a WAL receiver, but no details. + * Other users only get the pid value to know whether it is a WAL + * receiver, but no details. */ MemSet(&nulls[1], true, sizeof(bool) * (tupdesc->natts - 1)); } diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 642e859439f..e47ddca6bca 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -1153,7 +1153,7 @@ static void WalSndWriteData(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid, bool last_write) { - TimestampTz now; + TimestampTz now; /* output previously gathered data in a CopyData packet */ pq_putmessage_noblock('d', ctx->out->data, ctx->out->len); @@ -3247,9 +3247,9 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS) if (!is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_STATS)) { /* - * Only superusers and members of pg_read_all_stats can see details. - * Other users only get the pid value to know it's a walsender, - * but no details. + * Only superusers and members of pg_read_all_stats can see + * details. Other users only get the pid value to know it's a + * walsender, but no details. */ MemSet(&nulls[1], true, PG_STAT_GET_WAL_SENDERS_COLS - 1); } |