diff options
Diffstat (limited to 'contrib/pg_prewarm/autoprewarm.c')
| -rw-r--r-- | contrib/pg_prewarm/autoprewarm.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index c0c4f5d9ca..13eee4a137 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -52,7 +52,7 @@ #include "utils/guc.h" #include "utils/memutils.h" #include "utils/rel.h" -#include "utils/relfilenodemap.h" +#include "utils/relfilenumbermap.h" #include "utils/resowner.h" #define AUTOPREWARM_FILE "autoprewarm.blocks" @@ -62,7 +62,7 @@ typedef struct BlockInfoRecord { Oid database; Oid tablespace; - Oid filenode; + RelFileNumber filenumber; ForkNumber forknum; BlockNumber blocknum; } BlockInfoRecord; @@ -347,7 +347,7 @@ apw_load_buffers(void) unsigned forknum; if (fscanf(file, "%u,%u,%u,%u,%u\n", &blkinfo[i].database, - &blkinfo[i].tablespace, &blkinfo[i].filenode, + &blkinfo[i].tablespace, &blkinfo[i].filenumber, &forknum, &blkinfo[i].blocknum) != 5) ereport(ERROR, (errmsg("autoprewarm block dump file is corrupted at line %d", @@ -494,7 +494,7 @@ autoprewarm_database_main(Datum main_arg) * relation. Note that rel will be NULL if try_relation_open failed * previously; in that case, there is nothing to close. */ - if (old_blk != NULL && old_blk->filenode != blk->filenode && + if (old_blk != NULL && old_blk->filenumber != blk->filenumber && rel != NULL) { relation_close(rel, AccessShareLock); @@ -506,13 +506,13 @@ autoprewarm_database_main(Datum main_arg) * Try to open each new relation, but only once, when we first * encounter it. If it's been dropped, skip the associated blocks. */ - if (old_blk == NULL || old_blk->filenode != blk->filenode) + if (old_blk == NULL || old_blk->filenumber != blk->filenumber) { Oid reloid; Assert(rel == NULL); StartTransactionCommand(); - reloid = RelidByRelfilenode(blk->tablespace, blk->filenode); + reloid = RelidByRelfilenumber(blk->tablespace, blk->filenumber); if (OidIsValid(reloid)) rel = try_relation_open(reloid, AccessShareLock); @@ -527,7 +527,7 @@ autoprewarm_database_main(Datum main_arg) /* Once per fork, check for fork existence and size. */ if (old_blk == NULL || - old_blk->filenode != blk->filenode || + old_blk->filenumber != blk->filenumber || old_blk->forknum != blk->forknum) { /* @@ -631,9 +631,9 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged) if (buf_state & BM_TAG_VALID && ((buf_state & BM_PERMANENT) || dump_unlogged)) { - block_info_array[num_blocks].database = bufHdr->tag.rnode.dbNode; - block_info_array[num_blocks].tablespace = bufHdr->tag.rnode.spcNode; - block_info_array[num_blocks].filenode = bufHdr->tag.rnode.relNode; + block_info_array[num_blocks].database = bufHdr->tag.rlocator.dbOid; + block_info_array[num_blocks].tablespace = bufHdr->tag.rlocator.spcOid; + block_info_array[num_blocks].filenumber = bufHdr->tag.rlocator.relNumber; block_info_array[num_blocks].forknum = bufHdr->tag.forkNum; block_info_array[num_blocks].blocknum = bufHdr->tag.blockNum; ++num_blocks; @@ -671,7 +671,7 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged) ret = fprintf(file, "%u,%u,%u,%u,%u\n", block_info_array[i].database, block_info_array[i].tablespace, - block_info_array[i].filenode, + block_info_array[i].filenumber, (uint32) block_info_array[i].forknum, block_info_array[i].blocknum); if (ret < 0) @@ -900,7 +900,7 @@ do { \ * We depend on all records for a particular database being consecutive * in the dump file; each per-database worker will preload blocks until * it sees a block for some other database. Sorting by tablespace, - * filenode, forknum, and blocknum isn't critical for correctness, but + * filenumber, forknum, and blocknum isn't critical for correctness, but * helps us get a sequential I/O pattern. */ static int @@ -911,7 +911,7 @@ apw_compare_blockinfo(const void *p, const void *q) cmp_member_elem(database); cmp_member_elem(tablespace); - cmp_member_elem(filenode); + cmp_member_elem(filenumber); cmp_member_elem(forknum); cmp_member_elem(blocknum); |
