vnode snapshot read

This commit is contained in:
yihaoDeng 2023-06-30 12:05:05 +00:00
parent 7d30a6e27a
commit 247d3ac7ee
2 changed files with 18 additions and 0 deletions

View File

@ -201,6 +201,23 @@ void streamBackendCleanup(void* arg) {
* checkpointInUse: |--cp2--|--cp4--|, checkpointDir in checkpointInUse do replicate trans, cannot del until
* replication is finished
*/
int32_t getLatestCheckpoint(void* arg, int64_t* checkpoint) {
SStreamMeta* pMeta = arg;
taosWLockLatch(&pMeta->checkpointDirLock);
int64_t tc = 0;
int32_t sz = taosArrayGetSize(pMeta->checkpointSaved);
if (sz <= 0) {
return -1;
} else {
tc = *(int64_t*)taosArrayGetLast(pMeta->checkpointSaved);
}
taosArrayPush(pMeta->checkpointInUse, &tc);
*checkpoint = tc;
taosWUnLockLatch(&pMeta->checkpointDirLock);
return 0;
}
int32_t delObsoleteCheckpoint(void* arg, const char* path) {
SStreamMeta* pMeta = arg;

View File

@ -146,6 +146,7 @@ void streamMetaClose(SStreamMeta* pMeta) {
taosArrayDestroy(pMeta->checkpointSaved);
taosArrayDestroy(pMeta->checkpointInUse);
taosMemoryFree(pMeta);
}