提交 7427a37f 编写于 作者: K kailixu

chore: meta sync

上级 ea3f0289
...@@ -232,7 +232,7 @@ int32_t tsKeepTimeOffset = 0; ...@@ -232,7 +232,7 @@ int32_t tsKeepTimeOffset = 0;
int32_t tsDiskCfgNum = 0; int32_t tsDiskCfgNum = 0;
int32_t tsTopicBianryLen = 16000; int32_t tsTopicBianryLen = 16000;
int32_t tsMetaSyncOption = 0; int32_t tsMetaSyncOption = 1;
#ifndef _STORAGE #ifndef _STORAGE
SDiskCfg tsDiskCfg[1]; SDiskCfg tsDiskCfg[1];
......
...@@ -222,6 +222,8 @@ int32_t* taosGetErrno(); ...@@ -222,6 +222,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_INVALID_TOPIC_PARTITONS TAOS_DEF_ERROR_CODE(0, 0x0394) //"Invalid topic partitons num, valid range: [1, 1000]) #define TSDB_CODE_MND_INVALID_TOPIC_PARTITONS TAOS_DEF_ERROR_CODE(0, 0x0394) //"Invalid topic partitons num, valid range: [1, 1000])
#define TSDB_CODE_MND_TOPIC_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0395) //"Topic already exists) #define TSDB_CODE_MND_TOPIC_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0395) //"Topic already exists)
#define TSDB_CODE_MND_INVALID_FORMAT TAOS_DEF_ERROR_CODE(0, 0x0396) //"Invalid format)
// dnode // dnode
#define TSDB_CODE_DND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0400) //"Message not processed" #define TSDB_CODE_DND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0400) //"Message not processed"
#define TSDB_CODE_DND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0401) //"Dnode out of memory" #define TSDB_CODE_DND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0401) //"Dnode out of memory"
......
此差异已折叠。
...@@ -459,16 +459,23 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi ...@@ -459,16 +459,23 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
continue; continue;
} }
int32_t sid = taosAllocateId(pVgroup->idPool); int32_t sid = 0;
if (sid <= 0) { if (*pSid <= 0) {
int curMaxId = taosIdPoolMaxSize(pVgroup->idPool); sid = taosAllocateId(pVgroup->idPool);
if ((taosUpdateIdPool(pVgroup->idPool, curMaxId + 1) < 0) || ((sid = taosAllocateId(pVgroup->idPool)) <= 0)) { if (sid <= 0) {
mError("msg:%p, app:%p db:%s, no enough sid in vgId:%d", pMsg, pMsg->rpcMsg.ahandle, pDb->name, int curMaxId = taosIdPoolMaxSize(pVgroup->idPool);
pVgroup->vgId); if ((taosUpdateIdPool(pVgroup->idPool, curMaxId + 1) < 0) || ((sid = taosAllocateId(pVgroup->idPool)) <= 0)) {
pthread_mutex_unlock(&pDb->mutex); mError("msg:%p, app:%p db:%s, no enough sid in vgId:%d", pMsg, pMsg->rpcMsg.ahandle, pDb->name,
return TSDB_CODE_MND_APP_ERROR; pVgroup->vgId);
pthread_mutex_unlock(&pDb->mutex);
return TSDB_CODE_MND_APP_ERROR;
}
} }
} else {
} }
mDebug("vgId:%d, alloc tid:%d", pVgroup->vgId, sid); mDebug("vgId:%d, alloc tid:%d", pVgroup->vgId, sid);
*pSid = sid; *pSid = sid;
......
...@@ -219,10 +219,10 @@ int tsdbDumpTables(STsdbRepo *pRepo, uint64_t qId) { ...@@ -219,10 +219,10 @@ int tsdbDumpTables(STsdbRepo *pRepo, uint64_t qId) {
for (int32_t i = 0; i < pMeta->maxTables; ++i) { for (int32_t i = 0; i < pMeta->maxTables; ++i) {
if (pMeta->tables[i] != NULL) { if (pMeta->tables[i] != NULL) {
STable *pTable = pMeta->tables[i]; STable *pTable = pMeta->tables[i];
// keep the output format // keep the output format
tsdbInfo("vgId:%d QID:%" PRIu64 " stb:%s %s:%s tid:%d uid:%" PRIu64, REPO_ID(pRepo), qId, tsdbInfo("vgId:%d, type:%d stb:%s suid:%" PRIu64 " %s:%s tid:%d uid:%" PRIu64, REPO_ID(pRepo), pTable->type,
pTable->pSuper ? pTable->pSuper->name->data : "", "msynctbn", pTable->name->data, pTable->tableId.tid, pTable->pSuper ? pTable->pSuper->name->data : "", pTable->suid, "msynctbn", pTable->name->data,
pTable->tableId.uid); pTable->tableId.tid, pTable->tableId.uid);
} }
} }
if (tsdbUnlockRepoMeta(pRepo) < 0) return -1; if (tsdbUnlockRepoMeta(pRepo) < 0) return -1;
...@@ -1486,7 +1486,7 @@ static void *tsdbDecodeTable(void *buf, STable **pRTable) { ...@@ -1486,7 +1486,7 @@ static void *tsdbDecodeTable(void *buf, STable **pRTable) {
tsdbFreeTable(pTable); tsdbFreeTable(pTable);
return NULL; return NULL;
} }
taosHashSetFreeFp(pTable->jsonKeyMap, taosArrayDestroyForHash); taosHashSetFreeFp(pTable->jsonKeyMap, taosArrayDestroyForHash);
}else{ }else{
pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), NULL, pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), NULL,
SL_ALLOW_DUP_KEY, getTagIndexKey); SL_ALLOW_DUP_KEY, getTagIndexKey);
......
...@@ -229,6 +229,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC_OPTION, "Invalid topic option" ...@@ -229,6 +229,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC_OPTION, "Invalid topic option"
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC_PARTITONS, "Invalid topic partitons num, valid range: [1, 1000]") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_TOPIC_PARTITONS, "Invalid topic partitons num, valid range: [1, 1000]")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOPIC_ALREADY_EXIST, "Topic already exists") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOPIC_ALREADY_EXIST, "Topic already exists")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_FORMAT, "Invalid format")
// dnode // dnode
TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, "Message not processed") TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, "Message not processed")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, "Dnode out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, "Dnode out of memory")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册