fix: wrong table number statistics (#32391)

This commit is contained in:
Hongze Cheng 2025-07-31 15:48:24 +08:00 committed by GitHub
parent 1dd958c7f2
commit cbadf47e5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -275,6 +275,17 @@ void vnodeGetMetaPath(SVnode *pVnode, const char *metaDir, char *fname) {
bool generateNewMeta = false;
static void metaResetStatisInfo(SMeta *pMeta) {
pMeta->pVnode->config.vndStats.numOfSTables = 0;
pMeta->pVnode->config.vndStats.numOfCTables = 0;
pMeta->pVnode->config.vndStats.numOfNTables = 0;
pMeta->pVnode->config.vndStats.numOfVTables = 0;
pMeta->pVnode->config.vndStats.numOfVCTables = 0;
pMeta->pVnode->config.vndStats.numOfNTimeSeries = 0;
pMeta->pVnode->config.vndStats.numOfTimeSeries = 0;
pMeta->pVnode->config.vndStats.numOfTimeSeries = 0;
}
static int32_t metaGenerateNewMeta(SMeta **ppMeta) {
SMeta *pNewMeta = NULL;
SMeta *pMeta = *ppMeta;
@ -282,6 +293,9 @@ static int32_t metaGenerateNewMeta(SMeta **ppMeta) {
metaInfo("vgId:%d start to generate new meta", TD_VID(pMeta->pVnode));
// Reset statistics info
metaResetStatisInfo(pMeta);
// Open a new meta for organization
int32_t code = metaOpenImpl(pMeta->pVnode, &pNewMeta, VNODE_META_TMP_DIR, false);
if (code) {