提交 2db5df4c 编写于 作者: S Shengliang Guan

TD-2498

上级 950dd612
...@@ -101,7 +101,8 @@ extern int32_t tsAlternativeRole; ...@@ -101,7 +101,8 @@ extern int32_t tsAlternativeRole;
extern int32_t tsBalanceInterval; extern int32_t tsBalanceInterval;
extern int32_t tsOfflineThreshold; extern int32_t tsOfflineThreshold;
extern int32_t tsMnodeEqualVnodeNum; extern int32_t tsMnodeEqualVnodeNum;
extern int32_t tsFlowCtrl; extern int32_t tsEnableFlowCtrl;
extern int32_t tsEnableSlaveQuery;
// restful // restful
extern int32_t tsEnableHttpModule; extern int32_t tsEnableHttpModule;
......
...@@ -138,7 +138,8 @@ int32_t tsAlternativeRole = 0; ...@@ -138,7 +138,8 @@ int32_t tsAlternativeRole = 0;
int32_t tsBalanceInterval = 300; // seconds int32_t tsBalanceInterval = 300; // seconds
int32_t tsOfflineThreshold = 86400*100; // seconds 10days int32_t tsOfflineThreshold = 86400*100; // seconds 10days
int32_t tsMnodeEqualVnodeNum = 4; int32_t tsMnodeEqualVnodeNum = 4;
int32_t tsFlowCtrl = 1; int32_t tsEnableFlowCtrl = 1;
int32_t tsEnableSlaveQuery = 1;
// restful // restful
int32_t tsEnableHttpModule = 1; int32_t tsEnableHttpModule = 1;
...@@ -1004,7 +1005,17 @@ static void doInitGlobalConfig(void) { ...@@ -1004,7 +1005,17 @@ static void doInitGlobalConfig(void) {
// module configs // module configs
cfg.option = "flowctrl"; cfg.option = "flowctrl";
cfg.ptr = &tsFlowCtrl; cfg.ptr = &tsEnableFlowCtrl;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0;
cfg.maxValue = 1;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
cfg.option = "slaveQuery";
cfg.ptr = &tsEnableSlaveQuery;
cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0; cfg.minValue = 0;
......
...@@ -54,6 +54,7 @@ void dnodeCleanupVRead() { ...@@ -54,6 +54,7 @@ void dnodeCleanupVRead() {
void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) { void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
int32_t queuedMsgNum = 0; int32_t queuedMsgNum = 0;
int32_t leftLen = pMsg->contLen; int32_t leftLen = pMsg->contLen;
int32_t code = TSDB_CODE_VND_INVALID_VGROUP_ID;
char * pCont = pMsg->pCont; char * pCont = pMsg->pCont;
while (leftLen > 0) { while (leftLen > 0) {
...@@ -74,7 +75,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) { ...@@ -74,7 +75,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
} }
if (queuedMsgNum == 0) { if (queuedMsgNum == 0) {
SRpcMsg rpcRsp = {.handle = pMsg->handle, .code = TSDB_CODE_VND_INVALID_VGROUP_ID}; SRpcMsg rpcRsp = {.handle = pMsg->handle, .code = code};
rpcSendResponse(&rpcRsp); rpcSendResponse(&rpcRsp);
} }
......
...@@ -65,13 +65,17 @@ static int32_t vnodeCheckRead(SVnodeObj *pVnode) { ...@@ -65,13 +65,17 @@ static int32_t vnodeCheckRead(SVnodeObj *pVnode) {
return TSDB_CODE_APP_NOT_READY; return TSDB_CODE_APP_NOT_READY;
} }
if (pVnode->role != TAOS_SYNC_ROLE_SLAVE && pVnode->role != TAOS_SYNC_ROLE_MASTER) { if (pVnode->role == TAOS_SYNC_ROLE_MASTER) {
vDebug("vgId:%d, replica:%d role:%s, refCount:%d pVnode:%p", pVnode->vgId, pVnode->syncCfg.replica, return TSDB_CODE_SUCCESS;
syncRole[pVnode->role], pVnode->refCount, pVnode); }
return TSDB_CODE_APP_NOT_READY;
if (tsEnableSlaveQuery && pVnode->role == TAOS_SYNC_ROLE_SLAVE) {
return TSDB_CODE_SUCCESS;
} }
return TSDB_CODE_SUCCESS; vDebug("vgId:%d, replica:%d role:%s, refCount:%d pVnode:%p, cant provide query service", pVnode->vgId, pVnode->syncCfg.replica,
syncRole[pVnode->role], pVnode->refCount, pVnode);
return TSDB_CODE_APP_NOT_READY;
} }
void vnodeFreeFromRQueue(void *vparam, SVReadMsg *pRead) { void vnodeFreeFromRQueue(void *vparam, SVReadMsg *pRead) {
......
...@@ -297,7 +297,7 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) { ...@@ -297,7 +297,7 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) {
if (pWrite->qtype != TAOS_QTYPE_RPC) return 0; if (pWrite->qtype != TAOS_QTYPE_RPC) return 0;
if (pVnode->queuedWMsg < MAX_QUEUED_MSG_NUM && pVnode->flowctrlLevel <= 0) return 0; if (pVnode->queuedWMsg < MAX_QUEUED_MSG_NUM && pVnode->flowctrlLevel <= 0) return 0;
if (tsFlowCtrl == 0) { if (tsEnableFlowCtrl == 0) {
int32_t ms = pow(2, pVnode->flowctrlLevel + 2); int32_t ms = pow(2, pVnode->flowctrlLevel + 2);
if (ms > 100) ms = 100; if (ms > 100) ms = 100;
vTrace("vgId:%d, msg:%p, app:%p, perform flowctrl for %d ms", pVnode->vgId, pWrite, pWrite->rpcMsg.ahandle, ms); vTrace("vgId:%d, msg:%p, app:%p, perform flowctrl for %d ms", pVnode->vgId, pWrite, pWrite->rpcMsg.ahandle, ms);
......
...@@ -132,6 +132,7 @@ echo "cqdebugFlag 143" >> $TAOS_CFG ...@@ -132,6 +132,7 @@ echo "cqdebugFlag 143" >> $TAOS_CFG
echo "monitor 0" >> $TAOS_CFG echo "monitor 0" >> $TAOS_CFG
echo "monitorInterval 1" >> $TAOS_CFG echo "monitorInterval 1" >> $TAOS_CFG
echo "http 0" >> $TAOS_CFG echo "http 0" >> $TAOS_CFG
echo "slaveQuery 0" >> $TAOS_CFG
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
echo "defaultPass taosdata" >> $TAOS_CFG echo "defaultPass taosdata" >> $TAOS_CFG
echo "numOfLogLines 20000000" >> $TAOS_CFG echo "numOfLogLines 20000000" >> $TAOS_CFG
......
...@@ -140,11 +140,9 @@ if $rows != 1 then ...@@ -140,11 +140,9 @@ if $rows != 1 then
goto wait_dnode4_vgroup_offline goto wait_dnode4_vgroup_offline
endi endi
print show vgroups: print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 $dnode4Vtatus = $data05
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 $dnode3Vtatus = $data07
$dnode4Vtatus = $data5_2
$dnode3Vtatus = $data7_2
if $dnode4Vtatus != offline then if $dnode4Vtatus != offline then
sleep 2000 sleep 2000
...@@ -198,7 +196,3 @@ if $data00 != $totalRows then ...@@ -198,7 +196,3 @@ if $data00 != $totalRows then
sleep 2000 sleep 2000
goto wait_table_altered goto wait_table_altered
endi endi
...@@ -14,6 +14,9 @@ sql alter table $stb add column f1 float ...@@ -14,6 +14,9 @@ sql alter table $stb add column f1 float
$tblNum = $totalTableNum $tblNum = $totalTableNum
$alterTblNum = 10 $alterTblNum = 10
sql reset query cache
sleep 100
$i = 1 $i = 1
while $i < $alterTblNum while $i < $alterTblNum
$tb = tb . $i $tb = tb . $i
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册