提交 ed9d34a3 编写于 作者: C Cary Xu

update

上级 d35ca7c2
...@@ -30,6 +30,7 @@ typedef struct { ...@@ -30,6 +30,7 @@ typedef struct {
SArray * aBlkIdx; SArray * aBlkIdx;
SArray * aSupBlk; SArray * aSupBlk;
SDataCols *pDataCols; SDataCols *pDataCols;
void * param; // STruncateTblMsg *pMsg
} STruncateH; } STruncateH;
#define TSDB_TRUNCATE_WSET(pTruncateH) (&((pTruncateH)->wSet)) #define TSDB_TRUNCATE_WSET(pTruncateH) (&((pTruncateH)->wSet))
...@@ -71,7 +72,6 @@ int tsdbTruncate(STsdbRepo *pRepo, void *param) { return tsdbAsyncTruncate(pRepo ...@@ -71,7 +72,6 @@ int tsdbTruncate(STsdbRepo *pRepo, void *param) { return tsdbAsyncTruncate(pRepo
void *tsdbTruncateImpl(STsdbRepo *pRepo, void *param) { void *tsdbTruncateImpl(STsdbRepo *pRepo, void *param) {
int32_t code = 0; int32_t code = 0;
// Step 1: check and clear cache // Step 1: check and clear cache
if ((code = tsdbTruncateCache(pRepo, param)) != 0) { if ((code = tsdbTruncateCache(pRepo, param)) != 0) {
pRepo->code = terrno; pRepo->code = terrno;
...@@ -177,11 +177,13 @@ static int tsdbTruncateMeta(STsdbRepo *pRepo) { ...@@ -177,11 +177,13 @@ static int tsdbTruncateMeta(STsdbRepo *pRepo) {
static int tsdbTruncateTSData(STsdbRepo *pRepo, void *param) { static int tsdbTruncateTSData(STsdbRepo *pRepo, void *param) {
STsdbCfg * pCfg = REPO_CFG(pRepo); STsdbCfg * pCfg = REPO_CFG(pRepo);
STruncateH truncateH; STruncateH truncateH = {0};
SDFileSet * pSet = NULL; SDFileSet * pSet = NULL;
STruncateTblMsg *pMsg = (STruncateTblMsg *)param; STruncateTblMsg *pMsg = (STruncateTblMsg *)param;
ASSERT(pMsg != NULL); ASSERT(pMsg != NULL);
truncateH.param = pMsg;
tsdbDebug("vgId:%d start to truncate TS data for %" PRIu64, REPO_ID(pRepo), pMsg->uid); tsdbDebug("vgId:%d start to truncate TS data for %" PRIu64, REPO_ID(pRepo), pMsg->uid);
if (tsdbInitTruncateH(&truncateH, pRepo) < 0) { if (tsdbInitTruncateH(&truncateH, pRepo) < 0) {
...@@ -230,7 +232,7 @@ static int tsdbTruncateTSData(STsdbRepo *pRepo, void *param) { ...@@ -230,7 +232,7 @@ static int tsdbTruncateTSData(STsdbRepo *pRepo, void *param) {
static int tsdbTruncateFSet(STruncateH *pTruncateH, SDFileSet *pSet) { static int tsdbTruncateFSet(STruncateH *pTruncateH, SDFileSet *pSet) {
STsdbRepo *pRepo = TSDB_TRUNCATE_REPO(pTruncateH); STsdbRepo *pRepo = TSDB_TRUNCATE_REPO(pTruncateH);
SDiskID did; SDiskID did = {0};
tsdbDebug("vgId:%d start to truncate FSET %d on level %d id %d", REPO_ID(pRepo), pSet->fid, TSDB_FSET_LEVEL(pSet), tsdbDebug("vgId:%d start to truncate FSET %d on level %d id %d", REPO_ID(pRepo), pSet->fid, TSDB_FSET_LEVEL(pSet),
TSDB_FSET_ID(pSet)); TSDB_FSET_ID(pSet));
...@@ -422,7 +424,8 @@ static int tsdbTruncateFSetInit(STruncateH *pTruncateH, SDFileSet *pSet) { ...@@ -422,7 +424,8 @@ static int tsdbTruncateFSetInit(STruncateH *pTruncateH, SDFileSet *pSet) {
static void tsdbTruncateFSetEnd(STruncateH *pTruncateH) { tsdbCloseAndUnsetFSet(&(pTruncateH->readh)); } static void tsdbTruncateFSetEnd(STruncateH *pTruncateH) { tsdbCloseAndUnsetFSet(&(pTruncateH->readh)); }
static int tsdbTruncateFSetImpl(STruncateH *pTruncateH) { static int tsdbTruncateFSetImpl(STruncateH *pTruncateH) {
STsdbRepo *pRepo = TSDB_TRUNCATE_REPO(pTruncateH); STsdbRepo * pRepo = TSDB_TRUNCATE_REPO(pTruncateH);
STruncateTblMsg *pMsg = (STruncateTblMsg *)pTruncateH->param;
STsdbCfg * pCfg = REPO_CFG(pRepo); STsdbCfg * pCfg = REPO_CFG(pRepo);
SReadH * pReadh = &(pTruncateH->readh); SReadH * pReadh = &(pTruncateH->readh);
SBlockIdx blkIdx = {0}; SBlockIdx blkIdx = {0};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册