Merge branch '3.0' into merge/mainto3.0
This commit is contained in:
commit
2c16747c40
|
@ -251,6 +251,7 @@ This document details the server error codes that may be encountered when using
|
||||||
| 0x80000529 | Vnode is stopped | Vnode is closed | Report issue |
|
| 0x80000529 | Vnode is stopped | Vnode is closed | Report issue |
|
||||||
| 0x80000530 | Duplicate write request | Duplicate write request, internal error | Report issue |
|
| 0x80000530 | Duplicate write request | Duplicate write request, internal error | Report issue |
|
||||||
| 0x80000531 | Vnode query is busy | Query is busy | Report issue |
|
| 0x80000531 | Vnode query is busy | Query is busy | Report issue |
|
||||||
|
| 0x80000540 | Vnode already exist but Dbid not match | Internal error | Report issue |
|
||||||
|
|
||||||
## tsdb
|
## tsdb
|
||||||
|
|
||||||
|
|
|
@ -261,6 +261,7 @@ description: TDengine 服务端的错误码列表和详细说明
|
||||||
| 0x80000529 | Vnode is stopped | Vnode 已经关闭 | 上报问题 |
|
| 0x80000529 | Vnode is stopped | Vnode 已经关闭 | 上报问题 |
|
||||||
| 0x80000530 | Duplicate write request | 重复写入请求,内部错误 | 上报问题 |
|
| 0x80000530 | Duplicate write request | 重复写入请求,内部错误 | 上报问题 |
|
||||||
| 0x80000531 | Vnode query is busy | 查询忙碌 | 上报问题 |
|
| 0x80000531 | Vnode query is busy | 查询忙碌 | 上报问题 |
|
||||||
|
| 0x80000540 | Vnode already exist but Dbid not match | 内部错误 | 上报问题 |
|
||||||
|
|
||||||
|
|
||||||
## tsdb
|
## tsdb
|
||||||
|
|
|
@ -565,6 +565,7 @@ int32_t taosGetErrSize();
|
||||||
#define TSDB_CODE_VND_ARB_NOT_SYNCED TAOS_DEF_ERROR_CODE(0, 0x0537) // internal
|
#define TSDB_CODE_VND_ARB_NOT_SYNCED TAOS_DEF_ERROR_CODE(0, 0x0537) // internal
|
||||||
#define TSDB_CODE_VND_WRITE_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0538) // internal
|
#define TSDB_CODE_VND_WRITE_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0538) // internal
|
||||||
#define TSDB_CODE_VND_TTL_FLUSH_INCOMPLETION TAOS_DEF_ERROR_CODE(0, 0x0539) // internal
|
#define TSDB_CODE_VND_TTL_FLUSH_INCOMPLETION TAOS_DEF_ERROR_CODE(0, 0x0539) // internal
|
||||||
|
#define TSDB_CODE_VND_ALREADY_EXIST_BUT_NOT_MATCH TAOS_DEF_ERROR_CODE(0, 0x0540)
|
||||||
|
|
||||||
// tsdb
|
// tsdb
|
||||||
#define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600)
|
#define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600)
|
||||||
|
|
|
@ -378,12 +378,11 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||||
|
|
||||||
snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, vnodeCfg.vgId);
|
snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, vnodeCfg.vgId);
|
||||||
|
|
||||||
if (vnodeCreate(path, &vnodeCfg, diskPrimary, pMgmt->pTfs) < 0) {
|
if ((code = vnodeCreate(path, &vnodeCfg, diskPrimary, pMgmt->pTfs)) < 0) {
|
||||||
dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr());
|
dError("vgId:%d, failed to create vnode since %s", req.vgId, tstrerror(code));
|
||||||
vmReleaseVnode(pMgmt, pVnode);
|
vmReleaseVnode(pMgmt, pVnode);
|
||||||
vmCleanPrimaryDisk(pMgmt, req.vgId);
|
vmCleanPrimaryDisk(pMgmt, req.vgId);
|
||||||
(void)tFreeSCreateVnodeReq(&req);
|
(void)tFreeSCreateVnodeReq(&req);
|
||||||
code = terrno != 0 ? terrno : -1;
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ static void vmUnRegisterCreatingState(SVnodeMgmt *pMgmt, int32_t vgId) {
|
||||||
dTrace("vgId:%d, remove from creating Hash", vgId);
|
dTrace("vgId:%d, remove from creating Hash", vgId);
|
||||||
r = taosHashRemove(pMgmt->creatingHash, &vgId, sizeof(int32_t));
|
r = taosHashRemove(pMgmt->creatingHash, &vgId, sizeof(int32_t));
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
dError("vgId:%d, failed to remove vnode from hash", vgId);
|
dError("vgId:%d, failed to remove vnode from creatingHash", vgId);
|
||||||
}
|
}
|
||||||
(void)taosThreadRwlockUnlock(&pMgmt->lock);
|
(void)taosThreadRwlockUnlock(&pMgmt->lock);
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,7 @@ static int32_t metaOpenImpl(SVnode *pVnode, SMeta **ppMeta, const char *metaDir,
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t lino;
|
int32_t lino;
|
||||||
int32_t offset;
|
int32_t offset;
|
||||||
|
int32_t pathLen = 0;
|
||||||
char path[TSDB_FILENAME_LEN] = {0};
|
char path[TSDB_FILENAME_LEN] = {0};
|
||||||
char indexFullPath[128] = {0};
|
char indexFullPath[128] = {0};
|
||||||
|
|
||||||
|
@ -150,14 +151,15 @@ static int32_t metaOpenImpl(SVnode *pVnode, SMeta **ppMeta, const char *metaDir,
|
||||||
taosRemoveDir(path);
|
taosRemoveDir(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pMeta = taosMemoryCalloc(1, sizeof(*pMeta) + strlen(path) + 1)) == NULL) {
|
pathLen = strlen(path) + 1;
|
||||||
|
if ((pMeta = taosMemoryCalloc(1, sizeof(*pMeta) + pathLen)) == NULL) {
|
||||||
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
TSDB_CHECK_CODE(code = terrno, lino, _exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
metaInitLock(pMeta);
|
metaInitLock(pMeta);
|
||||||
|
|
||||||
pMeta->path = (char *)&pMeta[1];
|
pMeta->path = (char *)&pMeta[1];
|
||||||
strcpy(pMeta->path, path);
|
tstrncpy(pMeta->path, path, pathLen);
|
||||||
int32_t ret = taosRealPath(pMeta->path, NULL, strlen(path) + 1);
|
int32_t ret = taosRealPath(pMeta->path, NULL, strlen(path) + 1);
|
||||||
|
|
||||||
pMeta->pVnode = pVnode;
|
pMeta->pVnode = pVnode;
|
||||||
|
|
|
@ -1189,7 +1189,7 @@ int metaCreateTable(SMeta *pMeta, int64_t ver, SVCreateTbReq *pReq, STableMetaRs
|
||||||
(*pMetaRsp)->tableType = TSDB_CHILD_TABLE;
|
(*pMetaRsp)->tableType = TSDB_CHILD_TABLE;
|
||||||
(*pMetaRsp)->tuid = pReq->uid;
|
(*pMetaRsp)->tuid = pReq->uid;
|
||||||
(*pMetaRsp)->suid = pReq->ctb.suid;
|
(*pMetaRsp)->suid = pReq->ctb.suid;
|
||||||
strcpy((*pMetaRsp)->tbName, pReq->name);
|
tstrncpy((*pMetaRsp)->tbName, pReq->name, strlen(pReq->name) + 1);
|
||||||
} else {
|
} else {
|
||||||
ret = metaUpdateMetaRsp(pReq->uid, pReq->name, &pReq->ntb.schemaRow, *pMetaRsp);
|
ret = metaUpdateMetaRsp(pReq->uid, pReq->name, &pReq->ntb.schemaRow, *pMetaRsp);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -1834,7 +1834,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].type = pAlterTbReq->type;
|
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].type = pAlterTbReq->type;
|
||||||
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].flags = pAlterTbReq->flags;
|
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].flags = pAlterTbReq->flags;
|
||||||
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].colId = entry.ntbEntry.ncid++;
|
pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].colId = entry.ntbEntry.ncid++;
|
||||||
strcpy(pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].name, pAlterTbReq->colName);
|
tstrncpy(pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1].name, pAlterTbReq->colName,
|
||||||
|
strlen(pAlterTbReq->colName) + 1);
|
||||||
|
|
||||||
++pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
++pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
||||||
metaTimeSeriesNotifyCheck(pMeta);
|
metaTimeSeriesNotifyCheck(pMeta);
|
||||||
|
@ -1943,7 +1944,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
pSchema->version++;
|
pSchema->version++;
|
||||||
strcpy(pColumn->name, pAlterTbReq->colNewName);
|
tstrncpy(pColumn->name, pAlterTbReq->colNewName, strlen(pAlterTbReq->colNewName) + 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,18 +49,20 @@ const char *ttlV1Tbname = "ttlv1.idx";
|
||||||
int32_t ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *logPrefix, int32_t flushThreshold) {
|
int32_t ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *logPrefix, int32_t flushThreshold) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
int64_t startNs = taosGetTimestampNs();
|
int64_t startNs = taosGetTimestampNs();
|
||||||
|
int32_t pathLen = 0;
|
||||||
|
|
||||||
*ppTtlMgr = NULL;
|
*ppTtlMgr = NULL;
|
||||||
|
|
||||||
STtlManger *pTtlMgr = (STtlManger *)tdbOsCalloc(1, sizeof(*pTtlMgr));
|
STtlManger *pTtlMgr = (STtlManger *)tdbOsCalloc(1, sizeof(*pTtlMgr));
|
||||||
if (pTtlMgr == NULL) TAOS_RETURN(terrno);
|
if (pTtlMgr == NULL) TAOS_RETURN(terrno);
|
||||||
|
|
||||||
char *logBuffer = (char *)tdbOsCalloc(1, strlen(logPrefix) + 1);
|
pathLen = strlen(logPrefix) + 1;
|
||||||
|
char *logBuffer = (char *)tdbOsCalloc(1, pathLen);
|
||||||
if (logBuffer == NULL) {
|
if (logBuffer == NULL) {
|
||||||
tdbOsFree(pTtlMgr);
|
tdbOsFree(pTtlMgr);
|
||||||
TAOS_RETURN(terrno);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
(void)strcpy(logBuffer, logPrefix);
|
tstrncpy(logBuffer, logPrefix, pathLen);
|
||||||
pTtlMgr->logPrefix = logBuffer;
|
pTtlMgr->logPrefix = logBuffer;
|
||||||
pTtlMgr->flushThreshold = flushThreshold;
|
pTtlMgr->flushThreshold = flushThreshold;
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,17 @@ int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs
|
||||||
SVnodeInfo oldInfo = {0};
|
SVnodeInfo oldInfo = {0};
|
||||||
oldInfo.config = vnodeCfgDefault;
|
oldInfo.config = vnodeCfgDefault;
|
||||||
if (vnodeLoadInfo(dir, &oldInfo) == 0) {
|
if (vnodeLoadInfo(dir, &oldInfo) == 0) {
|
||||||
vWarn("vgId:%d, vnode config info already exists at %s.", oldInfo.config.vgId, dir);
|
code = (oldInfo.config.dbId == info.config.dbId) ? 0 : TSDB_CODE_VND_ALREADY_EXIST_BUT_NOT_MATCH;
|
||||||
return (oldInfo.config.dbId == info.config.dbId) ? 0 : -1;
|
if (code == 0) {
|
||||||
|
vWarn("vgId:%d, vnode config info already exists at %s.", oldInfo.config.vgId, dir);
|
||||||
|
} else {
|
||||||
|
vError("vgId:%d, vnode config info already exists at %s. oldDbId:%" PRId64 "(%s) at cluster:%" PRId64
|
||||||
|
", newDbId:%" PRId64 "(%s) at cluser:%" PRId64 ", code:%s",
|
||||||
|
oldInfo.config.vgId, dir, oldInfo.config.dbId, oldInfo.config.dbname,
|
||||||
|
oldInfo.config.syncCfg.nodeInfo[oldInfo.config.syncCfg.myIndex].clusterId, info.config.dbId,
|
||||||
|
info.config.dbname, info.config.syncCfg.nodeInfo[info.config.syncCfg.myIndex].clusterId, tstrerror(code));
|
||||||
|
}
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
vInfo("vgId:%d, save config while create", info.config.vgId);
|
vInfo("vgId:%d, save config while create", info.config.vgId);
|
||||||
|
|
|
@ -1017,11 +1017,11 @@ int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TA
|
||||||
if (NULL == tags) {
|
if (NULL == tags) {
|
||||||
return TSDB_CODE_APP_ERROR;
|
return TSDB_CODE_APP_ERROR;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (pDataBlock->pMeta->tableType != TSDB_SUPER_TABLE && pDataBlock->pMeta->tableType != TSDB_CHILD_TABLE) {
|
if (pDataBlock->pMeta->tableType != TSDB_SUPER_TABLE && pDataBlock->pMeta->tableType != TSDB_CHILD_TABLE) {
|
||||||
return TSDB_CODE_TSC_STMT_API_ERROR;
|
return TSDB_CODE_TSC_STMT_API_ERROR;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
SSchema* pSchema = getTableTagSchema(pDataBlock->pMeta);
|
SSchema* pSchema = getTableTagSchema(pDataBlock->pMeta);
|
||||||
if (tags->numOfBound <= 0) {
|
if (tags->numOfBound <= 0) {
|
||||||
*fieldNum = 0;
|
*fieldNum = 0;
|
||||||
|
|
|
@ -443,6 +443,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_ARB_NOT_SYNCED, "Vgroup peer is not sy
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_VND_WRITE_DISABLED, "Vnode write is disabled for snapshot")
|
TAOS_DEFINE_ERROR(TSDB_CODE_VND_WRITE_DISABLED, "Vnode write is disabled for snapshot")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_VND_COLUMN_COMPRESS_ALREADY_EXIST,"Same with old param")
|
TAOS_DEFINE_ERROR(TSDB_CODE_VND_COLUMN_COMPRESS_ALREADY_EXIST,"Same with old param")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_VND_TTL_FLUSH_INCOMPLETION, "Failed to flush all ttl modification to tdb")
|
TAOS_DEFINE_ERROR(TSDB_CODE_VND_TTL_FLUSH_INCOMPLETION, "Failed to flush all ttl modification to tdb")
|
||||||
|
TAOS_DEFINE_ERROR(TSDB_CODE_VND_ALREADY_EXIST_BUT_NOT_MATCH, "Vnode already exist but Dbid not match")
|
||||||
|
|
||||||
|
|
||||||
// tsdb
|
// tsdb
|
||||||
|
|
Loading…
Reference in New Issue