Skip to content

fix: meta abort clear cache #30672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/dnode/vnode/src/inc/vnodeInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ int metaAlterCache(SMeta* pMeta, int32_t nPage);
int32_t metaUidCacheClear(SMeta* pMeta, uint64_t suid);
int32_t metaTbGroupCacheClear(SMeta* pMeta, uint64_t suid);
int32_t metaRefDbsCacheClear(SMeta* pMeta, uint64_t suid);
void metaCacheClear(SMeta* pMeta);

int32_t metaAddIndexToSuperTable(SMeta* pMeta, int64_t version, SVCreateStbReq* pReq);
int32_t metaDropIndexFromSuperTable(SMeta* pMeta, int64_t version, SDropIndexReq* pReq);
Expand Down
7 changes: 7 additions & 0 deletions source/dnode/vnode/src/meta/metaCache.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@ int32_t metaUidFilterCachePut(void* pVnode, uint64_t suid, const void* pKey, int
return code;
}

void metaCacheClear(SMeta* pMeta) {
metaWLock(pMeta);
metaCacheClose(pMeta);
metaCacheOpen(pMeta);
metaULock(pMeta);
}

// remove the lru cache that are expired due to the tags value update, or creating, or dropping, of child tables
int32_t metaUidCacheClear(SMeta* pMeta, uint64_t suid) {
uint64_t p[4] = {0};
Expand Down
1 change: 1 addition & 0 deletions source/dnode/vnode/src/meta/metaCommit.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ int metaAbort(SMeta *pMeta) {
return 0;
}

metaCacheClear(pMeta);
tdbAbort(pMeta->pEnv, pMeta->txn);
pMeta->txn = NULL;
return 0;
Expand Down
Loading