!182 fix #I7DRYV

Merge pull request !182 from shipixian/dev_performance
This commit is contained in:
shenzhengntu 2023-06-27 05:47:09 +00:00 committed by Gitee
commit 921e276375
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 26 additions and 0 deletions

View File

@ -91,6 +91,7 @@
#include "access/xlog.h"
#include "miscadmin.h"
#include "port/pg_bitutils.h"
#include "postmaster/secondbuffer.h"
#include "storage/bufmgr.h"
#include "storage/lmgr.h"
#include "storage/smgr.h"
@ -656,6 +657,18 @@ vm_extend(Relation rel, BlockNumber vm_nblocks)
smgrextend(rel->rd_smgr, VISIBILITYMAP_FORKNUM, vm_nblocks_now,
pg.data, false);
if (!(InitdbSingle || IsBootstrapProcessingMode() == true) && !push_standby && !he3mirror)
{
PageKey pageKey;
pageKey.relfileNode.dbNode = rel->rd_smgr->smgr_rnode.node.dbNode;
pageKey.relfileNode.relNode = rel->rd_smgr->smgr_rnode.node.relNode;
pageKey.blkNo = vm_nblocks_now;
pageKey.forkNo = VISIBILITYMAP_FORKNUM;
pageKey.pageLsn = 0;
ReceivePageFromDataBuffer(&pageKey, (uint8_t *) pg.data);
}
vm_nblocks_now++;
}

View File

@ -30,6 +30,7 @@
#include "storage/fsm_internals.h"
#include "storage/lmgr.h"
#include "storage/smgr.h"
#include "postmaster/secondbuffer.h"
/*
@ -641,6 +642,18 @@ fsm_extend(Relation rel, BlockNumber fsm_nblocks)
smgrextend(rel->rd_smgr, FSM_FORKNUM, fsm_nblocks_now,
pg.data, false);
if (!(InitdbSingle || IsBootstrapProcessingMode() == true) && !push_standby && !he3mirror)
{
PageKey pageKey;
pageKey.relfileNode.dbNode = rel->rd_smgr->smgr_rnode.node.dbNode;
pageKey.relfileNode.relNode = rel->rd_smgr->smgr_rnode.node.relNode;
pageKey.blkNo = fsm_nblocks_now;
pageKey.forkNo = FSM_FORKNUM;
pageKey.pageLsn = 0;
ReceivePageFromDataBuffer(&pageKey, (uint8_t *) pg.data);
}
fsm_nblocks_now++;
}