diff --git a/include/dnode/mnode/sdb/sdb.h b/include/dnode/mnode/sdb/sdb.h index d7d53ad1d04f12acef867bcbf0eebd33495c5e96..d534b0405f75d0fc7b474efae6b7711d09743ec4 100644 --- a/include/dnode/mnode/sdb/sdb.h +++ b/include/dnode/mnode/sdb/sdb.h @@ -221,7 +221,7 @@ int32_t sdbWrite(SSdb *pSdb, SSdbRaw *pRaw); * @param pRaw The raw data. * @return int32_t 0 for success, -1 for failure. */ -int32_t sdbWriteNotFree(SSdb *pSdb, SSdbRaw *pRaw); +int32_t sdbWriteWithoutFree(SSdb *pSdb, SSdbRaw *pRaw); /** * @brief Acquire a row from sdb diff --git a/source/libs/function/inc/tudf.h b/include/libs/function/tudf.h similarity index 100% rename from source/libs/function/inc/tudf.h rename to include/libs/function/tudf.h diff --git a/include/util/taoserror.h b/include/util/taoserror.h index f0c3cc4b14ec088834c03de32cdc80f941c57177..2c249a2d8d148ce7aca21b2d73b28d01847cffbc 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -139,16 +139,9 @@ int32_t* taosGetErrno(); // mnode-common #define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0300) #define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0301) -#define TSDB_CODE_MND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0302) -#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0303) -#define TSDB_CODE_MND_ACTION_NEED_REPROCESSED TAOS_DEF_ERROR_CODE(0, 0x0304) -#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0305) -#define TSDB_CODE_MND_INVALID_OPTIONS TAOS_DEF_ERROR_CODE(0, 0x0306) -#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0307) -#define TSDB_CODE_MND_INVALID_MSG_VERSION TAOS_DEF_ERROR_CODE(0, 0x0308) -#define TSDB_CODE_MND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x0309) -#define TSDB_CODE_MND_INVALID_MSG_TYPE TAOS_DEF_ERROR_CODE(0, 0x030A) -#define TSDB_CODE_MND_TOO_MANY_SHELL_CONNS TAOS_DEF_ERROR_CODE(0, 0x030B) +#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0302) +#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303) +#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0304) // mnode-show #define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x0310) diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 5983ba92ac9d58324decc2cff958057ee087789f..6d9ead4c87990cae6fed774d213f71b85d7748c2 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -68,6 +68,7 @@ static void dmSetSignalHandle() { static int32_t dmParseArgs(int32_t argc, char const *argv[]) { int32_t cmdEnvIndex = 0; + if (argc < 2) return 0; global.envCmd = taosMemoryMalloc(argc-1); memset(global.envCmd, 0, argc-1); for (int32_t i = 1; i < argc; ++i) { diff --git a/source/dnode/mnode/impl/src/mndAcct.c b/source/dnode/mnode/impl/src/mndAcct.c index 25bf20fa0d5d53e1352fb838d620d916392f814f..cf4c41ee36c9e02157cbbdf989d0f17ab41b7139 100644 --- a/source/dnode/mnode/impl/src/mndAcct.c +++ b/source/dnode/mnode/impl/src/mndAcct.c @@ -17,8 +17,8 @@ #include "mndAcct.h" #include "mndShow.h" -#define TSDB_ACCT_VER_NUMBER 1 -#define TSDB_ACCT_RESERVE_SIZE 128 +#define ACCT_VER_NUMBER 1 +#define ACCT_RESERVE_SIZE 128 static int32_t mndCreateDefaultAcct(SMnode *pMnode); static SSdbRaw *mndAcctActionEncode(SAcctObj *pAcct); @@ -55,6 +55,7 @@ static int32_t mndCreateDefaultAcct(SMnode *pMnode) { acctObj.createdTime = taosGetTimestampMs(); acctObj.updateTime = acctObj.createdTime; acctObj.acctId = 1; + acctObj.status = 0; acctObj.cfg = (SAcctCfg){.maxUsers = INT32_MAX, .maxDbs = INT32_MAX, .maxStbs = INT32_MAX, @@ -79,7 +80,7 @@ static int32_t mndCreateDefaultAcct(SMnode *pMnode) { static SSdbRaw *mndAcctActionEncode(SAcctObj *pAcct) { terrno = TSDB_CODE_OUT_OF_MEMORY; - SSdbRaw *pRaw = sdbAllocRaw(SDB_ACCT, TSDB_ACCT_VER_NUMBER, sizeof(SAcctObj) + TSDB_ACCT_RESERVE_SIZE); + SSdbRaw *pRaw = sdbAllocRaw(SDB_ACCT, ACCT_VER_NUMBER, sizeof(SAcctObj) + ACCT_RESERVE_SIZE); if (pRaw == NULL) goto _OVER; int32_t dataPos = 0; @@ -100,7 +101,7 @@ static SSdbRaw *mndAcctActionEncode(SAcctObj *pAcct) { SDB_SET_INT32(pRaw, dataPos, pAcct->cfg.maxTopics, _OVER) SDB_SET_INT64(pRaw, dataPos, pAcct->cfg.maxStorage, _OVER) SDB_SET_INT32(pRaw, dataPos, pAcct->cfg.accessState, _OVER) - SDB_SET_RESERVE(pRaw, dataPos, TSDB_ACCT_RESERVE_SIZE, _OVER) + SDB_SET_RESERVE(pRaw, dataPos, ACCT_RESERVE_SIZE, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER) terrno = 0; @@ -122,7 +123,7 @@ static SSdbRow *mndAcctActionDecode(SSdbRaw *pRaw) { int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; - if (sver != TSDB_ACCT_VER_NUMBER) { + if (sver != ACCT_VER_NUMBER) { terrno = TSDB_CODE_SDB_INVALID_DATA_VER; goto _OVER; } @@ -151,7 +152,7 @@ static SSdbRow *mndAcctActionDecode(SSdbRaw *pRaw) { SDB_GET_INT32(pRaw, dataPos, &pAcct->cfg.maxTopics, _OVER) SDB_GET_INT64(pRaw, dataPos, &pAcct->cfg.maxStorage, _OVER) SDB_GET_INT32(pRaw, dataPos, &pAcct->cfg.accessState, _OVER) - SDB_GET_RESERVE(pRaw, dataPos, TSDB_ACCT_RESERVE_SIZE, _OVER) + SDB_GET_RESERVE(pRaw, dataPos, ACCT_RESERVE_SIZE, _OVER) terrno = 0; @@ -178,7 +179,6 @@ static int32_t mndAcctActionDelete(SSdb *pSdb, SAcctObj *pAcct) { static int32_t mndAcctActionUpdate(SSdb *pSdb, SAcctObj *pOld, SAcctObj *pNew) { mTrace("acct:%s, perform update action, old row:%p new row:%p", pOld->acct, pOld, pNew); - pOld->updateTime = pNew->updateTime; pOld->status = pNew->status; memcpy(&pOld->cfg, &pNew->cfg, sizeof(SAcctCfg)); @@ -186,19 +186,19 @@ static int32_t mndAcctActionUpdate(SSdb *pSdb, SAcctObj *pOld, SAcctObj *pNew) { } static int32_t mndProcessCreateAcctReq(SNodeMsg *pReq) { - terrno = TSDB_CODE_MND_MSG_NOT_PROCESSED; + terrno = TSDB_CODE_MSG_NOT_PROCESSED; mError("failed to process create acct request since %s", terrstr()); return -1; } static int32_t mndProcessAlterAcctReq(SNodeMsg *pReq) { - terrno = TSDB_CODE_MND_MSG_NOT_PROCESSED; + terrno = TSDB_CODE_MSG_NOT_PROCESSED; mError("failed to process create acct request since %s", terrstr()); return -1; } static int32_t mndProcessDropAcctReq(SNodeMsg *pReq) { - terrno = TSDB_CODE_MND_MSG_NOT_PROCESSED; + terrno = TSDB_CODE_MSG_NOT_PROCESSED; mError("failed to process create acct request since %s", terrstr()); return -1; } \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 5fa51820791b44ddb48cf1938fa07f9c5e011d8b..3eeec61dbbe059ffa2e69d3904e5ae8eac6d5a8d 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -363,7 +363,7 @@ static int32_t mndProcessStatusReq(SNodeMsg *pReq) { pDnode->offlineReason = DND_REASON_VERSION_NOT_MATCH; } mError("dnode:%d, status msg version:%d not match cluster:%d", statusReq.dnodeId, statusReq.sver, tsVersion); - terrno = TSDB_CODE_MND_INVALID_MSG_VERSION; + terrno = TSDB_CODE_VERSION_NOT_COMPATIBLE; goto PROCESS_STATUS_MSG_OVER; } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 15a70e33115ee648a80d403a0e95ce3ac73de4b2..e09e297cf37af69acad535e83843f9ae0fbf0644 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -72,7 +72,7 @@ static int32_t mndRestoreWal(SMnode *pMnode) { } mTrace("wal:%" PRId64 ", will be restored, content:%p", ver, pHead->head.body); - if (sdbWriteNotFree(pSdb, (void *)pHead->head.body) < 0) { + if (sdbWriteWithoutFree(pSdb, (void *)pHead->head.body) < 0) { mError("failed to read wal from sdb since %s, ver:%" PRId64, terrstr(), ver); goto WAL_RESTORE_OVER; } diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 6e221fb3dfb7746c0dc5473d08d43db77a91ed39..582b60f7b26639ecfb25341c39923c58f9f31f1a 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -844,7 +844,7 @@ static int32_t mndTransExecuteLogs(SMnode *pMnode, SArray *pArray) { for (int32_t i = 0; i < arraySize; ++i) { SSdbRaw *pRaw = taosArrayGetP(pArray, i); - int32_t code = sdbWriteNotFree(pSdb, pRaw); + int32_t code = sdbWriteWithoutFree(pSdb, pRaw); if (code != 0) { return code; } diff --git a/source/dnode/mnode/impl/src/mnode.c b/source/dnode/mnode/impl/src/mnode.c index 75caef2336e4b15388ae5a992b370e3cf44fe7ae..41a309e941d5f1c4740066f8c72394436d769e28 100644 --- a/source/dnode/mnode/impl/src/mnode.c +++ b/source/dnode/mnode/impl/src/mnode.c @@ -368,7 +368,7 @@ int32_t mndProcessMsg(SNodeMsg *pMsg) { } if (isReq && (pRpc->contLen == 0 || pRpc->pCont == NULL)) { - terrno = TSDB_CODE_MND_INVALID_MSG_LEN; + terrno = TSDB_CODE_INVALID_MSG_LEN; mError("msg:%p, failed to process since %s, app:%p", pMsg, terrstr(), ahandle); return -1; } diff --git a/source/dnode/mnode/impl/test/acct/acct.cpp b/source/dnode/mnode/impl/test/acct/acct.cpp index 0260b5f59ebf1468be576a9192566b0bbb7d1698..b143594ec0370c2d2fc31764007766b8e46204c0 100644 --- a/source/dnode/mnode/impl/test/acct/acct.cpp +++ b/source/dnode/mnode/impl/test/acct/acct.cpp @@ -32,7 +32,7 @@ TEST_F(MndTestAcct, 01_Create_Acct) { SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_ACCT, pReq, contLen); ASSERT_NE(pRsp, nullptr); - ASSERT_EQ(pRsp->code, TSDB_CODE_MND_MSG_NOT_PROCESSED); + ASSERT_EQ(pRsp->code, TSDB_CODE_MSG_NOT_PROCESSED); } TEST_F(MndTestAcct, 02_Alter_Acct) { @@ -42,7 +42,7 @@ TEST_F(MndTestAcct, 02_Alter_Acct) { SRpcMsg* pRsp = test.SendReq(TDMT_MND_ALTER_ACCT, pReq, contLen); ASSERT_NE(pRsp, nullptr); - ASSERT_EQ(pRsp->code, TSDB_CODE_MND_MSG_NOT_PROCESSED); + ASSERT_EQ(pRsp->code, TSDB_CODE_MSG_NOT_PROCESSED); } TEST_F(MndTestAcct, 03_Drop_Acct) { @@ -52,5 +52,5 @@ TEST_F(MndTestAcct, 03_Drop_Acct) { SRpcMsg* pRsp = test.SendReq(TDMT_MND_DROP_ACCT, pReq, contLen); ASSERT_NE(pRsp, nullptr); - ASSERT_EQ(pRsp->code, TSDB_CODE_MND_MSG_NOT_PROCESSED); + ASSERT_EQ(pRsp->code, TSDB_CODE_MSG_NOT_PROCESSED); } diff --git a/source/dnode/mnode/sdb/CMakeLists.txt b/source/dnode/mnode/sdb/CMakeLists.txt index 823bcdeacad3bffa2cc48f44377f707a6d747e21..e2ebed7a788c58cb6bbe2ba384eeabeb5cf3f2f0 100644 --- a/source/dnode/mnode/sdb/CMakeLists.txt +++ b/source/dnode/mnode/sdb/CMakeLists.txt @@ -6,5 +6,5 @@ target_include_directories( PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) target_link_libraries( - sdb os common util + sdb os common util wal ) \ No newline at end of file diff --git a/source/dnode/mnode/sdb/src/sdbFile.c b/source/dnode/mnode/sdb/src/sdbFile.c index f61899766e1bdefcd6272812d6c8d8fc29ae9465..ab5b74a324756a4df12b9066380f9c07ec7d428e 100644 --- a/source/dnode/mnode/sdb/src/sdbFile.c +++ b/source/dnode/mnode/sdb/src/sdbFile.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "sdbInt.h" #include "tchecksum.h" +#include "wal.h" #define SDB_TABLE_SIZE 24 #define SDB_RESERVE_SIZE 512 @@ -137,7 +138,7 @@ int32_t sdbReadFile(SSdb *pSdb) { int32_t readLen = 0; int64_t ret = 0; - SSdbRaw *pRaw = taosMemoryMalloc(SDB_MAX_SIZE); + SSdbRaw *pRaw = taosMemoryMalloc(WAL_MAX_SIZE + 100); if (pRaw == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; mError("failed read file since %s", terrstr()); @@ -202,7 +203,7 @@ int32_t sdbReadFile(SSdb *pSdb) { break; } - code = sdbWriteNotFree(pSdb, pRaw); + code = sdbWriteWithoutFree(pSdb, pRaw); if (code != 0) { mError("failed to read file:%s since %s", file, terrstr()); goto PARSE_SDB_DATA_ERROR; @@ -263,7 +264,7 @@ static int32_t sdbWriteFileImp(SSdb *pSdb) { continue; } - sdbPrintOper(pSdb, pRow, "writeFile"); + sdbPrintOper(pSdb, pRow, "write"); SSdbRaw *pRaw = (*encodeFp)(pRow->pObj); if (pRaw != NULL) { diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index dc2c12a2c4f8f07aaf39a00d6e8423fd0682cc45..1158bedc2198a82e6d2fd06d7dd1901e0179ef16 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -51,7 +51,9 @@ const char *sdbTableName(ESdbType type) { case SDB_TOPIC: return "topic"; case SDB_VGROUP: - return "vgId"; + return "vgroup"; + case SDB_SMA: + return "sma"; case SDB_STB: return "stb"; case SDB_DB: @@ -86,13 +88,13 @@ void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper) { EKeyType keyType = pSdb->keyTypes[pRow->type]; if (keyType == SDB_KEY_BINARY) { - mTrace("%s:%s, refCount:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), (char *)pRow->pObj, pRow->refCount, - oper, pRow->pObj, sdbStatusStr(pRow->status)); + mTrace("%s:%s, ref:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), (char *)pRow->pObj, pRow->refCount, oper, + pRow->pObj, sdbStatusStr(pRow->status)); } else if (keyType == SDB_KEY_INT32) { - mTrace("%s:%d, refCount:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), *(int32_t *)pRow->pObj, - pRow->refCount, oper, pRow->pObj, sdbStatusStr(pRow->status)); + mTrace("%s:%d, ref:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), *(int32_t *)pRow->pObj, pRow->refCount, + oper, pRow->pObj, sdbStatusStr(pRow->status)); } else if (keyType == SDB_KEY_INT64) { - mTrace("%s:%" PRId64 ", refCount:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), *(int64_t *)pRow->pObj, + mTrace("%s:%" PRId64 ", ref:%d oper:%s row:%p status:%s", sdbTableName(pRow->type), *(int64_t *)pRow->pObj, pRow->refCount, oper, pRow->pObj, sdbStatusStr(pRow->status)); } else { } @@ -142,7 +144,7 @@ static int32_t sdbInsertRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow * pRow->refCount = 0; pRow->status = pRaw->status; - sdbPrintOper(pSdb, pRow, "insertRow"); + sdbPrintOper(pSdb, pRow, "insert"); if (taosHashPut(hash, pRow->pObj, keySize, &pRow, sizeof(void *)) != 0) { taosWUnLockLatch(pLock); @@ -191,7 +193,7 @@ static int32_t sdbUpdateRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow * SSdbRow *pOldRow = *ppOldRow; pOldRow->status = pRaw->status; - sdbPrintOper(pSdb, pOldRow, "updateRow"); + sdbPrintOper(pSdb, pOldRow, "update"); taosRUnLockLatch(pLock); int32_t code = 0; @@ -220,7 +222,7 @@ static int32_t sdbDeleteRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow * SSdbRow *pOldRow = *ppOldRow; pOldRow->status = pRaw->status; - sdbPrintOper(pSdb, pOldRow, "deleteRow"); + sdbPrintOper(pSdb, pOldRow, "delete"); taosHashRemove(hash, pOldRow->pObj, keySize); taosWUnLockLatch(pLock); @@ -233,7 +235,7 @@ static int32_t sdbDeleteRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow * return 0; } -int32_t sdbWriteNotFree(SSdb *pSdb, SSdbRaw *pRaw) { +int32_t sdbWriteWithoutFree(SSdb *pSdb, SSdbRaw *pRaw) { SHashObj *hash = sdbGetHash(pSdb, pRaw->type); if (hash == NULL) return terrno; @@ -266,7 +268,7 @@ int32_t sdbWriteNotFree(SSdb *pSdb, SSdbRaw *pRaw) { } int32_t sdbWrite(SSdb *pSdb, SSdbRaw *pRaw) { - int32_t code = sdbWriteNotFree(pSdb, pRaw); + int32_t code = sdbWriteWithoutFree(pSdb, pRaw); sdbFreeRaw(pRaw); return code; } @@ -296,7 +298,7 @@ void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey) { case SDB_STATUS_UPDATING: atomic_add_fetch_32(&pRow->refCount, 1); pRet = pRow->pObj; - sdbPrintOper(pSdb, pRow, "acquireRow"); + sdbPrintOper(pSdb, pRow, "acquire"); break; case SDB_STATUS_CREATING: terrno = TSDB_CODE_SDB_OBJ_CREATING; @@ -318,7 +320,7 @@ static void sdbCheck(SSdb *pSdb, SSdbRow *pRow) { taosRLockLatch(pLock); int32_t ref = atomic_load_32(&pRow->refCount); - sdbPrintOper(pSdb, pRow, "checkRow"); + sdbPrintOper(pSdb, pRow, "check"); if (ref <= 0 && pRow->status == SDB_STATUS_DROPPED) { sdbFreeRow(pSdb, pRow); } @@ -330,13 +332,13 @@ void sdbRelease(SSdb *pSdb, void *pObj) { if (pObj == NULL) return; SSdbRow *pRow = (SSdbRow *)((char *)pObj - sizeof(SSdbRow)); - if (pRow->type >= SDB_MAX ) return; + if (pRow->type >= SDB_MAX) return; SRWLatch *pLock = &pSdb->locks[pRow->type]; taosRLockLatch(pLock); int32_t ref = atomic_sub_fetch_32(&pRow->refCount, 1); - sdbPrintOper(pSdb, pRow, "releaseRow"); + sdbPrintOper(pSdb, pRow, "release"); if (ref <= 0 && pRow->status == SDB_STATUS_DROPPED) { sdbFreeRow(pSdb, pRow); } @@ -372,7 +374,7 @@ void *sdbFetch(SSdb *pSdb, ESdbType type, void *pIter, void **ppObj) { } atomic_add_fetch_32(&pRow->refCount, 1); - sdbPrintOper(pSdb, pRow, "fetchRow"); + sdbPrintOper(pSdb, pRow, "fetch"); *ppObj = pRow->pObj; break; } diff --git a/source/dnode/mnode/sdb/src/sdbRaw.c b/source/dnode/mnode/sdb/src/sdbRaw.c index c3aaf562bef5a557762651e770b049ee3b949416..326fe53fc7aacd857785a377de5fa9aa46906edf 100644 --- a/source/dnode/mnode/sdb/src/sdbRaw.c +++ b/source/dnode/mnode/sdb/src/sdbRaw.c @@ -27,7 +27,7 @@ SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen) { pRaw->sver = sver; pRaw->dataLen = dataLen; - mTrace("raw:%p, is created, len:%d", pRaw, dataLen); + mTrace("raw:%p, is created, len:%d table:%s", pRaw, dataLen, sdbTableName(type)); return pRaw; } diff --git a/source/dnode/mnode/sdb/src/sdbRow.c b/source/dnode/mnode/sdb/src/sdbRow.c index ac86a72155f1bd178ab6a83b8a06d0198ad31cf2..94f87cb3500a4215fd37a307b1c75f03d5bc67da 100644 --- a/source/dnode/mnode/sdb/src/sdbRow.c +++ b/source/dnode/mnode/sdb/src/sdbRow.c @@ -43,7 +43,7 @@ void sdbFreeRow(SSdb *pSdb, SSdbRow *pRow) { (*deleteFp)(pSdb, pRow->pObj); } - sdbPrintOper(pSdb, pRow, "freeRow"); + sdbPrintOper(pSdb, pRow, "free"); mTrace("row:%p, is freed", pRow->pObj); taosMemoryFreeClear(pRow); diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c index 907fddaec2529385856f09add338fa91159e7c69..7a226a4c6bcc1c3070b18737455c072822c3820b 100644 --- a/source/dnode/qnode/src/qnode.c +++ b/source/dnode/qnode/src/qnode.c @@ -17,7 +17,7 @@ #include "qndInt.h" #include "query.h" #include "qworker.h" -//#include "tudf.h" +#include "libs/function/function.h" SQnode *qndOpen(const SQnodeOpt *pOption) { SQnode *pQnode = taosMemoryCalloc(1, sizeof(SQnode)); @@ -26,7 +26,9 @@ SQnode *qndOpen(const SQnodeOpt *pOption) { return NULL; } - //udfcOpen(); + if (udfcOpen() != 0) { + qError("qnode can not open udfc"); + } if (qWorkerInit(NODE_TYPE_QNODE, pQnode->qndId, NULL, (void **)&pQnode->pQuery, &pOption->msgCb)) { taosMemoryFreeClear(pQnode); @@ -40,7 +42,7 @@ SQnode *qndOpen(const SQnodeOpt *pOption) { void qndClose(SQnode *pQnode) { qWorkerDestroy((void **)&pQnode->pQuery); - //udfcClose(); + udfcClose(); taosMemoryFree(pQnode); } diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index 334c58c18409e3ac161d10e21ac031224bc8caa5..57f150dd10325c473e8bb896bf13bd55ebffd69a 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -7,6 +7,7 @@ #include "tcommon.h" #include "tdatablock.h" #include "scalar.h" +#include "tudf.h" int32_t scalarGetOperatorParamNum(EOperatorType type) { if (OP_TYPE_IS_NULL == type || OP_TYPE_IS_NOT_NULL == type || OP_TYPE_IS_TRUE == type || OP_TYPE_IS_NOT_TRUE == type @@ -336,14 +337,12 @@ int32_t sclExecFunction(SFunctionNode *node, SScalarCtx *ctx, SScalarParam *outp SCL_ERR_RET(sclInitParamList(¶ms, node->pParameterList, ctx, ¶mNum, &rowNum)); if (fmIsUserDefinedFunc(node->funcId)) { -#if 0 UdfcFuncHandle udfHandle = NULL; SCL_ERR_JRET(setupUdf(node->functionName, &udfHandle)); code = callUdfScalarFunc(udfHandle, params, paramNum, output); teardownUdf(udfHandle); SCL_ERR_JRET(code); -#endif } else { SScalarFuncExecFuncs ffpSet = {0}; code = fmGetScalarFuncExecFuncs(node->funcId, &ffpSet); diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 5bfef810c3d4e716beb966c8f5966442028cef32..b864f48522d57f6d97b81f908b5067d69dbfc492 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -145,12 +145,6 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) { return -1; } - if (taosRealPath(fullDir, NULL, PATH_MAX) != 0) { - terrno = TAOS_SYSTEM_ERROR(errno); - uError("failed to get realpath of dir:%s since %s", inputDir, terrstr()); - return -1; - } - taosMemoryFreeClear(pItem->str); pItem->str = strdup(fullDir); if (pItem->str == NULL) { diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 399a2255ac4403ee1a966a741545b6652211d1ea..d3059bffd0542c77efd14a3b4ce678e27099b7ca 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -144,17 +144,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_CLAUSE_ERROR, "not supported stmt cl // mnode-common TAOS_DEFINE_ERROR(TSDB_CODE_MND_APP_ERROR, "Mnode internal error") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_NOT_READY, "Cluster not ready") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_MSG_NOT_PROCESSED, "Message not processed") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_NOT_READY, "Mnode not ready") TAOS_DEFINE_ERROR(TSDB_CODE_MND_ACTION_IN_PROGRESS, "Message is progressing") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ACTION_NEED_REPROCESSED, "Message need to be reprocessed") TAOS_DEFINE_ERROR(TSDB_CODE_MND_NO_RIGHTS, "Insufficient privilege for operation") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_OPTIONS, "Invalid mnode options") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONNECTION, "Invalid message connection") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_MSG_VERSION, "Incompatible protocol version") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_MSG_LEN, "Invalid message length") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_MSG_TYPE, "Invalid message type") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_SHELL_CONNS, "Too many connections") // mnode-show TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SHOWOBJ, "Data expired")