fix bug while alter dnode
This commit is contained in:
parent
b69e67bd7f
commit
1ebaa4e27a
|
@ -370,10 +370,11 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
|||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
||||
}
|
||||
|
||||
char* pMsg = pCmd->payload + tsRpcHeadSize;
|
||||
pMsg += sizeof(SMgmtHead);
|
||||
char* pMsg = pCmd->payload;
|
||||
|
||||
SCMCfgDnodeMsg* pCfg = (SCMCfgDnodeMsg*)pMsg;
|
||||
pDCL->a[0].n = strdequote(pDCL->a[0].z);
|
||||
|
||||
strncpy(pCfg->ep, pDCL->a[0].z, pDCL->a[0].n);
|
||||
|
||||
strncpy(pCfg->config, pDCL->a[1].z, pDCL->a[1].n);
|
||||
|
|
|
@ -1005,13 +1005,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
int32_t tscBuildCfgDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
pCmd->payloadLen = sizeof(SCMCfgDnodeMsg);
|
||||
|
||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
||||
tscError("%p failed to malloc for query msg", pSql);
|
||||
return TSDB_CODE_CLI_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
pCmd->msgType = TSDB_MSG_TYPE_MD_CONFIG_DNODE;
|
||||
pCmd->msgType = TSDB_MSG_TYPE_CM_CONFIG_DNODE;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1189,7 +1183,7 @@ int32_t tscBuildKillMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
int tscEstimateCreateTableMsgLength(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
SSqlCmd *pCmd = &(pSql->cmd);
|
||||
|
||||
int32_t size = minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMCreateTableMsg);
|
||||
int32_t size = minMsgSize() + sizeof(SCMCreateTableMsg);
|
||||
|
||||
SCreateTableSQL *pCreateTableInfo = pInfo->pCreateTableInfo;
|
||||
if (pCreateTableInfo->type == TSQL_CREATE_TABLE_FROM_STABLE) {
|
||||
|
@ -1277,7 +1271,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
|
||||
int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) {
|
||||
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
|
||||
return minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) +
|
||||
return minMsgSize() + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) +
|
||||
TSDB_EXTRA_PAYLOAD_SIZE;
|
||||
}
|
||||
|
||||
|
@ -1534,6 +1528,7 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
* no used 4B
|
||||
**/
|
||||
int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||
#if 0
|
||||
SSqlCmd *pCmd = &pSql->cmd;
|
||||
|
||||
// copy payload content to temp buff
|
||||
|
@ -1566,6 +1561,8 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
pCmd->payloadLen);
|
||||
|
||||
return pCmd->payloadLen;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
//static UNUSED_FUNC int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) {
|
||||
|
@ -1765,7 +1762,7 @@ int tscEstimateHeartBeatMsgLength(SSqlObj *pSql) {
|
|||
int size = 0;
|
||||
STscObj *pObj = pSql->pTscObj;
|
||||
|
||||
size += tsRpcHeadSize + sizeof(SMgmtHead);
|
||||
size += tsRpcHeadSize;
|
||||
size += sizeof(SQqueryList);
|
||||
|
||||
SSqlObj *tpSql = pObj->sqlList;
|
||||
|
@ -1801,13 +1798,9 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
pMsg = pCmd->payload + tsRpcHeadSize;
|
||||
pMsg = pCmd->payload;
|
||||
pStart = pMsg;
|
||||
|
||||
SMgmtHead *pMgmt = (SMgmtHead *)pMsg;
|
||||
strcpy(pMgmt->db, pObj->db);
|
||||
pMsg += sizeof(SMgmtHead);
|
||||
|
||||
pMsg = tscBuildQueryStreamDesc(pMsg, pObj);
|
||||
pthread_mutex_unlock(&pObj->mutex);
|
||||
|
||||
|
|
|
@ -204,10 +204,19 @@ static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
|
|||
|
||||
void taosSetAllDebugFlag() {
|
||||
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
|
||||
SGlobalCfg *cfg = &tsGlobalConfig[i];
|
||||
if ((cfg->cfgType & TSDB_CFG_CTYPE_B_LOG) && cfg->cfgType == TAOS_CFG_VTYPE_INT32) {
|
||||
*((int32_t*)cfg->ptr) = debugFlag;
|
||||
}
|
||||
mdebugFlag = debugFlag;
|
||||
sdbDebugFlag = debugFlag;
|
||||
dDebugFlag = debugFlag;
|
||||
vDebugFlag = debugFlag;
|
||||
cdebugFlag = debugFlag;
|
||||
jnidebugFlag = debugFlag;
|
||||
odbcdebugFlag = debugFlag;
|
||||
httpDebugFlag = debugFlag;
|
||||
monitorDebugFlag = debugFlag;
|
||||
rpcDebugFlag = debugFlag;
|
||||
uDebugFlag = debugFlag;
|
||||
sDebugFlag = debugFlag;
|
||||
//qdebugFlag = debugFlag;
|
||||
}
|
||||
uPrint("all debug flag are set to %d", debugFlag);
|
||||
}
|
||||
|
@ -1189,6 +1198,10 @@ void taosInitGlobalCfg() {
|
|||
}
|
||||
|
||||
bool taosCheckGlobalCfg() {
|
||||
if (debugFlag == 135 || debugFlag == 199) {
|
||||
taosSetAllDebugFlag();
|
||||
}
|
||||
|
||||
taosGetFqdn(tsLocalEp);
|
||||
sprintf(tsLocalEp + strlen(tsLocalEp), ":%d", tsServerPort);
|
||||
uPrint("localEp is %s", tsLocalEp);
|
||||
|
|
|
@ -137,7 +137,6 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -317,10 +317,6 @@ typedef struct {
|
|||
int8_t flag;
|
||||
} SCMCreateUserMsg, SCMAlterUserMsg;
|
||||
|
||||
typedef struct {
|
||||
char db[TSDB_TABLE_ID_LEN + 1];
|
||||
} SMgmtHead;
|
||||
|
||||
typedef struct {
|
||||
int32_t contLen;
|
||||
int32_t vgId;
|
||||
|
|
|
@ -252,7 +252,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
|
|||
}
|
||||
|
||||
static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
|
||||
mPrint("cfg vnode rsp is received, result:%s", tstrerror(rpcMsg->code));
|
||||
mPrint("cfg dnode rsp is received");
|
||||
}
|
||||
|
||||
void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
||||
|
|
|
@ -132,6 +132,7 @@ int32_t mgmtInitSystem() {
|
|||
|
||||
void mgmtCleanUpSystem() {
|
||||
mPrint("starting to clean up mgmt");
|
||||
tsMgmtIsRunning = false;
|
||||
mgmtCleanUpShell();
|
||||
mgmtCleanupServer();
|
||||
grantCleanUp();
|
||||
|
@ -144,7 +145,6 @@ void mgmtCleanUpSystem() {
|
|||
mgmtCleanupDnodes();
|
||||
mgmtCleanUpUsers();
|
||||
mgmtCleanUpAccts();
|
||||
tsMgmtIsRunning = false;
|
||||
mPrint("mgmt is cleaned up");
|
||||
}
|
||||
|
||||
|
|
|
@ -323,11 +323,19 @@ void sdbCleanUp() {
|
|||
if (tsSdbObj.status != SDB_STATUS_SERVING) return;
|
||||
|
||||
tsSdbObj.status = SDB_STATUS_CLOSING;
|
||||
|
||||
if (tsSdbObj.sync) {
|
||||
syncStop(tsSdbObj.sync);
|
||||
tsSdbObj.sync = NULL;
|
||||
}
|
||||
|
||||
if (tsSdbObj.wal) {
|
||||
walClose(tsSdbObj.wal);
|
||||
tsSdbObj.wal = NULL;
|
||||
}
|
||||
|
||||
sem_destroy(&tsSdbObj.sem);
|
||||
pthread_mutex_destroy(&tsSdbObj.mutex);
|
||||
memset(&tsSdbObj, 0, sizeof(tsSdbObj));
|
||||
}
|
||||
|
||||
void sdbIncRef(void *handle, void *pRow) {
|
||||
|
|
|
@ -27,21 +27,21 @@ cd ../../../debug; make
|
|||
./test.sh -f general/compress/compress2.sim
|
||||
./test.sh -f general/compress/uncompress.sim
|
||||
|
||||
#./test.sh -f general/compute/avg.sim
|
||||
./test.sh -f general/compute/avg.sim
|
||||
./test.sh -f general/compute/bottom.sim
|
||||
#./test.sh -f general/compute/count.sim
|
||||
./test.sh -f general/compute/count.sim
|
||||
./test.sh -f general/compute/diff.sim
|
||||
#./test.sh -f general/compute/diff2.sim
|
||||
#./test.sh -f general/compute/first.sim
|
||||
./test.sh -f general/compute/first.sim
|
||||
#./test.sh -f general/compute/interval.sim
|
||||
#./test.sh -f general/compute/last.sim
|
||||
#./test.sh -f general/compute/leastsquare.sim
|
||||
#./test.sh -f general/compute/max.sim
|
||||
#./test.sh -f general/compute/min.sim
|
||||
./test.sh -f general/compute/max.sim
|
||||
./test.sh -f general/compute/min.sim
|
||||
./test.sh -f general/compute/null.sim
|
||||
./test.sh -f general/compute/percentile.sim
|
||||
./test.sh -f general/compute/stddev.sim
|
||||
#./test.sh -f general/compute/sum.sim
|
||||
./test.sh -f general/compute/sum.sim
|
||||
./test.sh -f general/compute/top.sim
|
||||
|
||||
./test.sh -f general/db/basic.sim
|
||||
|
@ -109,7 +109,7 @@ cd ../../../debug; make
|
|||
# ./test.sh -f general/parser/auto_create_tb.sim
|
||||
# ./test.sh -f general/parser/auto_create_tb_drop_tb.sim
|
||||
./test.sh -f general/parser/binary_escapeCharacter.sim
|
||||
./test.sh -f general/parser/bug.sim
|
||||
#./test.sh -f general/parser/bug.sim
|
||||
./test.sh -f general/parser/col_arithmetic_operation.sim
|
||||
./test.sh -f general/parser/columnValue_bigint.sim
|
||||
./test.sh -f general/parser/columnValue_bool.sim
|
||||
|
|
|
@ -108,6 +108,7 @@ echo "udebugFlag 131" >> $TAOS_CFG
|
|||
echo "jnidebugFlag 131" >> $TAOS_CFG
|
||||
echo "sdebugFlag 135" >> $TAOS_CFG
|
||||
echo "monitor 0" >> $TAOS_CFG
|
||||
echo "monitorInterval 1" >> $TAOS_CFG
|
||||
echo "http 0" >> $TAOS_CFG
|
||||
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
|
||||
echo "defaultPass taosdata" >> $TAOS_CFG
|
||||
|
|
Loading…
Reference in New Issue