提交 3a2d7bc0 编写于 作者: S Shengliang Guan

init vnode list memory

上级 a567e04a
...@@ -288,13 +288,12 @@ static void *dnodeOpenVnode(void *param) { ...@@ -288,13 +288,12 @@ static void *dnodeOpenVnode(void *param) {
} }
static int32_t dnodeOpenVnodes() { static int32_t dnodeOpenVnodes() {
int32_t *vnodeList = calloc(TSDB_MAX_VNODES, sizeof(int32_t)); int32_t vnodeList[TSDB_MAX_VNODES] = {0};
int32_t numOfVnodes; int32_t numOfVnodes = 0;
int32_t status = dnodeGetVnodeList(vnodeList, &numOfVnodes); int32_t status = dnodeGetVnodeList(vnodeList, &numOfVnodes);
if (status != TSDB_CODE_SUCCESS) { if (status != TSDB_CODE_SUCCESS) {
dInfo("get dnode list failed"); dInfo("get dnode list failed");
free(vnodeList);
return status; return status;
} }
...@@ -340,7 +339,6 @@ static int32_t dnodeOpenVnodes() { ...@@ -340,7 +339,6 @@ static int32_t dnodeOpenVnodes() {
free(pThread->vnodeList); free(pThread->vnodeList);
} }
free(vnodeList);
free(threads); free(threads);
dInfo("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, openVnodes, failedVnodes); dInfo("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, openVnodes, failedVnodes);
...@@ -348,7 +346,7 @@ static int32_t dnodeOpenVnodes() { ...@@ -348,7 +346,7 @@ static int32_t dnodeOpenVnodes() {
} }
void dnodeStartStream() { void dnodeStartStream() {
int32_t vnodeList[TSDB_MAX_VNODES]; int32_t vnodeList[TSDB_MAX_VNODES] = {0};
int32_t numOfVnodes = 0; int32_t numOfVnodes = 0;
int32_t status = vnodeGetVnodeList(vnodeList, &numOfVnodes); int32_t status = vnodeGetVnodeList(vnodeList, &numOfVnodes);
...@@ -365,7 +363,7 @@ void dnodeStartStream() { ...@@ -365,7 +363,7 @@ void dnodeStartStream() {
} }
static void dnodeCloseVnodes() { static void dnodeCloseVnodes() {
int32_t vnodeList[TSDB_MAX_VNODES]; int32_t vnodeList[TSDB_MAX_VNODES]= {0};
int32_t numOfVnodes; int32_t numOfVnodes;
int32_t status; int32_t status;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册