TD-2498
This commit is contained in:
parent
950dd612f2
commit
2db5df4c40
|
@ -101,7 +101,8 @@ extern int32_t tsAlternativeRole;
|
|||
extern int32_t tsBalanceInterval;
|
||||
extern int32_t tsOfflineThreshold;
|
||||
extern int32_t tsMnodeEqualVnodeNum;
|
||||
extern int32_t tsFlowCtrl;
|
||||
extern int32_t tsEnableFlowCtrl;
|
||||
extern int32_t tsEnableSlaveQuery;
|
||||
|
||||
// restful
|
||||
extern int32_t tsEnableHttpModule;
|
||||
|
|
|
@ -138,7 +138,8 @@ int32_t tsAlternativeRole = 0;
|
|||
int32_t tsBalanceInterval = 300; // seconds
|
||||
int32_t tsOfflineThreshold = 86400*100; // seconds 10days
|
||||
int32_t tsMnodeEqualVnodeNum = 4;
|
||||
int32_t tsFlowCtrl = 1;
|
||||
int32_t tsEnableFlowCtrl = 1;
|
||||
int32_t tsEnableSlaveQuery = 1;
|
||||
|
||||
// restful
|
||||
int32_t tsEnableHttpModule = 1;
|
||||
|
@ -1004,7 +1005,17 @@ static void doInitGlobalConfig(void) {
|
|||
|
||||
// module configs
|
||||
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.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
|
||||
cfg.minValue = 0;
|
||||
|
|
|
@ -54,6 +54,7 @@ void dnodeCleanupVRead() {
|
|||
void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
|
||||
int32_t queuedMsgNum = 0;
|
||||
int32_t leftLen = pMsg->contLen;
|
||||
int32_t code = TSDB_CODE_VND_INVALID_VGROUP_ID;
|
||||
char * pCont = pMsg->pCont;
|
||||
|
||||
while (leftLen > 0) {
|
||||
|
@ -74,7 +75,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
|
|||
}
|
||||
|
||||
if (queuedMsgNum == 0) {
|
||||
SRpcMsg rpcRsp = {.handle = pMsg->handle, .code = TSDB_CODE_VND_INVALID_VGROUP_ID};
|
||||
SRpcMsg rpcRsp = {.handle = pMsg->handle, .code = code};
|
||||
rpcSendResponse(&rpcRsp);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,13 +65,17 @@ static int32_t vnodeCheckRead(SVnodeObj *pVnode) {
|
|||
return TSDB_CODE_APP_NOT_READY;
|
||||
}
|
||||
|
||||
if (pVnode->role != TAOS_SYNC_ROLE_SLAVE && pVnode->role != TAOS_SYNC_ROLE_MASTER) {
|
||||
vDebug("vgId:%d, replica:%d role:%s, refCount:%d pVnode:%p", pVnode->vgId, pVnode->syncCfg.replica,
|
||||
syncRole[pVnode->role], pVnode->refCount, pVnode);
|
||||
return TSDB_CODE_APP_NOT_READY;
|
||||
if (pVnode->role == TAOS_SYNC_ROLE_MASTER) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
if (tsEnableSlaveQuery && pVnode->role == TAOS_SYNC_ROLE_SLAVE) {
|
||||
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) {
|
||||
|
|
|
@ -297,7 +297,7 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) {
|
|||
if (pWrite->qtype != TAOS_QTYPE_RPC) 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);
|
||||
if (ms > 100) ms = 100;
|
||||
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
|
|||
echo "monitor 0" >> $TAOS_CFG
|
||||
echo "monitorInterval 1" >> $TAOS_CFG
|
||||
echo "http 0" >> $TAOS_CFG
|
||||
echo "slaveQuery 0" >> $TAOS_CFG
|
||||
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
|
||||
echo "defaultPass taosdata" >> $TAOS_CFG
|
||||
echo "numOfLogLines 20000000" >> $TAOS_CFG
|
||||
|
|
|
@ -140,11 +140,9 @@ if $rows != 1 then
|
|||
goto wait_dnode4_vgroup_offline
|
||||
endi
|
||||
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 $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
|
||||
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
|
||||
$dnode4Vtatus = $data5_2
|
||||
$dnode3Vtatus = $data7_2
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||
$dnode4Vtatus = $data05
|
||||
$dnode3Vtatus = $data07
|
||||
|
||||
if $dnode4Vtatus != offline then
|
||||
sleep 2000
|
||||
|
@ -198,7 +196,3 @@ if $data00 != $totalRows then
|
|||
sleep 2000
|
||||
goto wait_table_altered
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@ sql alter table $stb add column f1 float
|
|||
$tblNum = $totalTableNum
|
||||
$alterTblNum = 10
|
||||
|
||||
sql reset query cache
|
||||
sleep 100
|
||||
|
||||
$i = 1
|
||||
while $i < $alterTblNum
|
||||
$tb = tb . $i
|
||||
|
|
Loading…
Reference in New Issue