Merge branch '3.0' into enh/refactorBackend
This commit is contained in:
parent
e9bec34c44
commit
e483570cd7
|
@ -1340,7 +1340,8 @@ static int32_t mndProcessStreamCheckpointInCandid(SRpcMsg *pReq) {
|
||||||
|
|
||||||
for (int32_t i = 0; i < taosArrayGetSize(pList); ++i) {
|
for (int32_t i = 0; i < taosArrayGetSize(pList); ++i) {
|
||||||
int64_t *pId = taosArrayGet(pList, i);
|
int64_t *pId = taosArrayGet(pList, i);
|
||||||
taosHashRemove(execInfo.transMgmt.pWaitingList, &pId, sizeof(*pId));
|
|
||||||
|
taosHashRemove(execInfo.transMgmt.pWaitingList, pId, sizeof(*pId));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t remain = taosHashGetSize(execInfo.transMgmt.pWaitingList);
|
int32_t remain = taosHashGetSize(execInfo.transMgmt.pWaitingList);
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mndTrans.h"
|
|
||||||
#include "mndStream.h"
|
#include "mndStream.h"
|
||||||
|
#include "mndTrans.h"
|
||||||
|
|
||||||
typedef struct SKeyInfo {
|
typedef struct SKeyInfo {
|
||||||
void* pKey;
|
void* pKey;
|
||||||
|
@ -42,7 +42,7 @@ int32_t clearFinishedTrans(SMnode* pMnode) {
|
||||||
|
|
||||||
void* pIter = NULL;
|
void* pIter = NULL;
|
||||||
while ((pIter = taosHashIterate(execInfo.transMgmt.pDBTrans, pIter)) != NULL) {
|
while ((pIter = taosHashIterate(execInfo.transMgmt.pDBTrans, pIter)) != NULL) {
|
||||||
SStreamTransInfo *pEntry = (SStreamTransInfo *)pIter;
|
SStreamTransInfo* pEntry = (SStreamTransInfo*)pIter;
|
||||||
STrans* pTrans = mndAcquireTrans(pMnode, pEntry->transId);
|
STrans* pTrans = mndAcquireTrans(pMnode, pEntry->transId);
|
||||||
|
|
||||||
// let's clear the finished trans
|
// let's clear the finished trans
|
||||||
|
@ -60,12 +60,12 @@ int32_t clearFinishedTrans(SMnode* pMnode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t num = taosArrayGetSize(pList);
|
size_t num = taosArrayGetSize(pList);
|
||||||
for(int32_t i = 0; i < num; ++i) {
|
for (int32_t i = 0; i < num; ++i) {
|
||||||
SKeyInfo* pKey = taosArrayGet(pList, i);
|
SKeyInfo* pKey = taosArrayGet(pList, i);
|
||||||
taosHashRemove(execInfo.transMgmt.pDBTrans, pKey->pKey, pKey->keyLen);
|
taosHashRemove(execInfo.transMgmt.pDBTrans, pKey->pKey, pKey->keyLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
mDebug("clear %d finished stream-trans, remained:%d", (int32_t) num, taosHashGetSize(execInfo.transMgmt.pDBTrans));
|
mDebug("clear %d finished stream-trans, remained:%d", (int32_t)num, taosHashGetSize(execInfo.transMgmt.pDBTrans));
|
||||||
taosThreadMutexUnlock(&execInfo.lock);
|
taosThreadMutexUnlock(&execInfo.lock);
|
||||||
|
|
||||||
terrno = TSDB_CODE_SUCCESS;
|
terrno = TSDB_CODE_SUCCESS;
|
||||||
|
@ -83,7 +83,7 @@ bool mndStreamTransConflictOtherTrans(SMnode* pMnode, const char* pSrcDb, const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SStreamTransInfo *pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, pSrcDb, strlen(pSrcDb));
|
SStreamTransInfo* pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, pSrcDb, strlen(pSrcDb));
|
||||||
if (pEntry != NULL) {
|
if (pEntry != NULL) {
|
||||||
taosThreadMutexUnlock(&execInfo.lock);
|
taosThreadMutexUnlock(&execInfo.lock);
|
||||||
mWarn("conflict with other transId:%d in Db:%s, trans:%s", pEntry->transId, pSrcDb, pEntry->name);
|
mWarn("conflict with other transId:%d in Db:%s, trans:%s", pEntry->transId, pSrcDb, pEntry->name);
|
||||||
|
@ -112,14 +112,13 @@ int32_t mndAddtoCheckpointWaitingList(SStreamObj* pStream, int64_t checkpointId)
|
||||||
taosHashPut(execInfo.transMgmt.pWaitingList, &pStream->uid, sizeof(pStream->uid), &entry, sizeof(entry));
|
taosHashPut(execInfo.transMgmt.pWaitingList, &pStream->uid, sizeof(pStream->uid), &entry, sizeof(entry));
|
||||||
int32_t size = taosHashGetSize(execInfo.transMgmt.pWaitingList);
|
int32_t size = taosHashGetSize(execInfo.transMgmt.pWaitingList);
|
||||||
|
|
||||||
mDebug("stream:%" PRIx64 " add into waiting list due to conflict, ts:%" PRId64 ", total in waitingList:%d",
|
mDebug("stream:%" PRIx64 " add into waiting list due to conflict, ts:%" PRId64 " , checkpointId: %" PRId64
|
||||||
pStream->uid, entry.checkpointTs, size);
|
", total in waitingList:%d",
|
||||||
|
pStream->uid, entry.checkpointTs, checkpointId, size);
|
||||||
} else {
|
} else {
|
||||||
mDebug("stream:%" PRIx64 " ts:%" PRId64 "already in waiting list, no need to add into", pStream->uid,
|
mDebug("stream:%" PRIx64 " ts:%" PRId64 ", checkpointId:%" PRId64 " already in waiting list, no need to add into",
|
||||||
pEntry->checkpointTs);
|
pStream->uid, pEntry->checkpointTs, checkpointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue