提交 4e9381fe 编写于 作者: K kailixu

fix: restore mnode table from vnode

上级 36d96ee6
......@@ -177,6 +177,7 @@ extern char tsLogDir[];
extern char tsScriptDir[];
extern int64_t tsTickPerDay[3];
extern int32_t tsTopicBianryLen;
extern int32_t tsMetaSyncOption;
// system info
extern char tsOsName[];
......
......@@ -232,6 +232,7 @@ int32_t tsKeepTimeOffset = 0;
int32_t tsDiskCfgNum = 0;
int32_t tsTopicBianryLen = 16000;
int32_t tsMetaSyncOption = 0;
#ifndef _STORAGE
SDiskCfg tsDiskCfg[1];
......
......@@ -131,6 +131,7 @@ STableCfg *tsdbCreateTableCfgFromMsg(SMDCreateTableMsg *pMsg);
int tsdbCreateTable(STsdbRepo *repo, STableCfg *pCfg);
int tsdbDropTable(STsdbRepo *pRepo, STableId tableId);
int tsdbUpdateTableTagValue(STsdbRepo *repo, SUpdateTableTagValMsg *pMsg);
int tsdbPrintTables(STsdbRepo *repo);
uint32_t tsdbGetFileInfo(STsdbRepo *repo, char *name, uint32_t *index, uint32_t eindex, int64_t *size);
......
......@@ -52,7 +52,6 @@
// informal
#define META_SYNC_TABLE_NAME "_taos_meta_sync_table_name_taos_"
#define META_SYNC_TABLE_NAME_LEN 32
static int32_t tsMetaSyncOption = 0;
// informal
int64_t tsCTableRid = -1;
......
......@@ -204,6 +204,20 @@ _err:
return -1;
}
int tsdbPrintTables(STsdbRepo *pRepo) {
STsdbMeta *pMeta = pRepo->tsdbMeta;
if (tsdbRLockRepoMeta(pRepo) < 0) return -1;
for (int32_t i = 0; i < pMeta->maxTables; ++i) {
if (pMeta->tables[i] != NULL) {
STable *pTable = pMeta->tables[i];
tsdbDebug("vgId:%d tbname:%s tid:%d uid:%" PRIu64, REPO_ID(pRepo), pTable->name->data, pTable->tableId.tid,
pTable->tableId.uid);
}
}
if (tsdbUnlockRepoMeta(pRepo) < 0) return -1;
return 0;
}
void *tsdbGetTableTagVal(const void* pTable, int32_t colId, int16_t type) {
// TODO: this function should be changed also
......@@ -224,7 +238,7 @@ void *tsdbGetTableTagVal(const void* pTable, int32_t colId, int16_t type) {
return val;
}
char *tsdbGetTableName(void* pTable) {
char *tsdbGetTableName(void *pTable) {
// TODO: need to change as thread-safe
if (pTable == NULL) {
......
......@@ -28,6 +28,7 @@
#include "qFilter.h"
#include "cJSON.h"
#define EXTRA_BYTES 2
#define ASCENDING_TRAVERSE(o) (o == TSDB_ORDER_ASC)
#define QH_GET_NUM_OF_COLS(handle) ((size_t)(taosArrayGetSize((handle)->pColumns)))
......@@ -2808,6 +2809,10 @@ int32_t tsdbGetFileBlocksDistInfo(TsdbQueryHandleT* queryHandle, STableBlockDist
tsdbFSIterSeek(&pQueryHandle->fileIter, fid);
tsdbUnLockFS(pFileHandle);
if(tsMetaSyncOption) {
tsdbPrintTables(pQueryHandle->pTsdb);
}
pTableBlockInfo->numOfFiles += 1;
int32_t code = TSDB_CODE_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册