diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index 3c66ff6c57a61a56c361d1d125cedca152f2e2e0..8b5969cfd019c18a7eda4d32d6da82e1eeb3c230 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -402,8 +402,10 @@ static int32_t mgmtCreateDnode(uint32_t ip) { int32_t code = sdbInsertRow(&oper); if (code != TSDB_CODE_SUCCESS) { + int dnodeId = pDnode->dnodeId; tfree(pDnode); - code = TSDB_CODE_SDB_ERROR; + mError("failed to create dnode:%d, result:%s", dnodeId, tstrerror(code)); + return TSDB_CODE_SDB_ERROR; } mPrint("dnode:%d is created, result:%s", pDnode->dnodeId, tstrerror(code)); diff --git a/tests/script/unique/mnode/basic1.sim b/tests/script/unique/mnode/basic1.sim new file mode 100644 index 0000000000000000000000000000000000000000..98d4bf02bf463a7a306c3a55063578ebd42273f4 --- /dev/null +++ b/tests/script/unique/mnode/basic1.sim @@ -0,0 +1,15 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1 +system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2 +system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3 +system sh/cfg.sh -n dnode1 -c numOfMPeers -v 3 +system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3 +system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3 + +system sh/exec_up.sh -n dnode1 -s start +system sh/exec_up.sh -n dnode2 -s start + +sql connect + +sleep 2000 +sql create dnode 192.168.0.2