Merge branch 'feature/sync-mnode-integration' of https://github.com/taosdata/TDengine into feature/sync-mnode-integration
This commit is contained in:
commit
800ef42a26
|
@ -141,6 +141,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw) {
|
||||||
terrno = TSDB_CODE_APP_ERROR;
|
terrno = TSDB_CODE_APP_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpcFreeCont(rsp.pCont);
|
||||||
if (code != 0) return code;
|
if (code != 0) return code;
|
||||||
return pMgmt->errCode;
|
return pMgmt->errCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -681,6 +681,7 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sdbFreeRaw(pRaw);
|
||||||
mDebug("trans:%d, sync finished", pTrans->id);
|
mDebug("trans:%d, sync finished", pTrans->id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,11 +318,8 @@ int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak) {
|
||||||
sTrace("syncPropose msgType:%d ", pMsg->msgType);
|
sTrace("syncPropose msgType:%d ", pMsg->msgType);
|
||||||
|
|
||||||
int32_t ret = TAOS_SYNC_PROPOSE_SUCCESS;
|
int32_t ret = TAOS_SYNC_PROPOSE_SUCCESS;
|
||||||
SSyncNode* pSyncNode = (SSyncNode*)taosAcquireRef(tsNodeRefId, rid);
|
SSyncNode* pSyncNode = taosAcquireRef(tsNodeRefId, rid);
|
||||||
if (pSyncNode == NULL) {
|
if (pSyncNode == NULL) return TAOS_SYNC_PROPOSE_OTHER_ERROR;
|
||||||
rpcFreeCont(pMsg->pCont);
|
|
||||||
return TAOS_SYNC_PROPOSE_OTHER_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(rid == pSyncNode->rid);
|
assert(rid == pSyncNode->rid);
|
||||||
|
|
||||||
|
@ -335,14 +332,13 @@ int32_t syncPropose(int64_t rid, const SRpcMsg* pMsg, bool isWeak) {
|
||||||
SyncClientRequest* pSyncMsg = syncClientRequestBuild2(pMsg, seqNum, isWeak, pSyncNode->vgId);
|
SyncClientRequest* pSyncMsg = syncClientRequestBuild2(pMsg, seqNum, isWeak, pSyncNode->vgId);
|
||||||
SRpcMsg rpcMsg;
|
SRpcMsg rpcMsg;
|
||||||
syncClientRequest2RpcMsg(pSyncMsg, &rpcMsg);
|
syncClientRequest2RpcMsg(pSyncMsg, &rpcMsg);
|
||||||
if (pSyncNode->FpEqMsg != NULL) {
|
|
||||||
pSyncNode->FpEqMsg(pSyncNode->msgcb, &rpcMsg);
|
if (pSyncNode->FpEqMsg != NULL && (*pSyncNode->FpEqMsg)(pSyncNode->msgcb, &rpcMsg) == 0) {
|
||||||
|
ret = TAOS_SYNC_PROPOSE_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
sTrace("syncPropose pSyncNode->FpEqMsg is NULL");
|
sTrace("syncPropose pSyncNode->FpEqMsg is NULL");
|
||||||
}
|
}
|
||||||
syncClientRequestDestroy(pSyncMsg);
|
syncClientRequestDestroy(pSyncMsg);
|
||||||
ret = TAOS_SYNC_PROPOSE_SUCCESS;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sTrace("syncPropose not leader, %s", syncUtilState2String(pSyncNode->state));
|
sTrace("syncPropose not leader, %s", syncUtilState2String(pSyncNode->state));
|
||||||
ret = TAOS_SYNC_PROPOSE_NOT_LEADER;
|
ret = TAOS_SYNC_PROPOSE_NOT_LEADER;
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
./test.sh -f tsim/stream/basic1.sim
|
./test.sh -f tsim/stream/basic1.sim
|
||||||
|
|
||||||
# ---- transaction
|
# ---- transaction
|
||||||
|
./test.sh -f tsim/trans/lossdata1.sim
|
||||||
./test.sh -f tsim/trans/create_db.sim
|
./test.sh -f tsim/trans/create_db.sim
|
||||||
|
|
||||||
# ---- tmq
|
# ---- tmq
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/cfg.sh -n dnode1 -c transPullupInterval -v 1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ======= backup sdbdata
|
||||||
|
system sh/exec.sh -n dnode1 -s stop
|
||||||
|
system cp ../../../../sim/dnode1/data/mnode/data/sdb.data ../../../../sim/dnode1/data/mnode/data/sdb.data.bak1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print =============== create user1
|
||||||
|
sql create user user1 PASS 'user1'
|
||||||
|
sql create user user2 PASS 'user2'
|
||||||
|
sql show users
|
||||||
|
if $rows != 3 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop
|
||||||
|
|
||||||
|
print ======= restore backup data
|
||||||
|
system cp ../../../../sim/dnode1/data/mnode/data/sdb.data.bak1 ../../../../sim/dnode1/data/mnode/data/sdb.data
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
sql show users
|
||||||
|
if $rows != 3 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop
|
Loading…
Reference in New Issue