diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 49ca1e31c5f4fc21beeed169b431f21e8985a642..cde5eab48783351d4bd8c00be9008d52b5bf6561 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -42,6 +42,7 @@ extern int8_t tsArbOnline; extern int64_t tsArbOnlineTimestamp; extern int32_t tsDnodeId; extern int64_t tsDnodeStartTime; +extern int8_t tsDnodeNopLoop; // common extern int tsRpcTimer; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 83026a3774ab77aa4b5d4998225a4dcc5d10c121..d29eb09ae102130a5a570f8ea3eff70023723252 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -47,6 +47,7 @@ int64_t tsArbOnlineTimestamp = TSDB_ARB_DUMMY_TIME; char tsEmail[TSDB_FQDN_LEN] = {0}; int32_t tsDnodeId = 0; int64_t tsDnodeStartTime = 0; +int8_t tsDnodeNopLoop = 0; // common int32_t tsRpcTimer = 300; @@ -622,6 +623,16 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); + cfg.option = "dnodeNopLoop"; + cfg.ptr = &tsDnodeNopLoop; + cfg.valType = TAOS_CFG_VTYPE_INT8; + cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; + cfg.minValue = 0; + cfg.maxValue = 1; + cfg.ptrLength = 0; + cfg.unitType = TAOS_CFG_UTYPE_NONE; + taosInitConfigOption(cfg); + cfg.option = "balance"; cfg.ptr = &tsEnableBalance; cfg.valType = TAOS_CFG_VTYPE_INT8; diff --git a/src/dnode/src/dnodeVnodes.c b/src/dnode/src/dnodeVnodes.c index 93d218581cfb7d1738fa5ba3f3afd8c8f0d70dd7..47ef92a6e0e7274e65db181590ca069736317224 100644 --- a/src/dnode/src/dnodeVnodes.c +++ b/src/dnode/src/dnodeVnodes.c @@ -222,6 +222,17 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) { if (clusterId[0] != '\0') { dnodeSetDropped(); dError("exit zombie dropped dnode"); + + // warning: only for k8s! + while (tsDnodeNopLoop) { + dInfo("Nop loop"); +#ifdef WINDOWS + Sleep(100); +#else + usleep(100000); +#endif + } + exit(EXIT_FAILURE); } }