提交 43abbcbf 编写于 作者: X xywang

[TD-11377]<feature>: added a parameter for k8s

上级 439b7377
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册