提交 88c41382 编写于 作者: K kailixu

chore: use assign sver

上级 6dff0bca
...@@ -68,6 +68,7 @@ static int32_t tsSuperTableUpdateSize; ...@@ -68,6 +68,7 @@ static int32_t tsSuperTableUpdateSize;
typedef struct { typedef struct {
int32_t vgId; int32_t vgId;
int32_t tid; int32_t tid;
int32_t sversion;
uint64_t uid; uint64_t uid;
uint64_t suid; uint64_t suid;
} SMetaInfo; } SMetaInfo;
...@@ -2262,7 +2263,7 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, SMetaInfo *pInf) { ...@@ -2262,7 +2263,7 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, SMetaInfo *pInf) {
} }
} }
pTable->sversion = 0; pTable->sversion = htonl(pInf->sversion);
pTable->numOfColumns = htons(pCreate->numOfColumns); pTable->numOfColumns = htons(pCreate->numOfColumns);
pTable->sqlLen = htons(pCreate->sqlLen); pTable->sqlLen = htons(pCreate->sqlLen);
...@@ -2325,7 +2326,7 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf ...@@ -2325,7 +2326,7 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf
SCreateTableMsg *pCreate = (SCreateTableMsg *)((char *)pMsg->rpcMsg.pCont + sizeof(SCMCreateTableMsg)); SCreateTableMsg *pCreate = (SCreateTableMsg *)((char *)pMsg->rpcMsg.pCont + sizeof(SCMCreateTableMsg));
int32_t code = 0; int32_t code = 0;
// 0.db0._taos_meta_sync_cret_mndtb_taos_vgId.suid.uid.tid.tbName // 0.db0._taos_meta_sync_cret_mndtb_taos_vgId.suid.uid.tid.sversion.tbName
if (strstr(pCreate->tableName, META_SYNC_CRET_MNDTB)) { if (strstr(pCreate->tableName, META_SYNC_CRET_MNDTB)) {
code = TSDB_CODE_MND_INVALID_FORMAT; code = TSDB_CODE_MND_INVALID_FORMAT;
char realName[TSDB_TABLE_FNAME_LEN] = {0}; char realName[TSDB_TABLE_FNAME_LEN] = {0};
...@@ -2341,6 +2342,8 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf ...@@ -2341,6 +2342,8 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf
pInf->uid = strtoull(++pTbName, NULL, 10); pInf->uid = strtoull(++pTbName, NULL, 10);
if ((pTbName = strchr(pTbName, '.'))) { if ((pTbName = strchr(pTbName, '.'))) {
pInf->tid = atoi(++pTbName); pInf->tid = atoi(++pTbName);
if ((pTbName = strchr(pTbName, '.'))) {
pInf->sversion = atoi(++pTbName);
if ((pTbName = strchr(pTbName, '.'))) { if ((pTbName = strchr(pTbName, '.'))) {
int32_t len = strlen(realName); int32_t len = strlen(realName);
strncpy(realName + len, pTbName + 1, TSDB_TABLE_FNAME_LEN - len - 1); strncpy(realName + len, pTbName + 1, TSDB_TABLE_FNAME_LEN - len - 1);
...@@ -2351,6 +2354,7 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf ...@@ -2351,6 +2354,7 @@ static int32_t mnodeProcessMetaSyncCreateChildTableMsg(SMnodeMsg *pMsg, SMetaInf
} }
} }
} }
}
if (code != 0 || pInf->tid < 1 || pInf->uid == (uint64_t)-1 || pInf->vgId < 2) { if (code != 0 || pInf->tid < 1 || pInf->uid == (uint64_t)-1 || pInf->vgId < 2) {
code = TSDB_CODE_MND_INVALID_FORMAT; code = TSDB_CODE_MND_INVALID_FORMAT;
mError("%s:%d msg:%p, app:%p table:%s, failed to create table, reason:%s", __func__, __LINE__, pMsg, mError("%s:%d msg:%p, app:%p table:%s, failed to create table, reason:%s", __func__, __LINE__, pMsg,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册