fix error in sdb
This commit is contained in:
parent
cc52d293ef
commit
a5d0e01ab4
|
@ -28,6 +28,7 @@
|
|||
#include "dnodeModule.h"
|
||||
#include "dnodeMgmt.h"
|
||||
#include "vnode.h"
|
||||
#include "mpeer.h"
|
||||
|
||||
#define MPEER_CONTENT_LEN 2000
|
||||
|
||||
|
@ -148,6 +149,15 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
|
|||
return;
|
||||
}
|
||||
|
||||
SDnodeState *pState = &pStatusRsp->dnodeState;
|
||||
pState->numOfVnodes = htonl(pState->numOfVnodes);
|
||||
pState->moduleStatus = htonl(pState->moduleStatus);
|
||||
pState->createdTime = htonl(pState->createdTime);
|
||||
pState->dnodeId = htonl(pState->dnodeId);
|
||||
|
||||
dnodeProcessModuleStatus(pState->moduleStatus);
|
||||
dnodeUpdateDnodeInfo(pState->dnodeId);
|
||||
|
||||
SRpcIpSet mgmtIpSet = {0};
|
||||
mgmtIpSet.inUse = mpeers->inUse;
|
||||
mgmtIpSet.numOfIps = mpeers->nodeNum;
|
||||
|
@ -167,20 +177,13 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
|
|||
tsMnodeInfos.nodeInfos[i].nodePort = htons(mpeers->nodeInfos[i].nodePort);
|
||||
strcpy(tsMnodeInfos.nodeInfos[i].nodeName, mpeers->nodeInfos[i].nodeName);
|
||||
dPrint("mnode:%d, ip:%s:%u name:%s", tsMnodeInfos.nodeInfos[i].nodeId,
|
||||
taosIpStr(tsMnodeInfos.nodeInfos[i].nodeId), tsMnodeInfos.nodeInfos[i].nodePort,
|
||||
taosIpStr(tsMnodeInfos.nodeInfos[i].nodeIp), tsMnodeInfos.nodeInfos[i].nodePort,
|
||||
tsMnodeInfos.nodeInfos[i].nodeName);
|
||||
}
|
||||
dnodeSaveMnodeIpList();
|
||||
mpeerUpdateSync();
|
||||
}
|
||||
|
||||
SDnodeState *pState = &pStatusRsp->dnodeState;
|
||||
pState->numOfVnodes = htonl(pState->numOfVnodes);
|
||||
pState->moduleStatus = htonl(pState->moduleStatus);
|
||||
pState->createdTime = htonl(pState->createdTime);
|
||||
pState->dnodeId = htonl(pState->dnodeId);
|
||||
|
||||
dnodeProcessModuleStatus(pState->moduleStatus);
|
||||
dnodeUpdateDnodeInfo(pState->dnodeId);
|
||||
taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer);
|
||||
}
|
||||
|
||||
|
|
|
@ -159,10 +159,10 @@ static int32_t dnodeInitSystem() {
|
|||
dPrint("starting to initialize TDengine ...");
|
||||
|
||||
if (dnodeInitStorage() != 0) return -1;
|
||||
if (dnodeInitModules() != 0) return -1;
|
||||
if (dnodeInitRead() != 0) return -1;
|
||||
if (dnodeInitWrite() != 0) return -1;
|
||||
if (dnodeInitMClient() != 0) return -1;
|
||||
if (dnodeInitModules() != 0) return -1;
|
||||
if (dnodeInitMnode() != 0) return -1;
|
||||
if (dnodeInitMgmt() != 0) return -1;
|
||||
if (dnodeInitShell() != 0) return -1;
|
||||
|
|
|
@ -50,6 +50,7 @@ void mpeerGetPublicIpList(SRpcIpSet *ipSet);
|
|||
void mpeerGetMpeerInfos(void *mpeers);
|
||||
|
||||
int32_t mpeerForwardReqToPeer(void *pHead);
|
||||
void mpeerUpdateSync();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ void * clusterGetDnode(int32_t dnodeId) { return dnodeId == 1 ? &tsDnodeObj : N
|
|||
void * clusterGetDnodeByIp(uint32_t ip) { return &tsDnodeObj; }
|
||||
void clusterReleaseDnode(struct _dnode_obj *pDnode) {}
|
||||
void clusterUpdateDnode(struct _dnode_obj *pDnode) {}
|
||||
void clusterMonitorDnodeModule() {}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ void * mpeerGetMnode(int32_t mnodeId) { return &tsMnodeObj; }
|
|||
int32_t mpeerGetMnodesNum() { return 1; }
|
||||
void mpeerReleaseMnode(struct _mnode_obj *pMnode) {}
|
||||
bool mpeerIsMaster() { return tsMnodeObj.role == TAOS_SYNC_ROLE_MASTER; }
|
||||
void mpeerUpdateSync() {}
|
||||
|
||||
void *mpeerGetNextMnode(void *pNode, SMnodeObj **pMnode) {
|
||||
if (*pMnode == NULL) {
|
||||
|
|
|
@ -130,6 +130,9 @@ int32_t sdbInit() {
|
|||
}
|
||||
|
||||
sdbTrace("sdb is initialized, version:%d totalRows:%d numOfTables:%d", tsSdbObj->version, totalRows, numOfTables);
|
||||
|
||||
mpeerUpdateSync();
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -215,6 +218,11 @@ static int32_t sdbInsertLocal(SSdbTable *pTable, SSdbOperDesc *pOper) {
|
|||
(*sdbAddIndexFp[pTable->keyType])(pTable->iHandle, pOper->pObj, &rowMeta);
|
||||
sdbIncRef(pTable, pOper->pObj);
|
||||
pTable->numOfRows++;
|
||||
|
||||
if (pTable->keyType == SDB_KEY_AUTO) {
|
||||
pTable->autoIndex = MAX(pTable->autoIndex, *((uint32_t *)pOper->pObj));
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&pTable->mutex);
|
||||
|
||||
sdbTrace("table:%s, insert record:%s, numOfRows:%d", pTable->tableName, sdbGetkeyStr(pTable, pOper->pObj),
|
||||
|
|
|
@ -85,11 +85,13 @@ static int32_t mgmtUserActionDecode(SSdbOperDesc *pOper) {
|
|||
}
|
||||
|
||||
static int32_t mgmtUserActionRestored() {
|
||||
SAcctObj *pAcct = acctGetAcct("root");
|
||||
mgmtCreateUser(pAcct, "root", "taosdata");
|
||||
mgmtCreateUser(pAcct, "monitor", tsInternalPass);
|
||||
mgmtCreateUser(pAcct, "_root", tsInternalPass);
|
||||
acctReleaseAcct(pAcct);
|
||||
if (strcmp(tsMasterIp, tsPrivateIp) == 0) {
|
||||
SAcctObj *pAcct = acctGetAcct("root");
|
||||
mgmtCreateUser(pAcct, "root", "taosdata");
|
||||
mgmtCreateUser(pAcct, "monitor", tsInternalPass);
|
||||
mgmtCreateUser(pAcct, "_root", tsInternalPass);
|
||||
acctReleaseAcct(pAcct);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ void httpCleanUpSystem() {
|
|||
httpPrint("http service cleanup");
|
||||
httpStopSystem();
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
if (httpServer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue