mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
We have been using the term RelFileNode to refer to either (1) the integer that is used to name the sequence of files for a certain relation within the directory set aside for that tablespace/database combination; or (2) that value plus the OIDs of the tablespace and database; or occasionally (3) the whole series of files created for a relation based on those values. Using the same name for more than one thing is confusing. Replace RelFileNode with RelFileNumber when we're talking about just the single number, i.e. (1) from above, and with RelFileLocator when we're talking about all the things that are needed to locate a relation's files on disk, i.e. (2) from above. In the places where we refer to (3) as a relfilenode, instead refer to "relation storage". Since there is a ton of SQL code in the world that knows about pg_class.relfilenode, don't change the name of that column, or of other SQL-facing things that derive their name from it. On the other hand, do adjust closely-related internal terminology. For example, the structure member names dbNode and spcNode appear to be derived from the fact that the structure itself was called RelFileNode, so change those to dbOid and spcOid. Likewise, various variables with names like rnode and relnode get renamed appropriately, according to how they're being used in context. Hopefully, this is clearer than before. It is also preparation for future patches that intend to widen the relfilenumber fields from its current width of 32 bits. Variables that store a relfilenumber are now declared as type RelFileNumber rather than type Oid; right now, these are the same, but that can now more easily be changed. Dilip Kumar, per an idea from me. Reviewed also by Andres Freund. I fixed some whitespace issues, changed a couple of words in a comment, and made one other minor correction. Discussion: http://postgr.es/m/CA+TgmoamOtXbVAQf9hWFzonUo6bhhjS6toZQd7HZ-pmojtAmag@mail.gmail.com Discussion: http://postgr.es/m/CA+Tgmobp7+7kmi4gkq7Y+4AM9fTvL+O1oQ4-5gFTT+6Ng-dQ=g@mail.gmail.com Discussion: http://postgr.es/m/CAFiTN-vTe79M8uDH1yprOU64MNFE+R3ODRuA+JWf27JbhY4hJw@mail.gmail.com
This commit is contained in:
@@ -8189,7 +8189,7 @@ log_heap_freeze(Relation reln, Buffer buffer, TransactionId cutoff_xid,
|
||||
* heap_buffer, if necessary.
|
||||
*/
|
||||
XLogRecPtr
|
||||
log_heap_visible(RelFileNode rnode, Buffer heap_buffer, Buffer vm_buffer,
|
||||
log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer, Buffer vm_buffer,
|
||||
TransactionId cutoff_xid, uint8 vmflags)
|
||||
{
|
||||
xl_heap_visible xlrec;
|
||||
@@ -8454,7 +8454,7 @@ log_heap_new_cid(Relation relation, HeapTuple tup)
|
||||
Assert(tup->t_tableOid != InvalidOid);
|
||||
|
||||
xlrec.top_xid = GetTopTransactionId();
|
||||
xlrec.target_node = relation->rd_node;
|
||||
xlrec.target_locator = relation->rd_locator;
|
||||
xlrec.target_tid = tup->t_self;
|
||||
|
||||
/*
|
||||
@@ -8623,18 +8623,18 @@ heap_xlog_prune(XLogReaderState *record)
|
||||
XLogRecPtr lsn = record->EndRecPtr;
|
||||
xl_heap_prune *xlrec = (xl_heap_prune *) XLogRecGetData(record);
|
||||
Buffer buffer;
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
BlockNumber blkno;
|
||||
XLogRedoAction action;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &blkno);
|
||||
|
||||
/*
|
||||
* We're about to remove tuples. In Hot Standby mode, ensure that there's
|
||||
* no queries running for which the removed tuples are still visible.
|
||||
*/
|
||||
if (InHotStandby)
|
||||
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, rnode);
|
||||
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid, rlocator);
|
||||
|
||||
/*
|
||||
* If we have a full-page image, restore it (using a cleanup lock) and
|
||||
@@ -8694,7 +8694,7 @@ heap_xlog_prune(XLogReaderState *record)
|
||||
* Do this regardless of a full-page image being applied, since the
|
||||
* FSM data is not in the page anyway.
|
||||
*/
|
||||
XLogRecordPageWithFreeSpace(rnode, blkno, freespace);
|
||||
XLogRecordPageWithFreeSpace(rlocator, blkno, freespace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8751,9 +8751,9 @@ heap_xlog_vacuum(XLogReaderState *record)
|
||||
if (BufferIsValid(buffer))
|
||||
{
|
||||
Size freespace = PageGetHeapFreeSpace(BufferGetPage(buffer));
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &blkno);
|
||||
|
||||
UnlockReleaseBuffer(buffer);
|
||||
|
||||
@@ -8766,7 +8766,7 @@ heap_xlog_vacuum(XLogReaderState *record)
|
||||
* Do this regardless of a full-page image being applied, since the
|
||||
* FSM data is not in the page anyway.
|
||||
*/
|
||||
XLogRecordPageWithFreeSpace(rnode, blkno, freespace);
|
||||
XLogRecordPageWithFreeSpace(rlocator, blkno, freespace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8786,11 +8786,11 @@ heap_xlog_visible(XLogReaderState *record)
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
Buffer buffer;
|
||||
Page page;
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
BlockNumber blkno;
|
||||
XLogRedoAction action;
|
||||
|
||||
XLogRecGetBlockTag(record, 1, &rnode, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 1, &rlocator, NULL, &blkno);
|
||||
|
||||
/*
|
||||
* If there are any Hot Standby transactions running that have an xmin
|
||||
@@ -8802,7 +8802,7 @@ heap_xlog_visible(XLogReaderState *record)
|
||||
* rather than killing the transaction outright.
|
||||
*/
|
||||
if (InHotStandby)
|
||||
ResolveRecoveryConflictWithSnapshot(xlrec->cutoff_xid, rnode);
|
||||
ResolveRecoveryConflictWithSnapshot(xlrec->cutoff_xid, rlocator);
|
||||
|
||||
/*
|
||||
* Read the heap page, if it still exists. If the heap file has dropped or
|
||||
@@ -8865,7 +8865,7 @@ heap_xlog_visible(XLogReaderState *record)
|
||||
* FSM data is not in the page anyway.
|
||||
*/
|
||||
if (xlrec->flags & VISIBILITYMAP_VALID_BITS)
|
||||
XLogRecordPageWithFreeSpace(rnode, blkno, space);
|
||||
XLogRecordPageWithFreeSpace(rlocator, blkno, space);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8890,7 +8890,7 @@ heap_xlog_visible(XLogReaderState *record)
|
||||
*/
|
||||
LockBuffer(vmbuffer, BUFFER_LOCK_UNLOCK);
|
||||
|
||||
reln = CreateFakeRelcacheEntry(rnode);
|
||||
reln = CreateFakeRelcacheEntry(rlocator);
|
||||
visibilitymap_pin(reln, blkno, &vmbuffer);
|
||||
|
||||
/*
|
||||
@@ -8933,13 +8933,13 @@ heap_xlog_freeze_page(XLogReaderState *record)
|
||||
*/
|
||||
if (InHotStandby)
|
||||
{
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
TransactionId latestRemovedXid = cutoff_xid;
|
||||
|
||||
TransactionIdRetreat(latestRemovedXid);
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, NULL);
|
||||
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, rnode);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, NULL);
|
||||
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, rlocator);
|
||||
}
|
||||
|
||||
if (XLogReadBufferForRedo(record, 0, &buffer) == BLK_NEEDS_REDO)
|
||||
@@ -9007,10 +9007,10 @@ heap_xlog_delete(XLogReaderState *record)
|
||||
ItemId lp = NULL;
|
||||
HeapTupleHeader htup;
|
||||
BlockNumber blkno;
|
||||
RelFileNode target_node;
|
||||
RelFileLocator target_locator;
|
||||
ItemPointerData target_tid;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &target_node, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 0, &target_locator, NULL, &blkno);
|
||||
ItemPointerSetBlockNumber(&target_tid, blkno);
|
||||
ItemPointerSetOffsetNumber(&target_tid, xlrec->offnum);
|
||||
|
||||
@@ -9020,7 +9020,7 @@ heap_xlog_delete(XLogReaderState *record)
|
||||
*/
|
||||
if (xlrec->flags & XLH_DELETE_ALL_VISIBLE_CLEARED)
|
||||
{
|
||||
Relation reln = CreateFakeRelcacheEntry(target_node);
|
||||
Relation reln = CreateFakeRelcacheEntry(target_locator);
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
|
||||
visibilitymap_pin(reln, blkno, &vmbuffer);
|
||||
@@ -9086,12 +9086,12 @@ heap_xlog_insert(XLogReaderState *record)
|
||||
xl_heap_header xlhdr;
|
||||
uint32 newlen;
|
||||
Size freespace = 0;
|
||||
RelFileNode target_node;
|
||||
RelFileLocator target_locator;
|
||||
BlockNumber blkno;
|
||||
ItemPointerData target_tid;
|
||||
XLogRedoAction action;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &target_node, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 0, &target_locator, NULL, &blkno);
|
||||
ItemPointerSetBlockNumber(&target_tid, blkno);
|
||||
ItemPointerSetOffsetNumber(&target_tid, xlrec->offnum);
|
||||
|
||||
@@ -9101,7 +9101,7 @@ heap_xlog_insert(XLogReaderState *record)
|
||||
*/
|
||||
if (xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED)
|
||||
{
|
||||
Relation reln = CreateFakeRelcacheEntry(target_node);
|
||||
Relation reln = CreateFakeRelcacheEntry(target_locator);
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
|
||||
visibilitymap_pin(reln, blkno, &vmbuffer);
|
||||
@@ -9184,7 +9184,7 @@ heap_xlog_insert(XLogReaderState *record)
|
||||
* totally accurate anyway.
|
||||
*/
|
||||
if (action == BLK_NEEDS_REDO && freespace < BLCKSZ / 5)
|
||||
XLogRecordPageWithFreeSpace(target_node, blkno, freespace);
|
||||
XLogRecordPageWithFreeSpace(target_locator, blkno, freespace);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9195,7 +9195,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
|
||||
{
|
||||
XLogRecPtr lsn = record->EndRecPtr;
|
||||
xl_heap_multi_insert *xlrec;
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
BlockNumber blkno;
|
||||
Buffer buffer;
|
||||
Page page;
|
||||
@@ -9217,7 +9217,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
|
||||
*/
|
||||
xlrec = (xl_heap_multi_insert *) XLogRecGetData(record);
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &blkno);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &blkno);
|
||||
|
||||
/* check that the mutually exclusive flags are not both set */
|
||||
Assert(!((xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED) &&
|
||||
@@ -9229,7 +9229,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
|
||||
*/
|
||||
if (xlrec->flags & XLH_INSERT_ALL_VISIBLE_CLEARED)
|
||||
{
|
||||
Relation reln = CreateFakeRelcacheEntry(rnode);
|
||||
Relation reln = CreateFakeRelcacheEntry(rlocator);
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
|
||||
visibilitymap_pin(reln, blkno, &vmbuffer);
|
||||
@@ -9331,7 +9331,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
|
||||
* totally accurate anyway.
|
||||
*/
|
||||
if (action == BLK_NEEDS_REDO && freespace < BLCKSZ / 5)
|
||||
XLogRecordPageWithFreeSpace(rnode, blkno, freespace);
|
||||
XLogRecordPageWithFreeSpace(rlocator, blkno, freespace);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9342,7 +9342,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
||||
{
|
||||
XLogRecPtr lsn = record->EndRecPtr;
|
||||
xl_heap_update *xlrec = (xl_heap_update *) XLogRecGetData(record);
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
BlockNumber oldblk;
|
||||
BlockNumber newblk;
|
||||
ItemPointerData newtid;
|
||||
@@ -9371,7 +9371,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
||||
oldtup.t_data = NULL;
|
||||
oldtup.t_len = 0;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &newblk);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &newblk);
|
||||
if (XLogRecGetBlockTagExtended(record, 1, NULL, NULL, &oldblk, NULL))
|
||||
{
|
||||
/* HOT updates are never done across pages */
|
||||
@@ -9388,7 +9388,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
||||
*/
|
||||
if (xlrec->flags & XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED)
|
||||
{
|
||||
Relation reln = CreateFakeRelcacheEntry(rnode);
|
||||
Relation reln = CreateFakeRelcacheEntry(rlocator);
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
|
||||
visibilitymap_pin(reln, oldblk, &vmbuffer);
|
||||
@@ -9472,7 +9472,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
||||
*/
|
||||
if (xlrec->flags & XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED)
|
||||
{
|
||||
Relation reln = CreateFakeRelcacheEntry(rnode);
|
||||
Relation reln = CreateFakeRelcacheEntry(rlocator);
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
|
||||
visibilitymap_pin(reln, newblk, &vmbuffer);
|
||||
@@ -9606,7 +9606,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
|
||||
* totally accurate anyway.
|
||||
*/
|
||||
if (newaction == BLK_NEEDS_REDO && !hot_update && freespace < BLCKSZ / 5)
|
||||
XLogRecordPageWithFreeSpace(rnode, newblk, freespace);
|
||||
XLogRecordPageWithFreeSpace(rlocator, newblk, freespace);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -9662,13 +9662,13 @@ heap_xlog_lock(XLogReaderState *record)
|
||||
*/
|
||||
if (xlrec->flags & XLH_LOCK_ALL_FROZEN_CLEARED)
|
||||
{
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
BlockNumber block;
|
||||
Relation reln;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &block);
|
||||
reln = CreateFakeRelcacheEntry(rnode);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &block);
|
||||
reln = CreateFakeRelcacheEntry(rlocator);
|
||||
|
||||
visibilitymap_pin(reln, block, &vmbuffer);
|
||||
visibilitymap_clear(reln, block, vmbuffer, VISIBILITYMAP_ALL_FROZEN);
|
||||
@@ -9735,13 +9735,13 @@ heap_xlog_lock_updated(XLogReaderState *record)
|
||||
*/
|
||||
if (xlrec->flags & XLH_LOCK_ALL_FROZEN_CLEARED)
|
||||
{
|
||||
RelFileNode rnode;
|
||||
RelFileLocator rlocator;
|
||||
Buffer vmbuffer = InvalidBuffer;
|
||||
BlockNumber block;
|
||||
Relation reln;
|
||||
|
||||
XLogRecGetBlockTag(record, 0, &rnode, NULL, &block);
|
||||
reln = CreateFakeRelcacheEntry(rnode);
|
||||
XLogRecGetBlockTag(record, 0, &rlocator, NULL, &block);
|
||||
reln = CreateFakeRelcacheEntry(rlocator);
|
||||
|
||||
visibilitymap_pin(reln, block, &vmbuffer);
|
||||
visibilitymap_clear(reln, block, vmbuffer, VISIBILITYMAP_ALL_FROZEN);
|
||||
|
||||
@@ -566,11 +566,11 @@ tuple_lock_retry:
|
||||
*/
|
||||
|
||||
static void
|
||||
heapam_relation_set_new_filenode(Relation rel,
|
||||
const RelFileNode *newrnode,
|
||||
char persistence,
|
||||
TransactionId *freezeXid,
|
||||
MultiXactId *minmulti)
|
||||
heapam_relation_set_new_filelocator(Relation rel,
|
||||
const RelFileLocator *newrlocator,
|
||||
char persistence,
|
||||
TransactionId *freezeXid,
|
||||
MultiXactId *minmulti)
|
||||
{
|
||||
SMgrRelation srel;
|
||||
|
||||
@@ -591,7 +591,7 @@ heapam_relation_set_new_filenode(Relation rel,
|
||||
*/
|
||||
*minmulti = GetOldestMultiXactId();
|
||||
|
||||
srel = RelationCreateStorage(*newrnode, persistence, true);
|
||||
srel = RelationCreateStorage(*newrlocator, persistence, true);
|
||||
|
||||
/*
|
||||
* If required, set up an init fork for an unlogged table so that it can
|
||||
@@ -608,7 +608,7 @@ heapam_relation_set_new_filenode(Relation rel,
|
||||
rel->rd_rel->relkind == RELKIND_MATVIEW ||
|
||||
rel->rd_rel->relkind == RELKIND_TOASTVALUE);
|
||||
smgrcreate(srel, INIT_FORKNUM, false);
|
||||
log_smgrcreate(newrnode, INIT_FORKNUM);
|
||||
log_smgrcreate(newrlocator, INIT_FORKNUM);
|
||||
smgrimmedsync(srel, INIT_FORKNUM);
|
||||
}
|
||||
|
||||
@@ -622,11 +622,11 @@ heapam_relation_nontransactional_truncate(Relation rel)
|
||||
}
|
||||
|
||||
static void
|
||||
heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode)
|
||||
heapam_relation_copy_data(Relation rel, const RelFileLocator *newrlocator)
|
||||
{
|
||||
SMgrRelation dstrel;
|
||||
|
||||
dstrel = smgropen(*newrnode, rel->rd_backend);
|
||||
dstrel = smgropen(*newrlocator, rel->rd_backend);
|
||||
|
||||
/*
|
||||
* Since we copy the file directly without looking at the shared buffers,
|
||||
@@ -640,10 +640,10 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode)
|
||||
* Create and copy all forks of the relation, and schedule unlinking of
|
||||
* old physical files.
|
||||
*
|
||||
* NOTE: any conflict in relfilenode value will be caught in
|
||||
* NOTE: any conflict in relfilenumber value will be caught in
|
||||
* RelationCreateStorage().
|
||||
*/
|
||||
RelationCreateStorage(*newrnode, rel->rd_rel->relpersistence, true);
|
||||
RelationCreateStorage(*newrlocator, rel->rd_rel->relpersistence, true);
|
||||
|
||||
/* copy main fork */
|
||||
RelationCopyStorage(RelationGetSmgr(rel), dstrel, MAIN_FORKNUM,
|
||||
@@ -664,7 +664,7 @@ heapam_relation_copy_data(Relation rel, const RelFileNode *newrnode)
|
||||
if (RelationIsPermanent(rel) ||
|
||||
(rel->rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED &&
|
||||
forkNum == INIT_FORKNUM))
|
||||
log_smgrcreate(newrnode, forkNum);
|
||||
log_smgrcreate(newrlocator, forkNum);
|
||||
RelationCopyStorage(RelationGetSmgr(rel), dstrel, forkNum,
|
||||
rel->rd_rel->relpersistence);
|
||||
}
|
||||
@@ -2569,7 +2569,7 @@ static const TableAmRoutine heapam_methods = {
|
||||
.tuple_satisfies_snapshot = heapam_tuple_satisfies_snapshot,
|
||||
.index_delete_tuples = heap_index_delete_tuples,
|
||||
|
||||
.relation_set_new_filenode = heapam_relation_set_new_filenode,
|
||||
.relation_set_new_filelocator = heapam_relation_set_new_filelocator,
|
||||
.relation_nontransactional_truncate = heapam_relation_nontransactional_truncate,
|
||||
.relation_copy_data = heapam_relation_copy_data,
|
||||
.relation_copy_for_cluster = heapam_relation_copy_for_cluster,
|
||||
|
||||
@@ -318,7 +318,7 @@ end_heap_rewrite(RewriteState state)
|
||||
if (state->rs_buffer_valid)
|
||||
{
|
||||
if (RelationNeedsWAL(state->rs_new_rel))
|
||||
log_newpage(&state->rs_new_rel->rd_node,
|
||||
log_newpage(&state->rs_new_rel->rd_locator,
|
||||
MAIN_FORKNUM,
|
||||
state->rs_blockno,
|
||||
state->rs_buffer,
|
||||
@@ -679,7 +679,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
|
||||
|
||||
/* XLOG stuff */
|
||||
if (RelationNeedsWAL(state->rs_new_rel))
|
||||
log_newpage(&state->rs_new_rel->rd_node,
|
||||
log_newpage(&state->rs_new_rel->rd_locator,
|
||||
MAIN_FORKNUM,
|
||||
state->rs_blockno,
|
||||
page,
|
||||
@@ -742,7 +742,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
|
||||
* When doing logical decoding - which relies on using cmin/cmax of catalog
|
||||
* tuples, via xl_heap_new_cid records - heap rewrites have to log enough
|
||||
* information to allow the decoding backend to update its internal mapping
|
||||
* of (relfilenode,ctid) => (cmin, cmax) to be correct for the rewritten heap.
|
||||
* of (relfilelocator,ctid) => (cmin, cmax) to be correct for the rewritten heap.
|
||||
*
|
||||
* For that, every time we find a tuple that's been modified in a catalog
|
||||
* relation within the xmin horizon of any decoding slot, we log a mapping
|
||||
@@ -1080,9 +1080,9 @@ logical_rewrite_heap_tuple(RewriteState state, ItemPointerData old_tid,
|
||||
return;
|
||||
|
||||
/* fill out mapping information */
|
||||
map.old_node = state->rs_old_rel->rd_node;
|
||||
map.old_locator = state->rs_old_rel->rd_locator;
|
||||
map.old_tid = old_tid;
|
||||
map.new_node = state->rs_new_rel->rd_node;
|
||||
map.new_locator = state->rs_new_rel->rd_locator;
|
||||
map.new_tid = new_tid;
|
||||
|
||||
/* ---
|
||||
|
||||
@@ -283,7 +283,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
|
||||
if (XLogRecPtrIsInvalid(recptr))
|
||||
{
|
||||
Assert(!InRecovery);
|
||||
recptr = log_heap_visible(rel->rd_node, heapBuf, vmBuf,
|
||||
recptr = log_heap_visible(rel->rd_locator, heapBuf, vmBuf,
|
||||
cutoff_xid, flags);
|
||||
|
||||
/*
|
||||
@@ -668,7 +668,7 @@ vm_extend(Relation rel, BlockNumber vm_nblocks)
|
||||
* to keep checking for creation or extension of the file, which happens
|
||||
* infrequently.
|
||||
*/
|
||||
CacheInvalidateSmgr(reln->smgr_rnode);
|
||||
CacheInvalidateSmgr(reln->smgr_rlocator);
|
||||
|
||||
UnlockRelationForExtension(rel, ExclusiveLock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user