diff options
Diffstat (limited to 'src/backend/replication/logical/reorderbuffer.c')
-rw-r--r-- | src/backend/replication/logical/reorderbuffer.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 8da5f9089c7..88a37fde722 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -106,7 +106,7 @@ #include "utils/memdebug.h" #include "utils/memutils.h" #include "utils/rel.h" -#include "utils/relfilenodemap.h" +#include "utils/relfilenumbermap.h" /* entry for a hash table we use to map from xid to our transaction state */ @@ -116,10 +116,10 @@ typedef struct ReorderBufferTXNByIdEnt ReorderBufferTXN *txn; } ReorderBufferTXNByIdEnt; -/* data structures for (relfilenode, ctid) => (cmin, cmax) mapping */ +/* data structures for (relfilelocator, ctid) => (cmin, cmax) mapping */ typedef struct ReorderBufferTupleCidKey { - RelFileNode relnode; + RelFileLocator rlocator; ItemPointerData tid; } ReorderBufferTupleCidKey; @@ -1643,7 +1643,7 @@ ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, bool txn_prep } /* - * Destroy the (relfilenode, ctid) hashtable, so that we don't leak any + * Destroy the (relfilelocator, ctid) hashtable, so that we don't leak any * memory. We could also keep the hash table and update it with new ctid * values, but this seems simpler and good enough for now. */ @@ -1673,7 +1673,7 @@ ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, bool txn_prep } /* - * Build a hash with a (relfilenode, ctid) -> (cmin, cmax) mapping for use by + * Build a hash with a (relfilelocator, ctid) -> (cmin, cmax) mapping for use by * HeapTupleSatisfiesHistoricMVCC. */ static void @@ -1711,7 +1711,7 @@ ReorderBufferBuildTupleCidHash(ReorderBuffer *rb, ReorderBufferTXN *txn) /* be careful about padding */ memset(&key, 0, sizeof(ReorderBufferTupleCidKey)); - key.relnode = change->data.tuplecid.node; + key.rlocator = change->data.tuplecid.locator; ItemPointerCopy(&change->data.tuplecid.tid, &key.tid); @@ -2140,36 +2140,36 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, case REORDER_BUFFER_CHANGE_DELETE: Assert(snapshot_now); - reloid = RelidByRelfilenode(change->data.tp.relnode.spcNode, - change->data.tp.relnode.relNode); + reloid = RelidByRelfilenumber(change->data.tp.rlocator.spcOid, + change->data.tp.rlocator.relNumber); /* * Mapped catalog tuple without data, emitted while * catalog table was in the process of being rewritten. We - * can fail to look up the relfilenode, because the + * can fail to look up the relfilenumber, because the * relmapper has no "historic" view, in contrast to the * normal catalog during decoding. Thus repeated rewrites * can cause a lookup failure. That's OK because we do not * decode catalog changes anyway. Normally such tuples * would be skipped over below, but we can't identify * whether the table should be logically logged without - * mapping the relfilenode to the oid. + * mapping the relfilenumber to the oid. */ if (reloid == InvalidOid && change->data.tp.newtuple == NULL && change->data.tp.oldtuple == NULL) goto change_done; else if (reloid == InvalidOid) - elog(ERROR, "could not map filenode \"%s\" to relation OID", - relpathperm(change->data.tp.relnode, + elog(ERROR, "could not map filenumber \"%s\" to relation OID", + relpathperm(change->data.tp.rlocator, MAIN_FORKNUM)); relation = RelationIdGetRelation(reloid); if (!RelationIsValid(relation)) - elog(ERROR, "could not open relation with OID %u (for filenode \"%s\")", + elog(ERROR, "could not open relation with OID %u (for filenumber \"%s\")", reloid, - relpathperm(change->data.tp.relnode, + relpathperm(change->data.tp.rlocator, MAIN_FORKNUM)); if (!RelationIsLogicallyLogged(relation)) @@ -3157,7 +3157,7 @@ ReorderBufferChangeMemoryUpdate(ReorderBuffer *rb, } /* - * Add new (relfilenode, tid) -> (cmin, cmax) mappings. + * Add new (relfilelocator, tid) -> (cmin, cmax) mappings. * * We do not include this change type in memory accounting, because we * keep CIDs in a separate list and do not evict them when reaching @@ -3165,7 +3165,7 @@ ReorderBufferChangeMemoryUpdate(ReorderBuffer *rb, */ void ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, - XLogRecPtr lsn, RelFileNode node, + XLogRecPtr lsn, RelFileLocator locator, ItemPointerData tid, CommandId cmin, CommandId cmax, CommandId combocid) { @@ -3174,7 +3174,7 @@ ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid, txn = ReorderBufferTXNByXid(rb, xid, true, NULL, lsn, true); - change->data.tuplecid.node = node; + change->data.tuplecid.locator = locator; change->data.tuplecid.tid = tid; change->data.tuplecid.cmin = cmin; change->data.tuplecid.cmax = cmax; @@ -4839,7 +4839,7 @@ ReorderBufferToastReset(ReorderBuffer *rb, ReorderBufferTXN *txn) * need anymore. * * To resolve those problems we have a per-transaction hash of (cmin, - * cmax) tuples keyed by (relfilenode, ctid) which contains the actual + * cmax) tuples keyed by (relfilelocator, ctid) which contains the actual * (cmin, cmax) values. That also takes care of combo CIDs by simply * not caring about them at all. As we have the real cmin/cmax values * combo CIDs aren't interesting. @@ -4870,9 +4870,9 @@ DisplayMapping(HTAB *tuplecid_data) while ((ent = (ReorderBufferTupleCidEnt *) hash_seq_search(&hstat)) != NULL) { elog(DEBUG3, "mapping: node: %u/%u/%u tid: %u/%u cmin: %u, cmax: %u", - ent->key.relnode.dbNode, - ent->key.relnode.spcNode, - ent->key.relnode.relNode, + ent->key.rlocator.dbOid, + ent->key.rlocator.spcOid, + ent->key.rlocator.relNumber, ItemPointerGetBlockNumber(&ent->key.tid), ItemPointerGetOffsetNumber(&ent->key.tid), ent->cmin, @@ -4932,7 +4932,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname) path, readBytes, (int32) sizeof(LogicalRewriteMappingData)))); - key.relnode = map.old_node; + key.rlocator = map.old_locator; ItemPointerCopy(&map.old_tid, &key.tid); @@ -4947,7 +4947,7 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname) if (!ent) continue; - key.relnode = map.new_node; + key.rlocator = map.new_locator; ItemPointerCopy(&map.new_tid, &key.tid); @@ -5120,10 +5120,10 @@ ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data, Assert(!BufferIsLocal(buffer)); /* - * get relfilenode from the buffer, no convenient way to access it other - * than that. + * get relfilelocator from the buffer, no convenient way to access it + * other than that. */ - BufferGetTag(buffer, &key.relnode, &forkno, &blockno); + BufferGetTag(buffer, &key.rlocator, &forkno, &blockno); /* tuples can only be in the main fork */ Assert(forkno == MAIN_FORKNUM); |