diff options
Diffstat (limited to 'src/backend/replication/logical')
-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 |
4 files changed, 40 insertions, 40 deletions
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); |