serailze db req
This commit is contained in:
parent
1755559d94
commit
d7fc732de3
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "mndDb.h"
|
#include "mndDb.h"
|
||||||
|
#include "mndAuth.h"
|
||||||
#include "mndDnode.h"
|
#include "mndDnode.h"
|
||||||
#include "mndShow.h"
|
#include "mndShow.h"
|
||||||
#include "mndTrans.h"
|
#include "mndTrans.h"
|
||||||
|
@ -452,53 +453,53 @@ CREATE_DB_OVER:
|
||||||
|
|
||||||
static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
|
static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
|
||||||
SMnode *pMnode = pReq->pMnode;
|
SMnode *pMnode = pReq->pMnode;
|
||||||
SCreateDbReq *pCreate = pReq->rpcMsg.pCont;
|
int32_t code = -1;
|
||||||
|
SDbObj *pDb = NULL;
|
||||||
|
SUserObj *pUser = NULL;
|
||||||
|
SCreateDbReq createReq = {0};
|
||||||
|
|
||||||
pCreate->numOfVgroups = htonl(pCreate->numOfVgroups);
|
if (tDeserializeSCreateDbReq(pReq->rpcMsg.pCont, pReq->rpcMsg.contLen, &createReq) != 0) {
|
||||||
pCreate->cacheBlockSize = htonl(pCreate->cacheBlockSize);
|
terrno = TSDB_CODE_INVALID_MSG;
|
||||||
pCreate->totalBlocks = htonl(pCreate->totalBlocks);
|
goto CREATE_DB_OVER;
|
||||||
pCreate->daysPerFile = htonl(pCreate->daysPerFile);
|
}
|
||||||
pCreate->daysToKeep0 = htonl(pCreate->daysToKeep0);
|
|
||||||
pCreate->daysToKeep1 = htonl(pCreate->daysToKeep1);
|
|
||||||
pCreate->daysToKeep2 = htonl(pCreate->daysToKeep2);
|
|
||||||
pCreate->minRows = htonl(pCreate->minRows);
|
|
||||||
pCreate->maxRows = htonl(pCreate->maxRows);
|
|
||||||
pCreate->commitTime = htonl(pCreate->commitTime);
|
|
||||||
pCreate->fsyncPeriod = htonl(pCreate->fsyncPeriod);
|
|
||||||
|
|
||||||
mDebug("db:%s, start to create, vgroups:%d", pCreate->db, pCreate->numOfVgroups);
|
mDebug("db:%s, start to create, vgroups:%d", createReq.db, createReq.numOfVgroups);
|
||||||
|
|
||||||
SDbObj *pDb = mndAcquireDb(pMnode, pCreate->db);
|
pDb = mndAcquireDb(pMnode, createReq.db);
|
||||||
if (pDb != NULL) {
|
if (pDb != NULL) {
|
||||||
mndReleaseDb(pMnode, pDb);
|
if (createReq.ignoreExist) {
|
||||||
if (pCreate->ignoreExist) {
|
mDebug("db:%s, already exist, ignore exist is set", createReq.db);
|
||||||
mDebug("db:%s, already exist, ignore exist is set", pCreate->db);
|
code = 0;
|
||||||
return 0;
|
goto CREATE_DB_OVER;
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_MND_DB_ALREADY_EXIST;
|
terrno = TSDB_CODE_MND_DB_ALREADY_EXIST;
|
||||||
mError("db:%s, failed to create since %s", pCreate->db, terrstr());
|
goto CREATE_DB_OVER;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
} else if (terrno != TSDB_CODE_MND_DB_NOT_EXIST) {
|
} else if (terrno != TSDB_CODE_MND_DB_NOT_EXIST) {
|
||||||
mError("db:%s, failed to create since %s", pCreate->db, terrstr());
|
goto CREATE_DB_OVER;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SUserObj *pOperUser = mndAcquireUser(pMnode, pReq->user);
|
pUser = mndAcquireUser(pMnode, pReq->user);
|
||||||
if (pOperUser == NULL) {
|
if (pUser == NULL) {
|
||||||
mError("db:%s, failed to create since %s", pCreate->db, terrstr());
|
goto CREATE_DB_OVER;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code = mndCreateDb(pMnode, pReq, pCreate, pOperUser);
|
if (mndCheckCreateDbAuth(pUser) != 0) {
|
||||||
mndReleaseUser(pMnode, pOperUser);
|
goto CREATE_DB_OVER;
|
||||||
|
|
||||||
if (code != 0) {
|
|
||||||
mError("db:%s, failed to create since %s", pCreate->db, terrstr());
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_MND_ACTION_IN_PROGRESS;
|
code = mndCreateDb(pMnode, pReq, &createReq, pUser);
|
||||||
|
if (code == 0) code = TSDB_CODE_MND_ACTION_IN_PROGRESS;
|
||||||
|
|
||||||
|
CREATE_DB_OVER:
|
||||||
|
if (code != 0 && code != TSDB_CODE_MND_ACTION_IN_PROGRESS) {
|
||||||
|
mError("db:%s, failed to create since %s", createReq.db, terrstr());
|
||||||
|
}
|
||||||
|
|
||||||
|
mndReleaseDb(pMnode, pDb);
|
||||||
|
mndReleaseUser(pMnode, pUser);
|
||||||
|
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
|
static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
|
||||||
|
|
|
@ -53,29 +53,31 @@ TEST_F(MndTestDb, 01_ShowDb) {
|
||||||
|
|
||||||
TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
|
TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
|
||||||
{
|
{
|
||||||
int32_t contLen = sizeof(SCreateDbReq);
|
SCreateDbReq createReq = {0};
|
||||||
|
strcpy(createReq.db, "1.d1");
|
||||||
|
createReq.numOfVgroups = 2;
|
||||||
|
createReq.cacheBlockSize = 16;
|
||||||
|
createReq.totalBlocks = 10;
|
||||||
|
createReq.daysPerFile = 10;
|
||||||
|
createReq.daysToKeep0 = 3650;
|
||||||
|
createReq.daysToKeep1 = 3650;
|
||||||
|
createReq.daysToKeep2 = 3650;
|
||||||
|
createReq.minRows = 100;
|
||||||
|
createReq.maxRows = 4096;
|
||||||
|
createReq.commitTime = 3600;
|
||||||
|
createReq.fsyncPeriod = 3000;
|
||||||
|
createReq.walLevel = 1;
|
||||||
|
createReq.precision = 0;
|
||||||
|
createReq.compression = 2;
|
||||||
|
createReq.replications = 1;
|
||||||
|
createReq.quorum = 1;
|
||||||
|
createReq.update = 0;
|
||||||
|
createReq.cacheLastRow = 0;
|
||||||
|
createReq.ignoreExist = 1;
|
||||||
|
|
||||||
SCreateDbReq* pReq = (SCreateDbReq*)rpcMallocCont(contLen);
|
int32_t contLen = tSerializeSCreateDbReq(NULL, 0, &createReq);
|
||||||
strcpy(pReq->db, "1.d1");
|
void* pReq = rpcMallocCont(contLen);
|
||||||
pReq->numOfVgroups = htonl(2);
|
tSerializeSCreateDbReq(pReq, contLen, &createReq);
|
||||||
pReq->cacheBlockSize = htonl(16);
|
|
||||||
pReq->totalBlocks = htonl(10);
|
|
||||||
pReq->daysPerFile = htonl(10);
|
|
||||||
pReq->daysToKeep0 = htonl(3650);
|
|
||||||
pReq->daysToKeep1 = htonl(3650);
|
|
||||||
pReq->daysToKeep2 = htonl(3650);
|
|
||||||
pReq->minRows = htonl(100);
|
|
||||||
pReq->maxRows = htonl(4096);
|
|
||||||
pReq->commitTime = htonl(3600);
|
|
||||||
pReq->fsyncPeriod = htonl(3000);
|
|
||||||
pReq->walLevel = 1;
|
|
||||||
pReq->precision = 0;
|
|
||||||
pReq->compression = 2;
|
|
||||||
pReq->replications = 1;
|
|
||||||
pReq->quorum = 1;
|
|
||||||
pReq->update = 0;
|
|
||||||
pReq->cacheLastRow = 0;
|
|
||||||
pReq->ignoreExist = 1;
|
|
||||||
|
|
||||||
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||||
ASSERT_NE(pRsp, nullptr);
|
ASSERT_NE(pRsp, nullptr);
|
||||||
|
@ -217,29 +219,31 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
|
||||||
|
|
||||||
TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
|
TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
|
||||||
{
|
{
|
||||||
int32_t contLen = sizeof(SCreateDbReq);
|
SCreateDbReq createReq = {0};
|
||||||
|
strcpy(createReq.db, "1.d2");
|
||||||
|
createReq.numOfVgroups = 2;
|
||||||
|
createReq.cacheBlockSize = 16;
|
||||||
|
createReq.totalBlocks = 10;
|
||||||
|
createReq.daysPerFile = 10;
|
||||||
|
createReq.daysToKeep0 = 3650;
|
||||||
|
createReq.daysToKeep1 = 3650;
|
||||||
|
createReq.daysToKeep2 = 3650;
|
||||||
|
createReq.minRows = 100;
|
||||||
|
createReq.maxRows = 4096;
|
||||||
|
createReq.commitTime = 3600;
|
||||||
|
createReq.fsyncPeriod = 3000;
|
||||||
|
createReq.walLevel = 1;
|
||||||
|
createReq.precision = 0;
|
||||||
|
createReq.compression = 2;
|
||||||
|
createReq.replications = 1;
|
||||||
|
createReq.quorum = 1;
|
||||||
|
createReq.update = 0;
|
||||||
|
createReq.cacheLastRow = 0;
|
||||||
|
createReq.ignoreExist = 1;
|
||||||
|
|
||||||
SCreateDbReq* pReq = (SCreateDbReq*)rpcMallocCont(contLen);
|
int32_t contLen = tSerializeSCreateDbReq(NULL, 0, &createReq);
|
||||||
strcpy(pReq->db, "1.d2");
|
void* pReq = rpcMallocCont(contLen);
|
||||||
pReq->numOfVgroups = htonl(2);
|
tSerializeSCreateDbReq(pReq, contLen, &createReq);
|
||||||
pReq->cacheBlockSize = htonl(16);
|
|
||||||
pReq->totalBlocks = htonl(10);
|
|
||||||
pReq->daysPerFile = htonl(10);
|
|
||||||
pReq->daysToKeep0 = htonl(3650);
|
|
||||||
pReq->daysToKeep1 = htonl(3650);
|
|
||||||
pReq->daysToKeep2 = htonl(3650);
|
|
||||||
pReq->minRows = htonl(100);
|
|
||||||
pReq->maxRows = htonl(4096);
|
|
||||||
pReq->commitTime = htonl(3600);
|
|
||||||
pReq->fsyncPeriod = htonl(3000);
|
|
||||||
pReq->walLevel = 1;
|
|
||||||
pReq->precision = 0;
|
|
||||||
pReq->compression = 2;
|
|
||||||
pReq->replications = 1;
|
|
||||||
pReq->quorum = 1;
|
|
||||||
pReq->update = 0;
|
|
||||||
pReq->cacheLastRow = 0;
|
|
||||||
pReq->ignoreExist = 1;
|
|
||||||
|
|
||||||
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||||
ASSERT_NE(pRsp, nullptr);
|
ASSERT_NE(pRsp, nullptr);
|
||||||
|
|
|
@ -38,29 +38,31 @@ class MndTestStb : public ::testing::Test {
|
||||||
Testbase MndTestStb::test;
|
Testbase MndTestStb::test;
|
||||||
|
|
||||||
void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
|
void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
|
||||||
int32_t contLen = sizeof(SCreateDbReq);
|
SCreateDbReq createReq = {0};
|
||||||
|
strcpy(createReq.db, dbname);
|
||||||
|
createReq.numOfVgroups = 2;
|
||||||
|
createReq.cacheBlockSize = 16;
|
||||||
|
createReq.totalBlocks = 10;
|
||||||
|
createReq.daysPerFile = 10;
|
||||||
|
createReq.daysToKeep0 = 3650;
|
||||||
|
createReq.daysToKeep1 = 3650;
|
||||||
|
createReq.daysToKeep2 = 3650;
|
||||||
|
createReq.minRows = 100;
|
||||||
|
createReq.maxRows = 4096;
|
||||||
|
createReq.commitTime = 3600;
|
||||||
|
createReq.fsyncPeriod = 3000;
|
||||||
|
createReq.walLevel = 1;
|
||||||
|
createReq.precision = 0;
|
||||||
|
createReq.compression = 2;
|
||||||
|
createReq.replications = 1;
|
||||||
|
createReq.quorum = 1;
|
||||||
|
createReq.update = 0;
|
||||||
|
createReq.cacheLastRow = 0;
|
||||||
|
createReq.ignoreExist = 1;
|
||||||
|
|
||||||
SCreateDbReq* pReq = (SCreateDbReq*)rpcMallocCont(contLen);
|
int32_t contLen = tSerializeSCreateDbReq(NULL, 0, &createReq);
|
||||||
strcpy(pReq->db, dbname);
|
void* pReq = rpcMallocCont(contLen);
|
||||||
pReq->numOfVgroups = htonl(2);
|
tSerializeSCreateDbReq(pReq, contLen, &createReq);
|
||||||
pReq->cacheBlockSize = htonl(16);
|
|
||||||
pReq->totalBlocks = htonl(10);
|
|
||||||
pReq->daysPerFile = htonl(10);
|
|
||||||
pReq->daysToKeep0 = htonl(3650);
|
|
||||||
pReq->daysToKeep1 = htonl(3650);
|
|
||||||
pReq->daysToKeep2 = htonl(3650);
|
|
||||||
pReq->minRows = htonl(100);
|
|
||||||
pReq->maxRows = htonl(4096);
|
|
||||||
pReq->commitTime = htonl(3600);
|
|
||||||
pReq->fsyncPeriod = htonl(3000);
|
|
||||||
pReq->walLevel = 1;
|
|
||||||
pReq->precision = 0;
|
|
||||||
pReq->compression = 2;
|
|
||||||
pReq->replications = 1;
|
|
||||||
pReq->quorum = 1;
|
|
||||||
pReq->update = 0;
|
|
||||||
pReq->cacheLastRow = 0;
|
|
||||||
pReq->ignoreExist = 1;
|
|
||||||
|
|
||||||
*pContLen = contLen;
|
*pContLen = contLen;
|
||||||
return pReq;
|
return pReq;
|
||||||
|
|
|
@ -319,29 +319,31 @@ TEST_F(MndTestUser, 03_Alter_User) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int32_t contLen = sizeof(SCreateDbReq);
|
SCreateDbReq createReq = {0};
|
||||||
|
strcpy(createReq.db, "1.d2");
|
||||||
|
createReq.numOfVgroups = 2;
|
||||||
|
createReq.cacheBlockSize = 16;
|
||||||
|
createReq.totalBlocks = 10;
|
||||||
|
createReq.daysPerFile = 10;
|
||||||
|
createReq.daysToKeep0 = 3650;
|
||||||
|
createReq.daysToKeep1 = 3650;
|
||||||
|
createReq.daysToKeep2 = 3650;
|
||||||
|
createReq.minRows = 100;
|
||||||
|
createReq.maxRows = 4096;
|
||||||
|
createReq.commitTime = 3600;
|
||||||
|
createReq.fsyncPeriod = 3000;
|
||||||
|
createReq.walLevel = 1;
|
||||||
|
createReq.precision = 0;
|
||||||
|
createReq.compression = 2;
|
||||||
|
createReq.replications = 1;
|
||||||
|
createReq.quorum = 1;
|
||||||
|
createReq.update = 0;
|
||||||
|
createReq.cacheLastRow = 0;
|
||||||
|
createReq.ignoreExist = 1;
|
||||||
|
|
||||||
SCreateDbReq* pReq = (SCreateDbReq*)rpcMallocCont(contLen);
|
int32_t contLen = tSerializeSCreateDbReq(NULL, 0, &createReq);
|
||||||
strcpy(pReq->db, "1.d2");
|
void* pReq = rpcMallocCont(contLen);
|
||||||
pReq->numOfVgroups = htonl(2);
|
tSerializeSCreateDbReq(pReq, contLen, &createReq);
|
||||||
pReq->cacheBlockSize = htonl(16);
|
|
||||||
pReq->totalBlocks = htonl(10);
|
|
||||||
pReq->daysPerFile = htonl(10);
|
|
||||||
pReq->daysToKeep0 = htonl(3650);
|
|
||||||
pReq->daysToKeep1 = htonl(3650);
|
|
||||||
pReq->daysToKeep2 = htonl(3650);
|
|
||||||
pReq->minRows = htonl(100);
|
|
||||||
pReq->maxRows = htonl(4096);
|
|
||||||
pReq->commitTime = htonl(3600);
|
|
||||||
pReq->fsyncPeriod = htonl(3000);
|
|
||||||
pReq->walLevel = 1;
|
|
||||||
pReq->precision = 0;
|
|
||||||
pReq->compression = 2;
|
|
||||||
pReq->replications = 1;
|
|
||||||
pReq->quorum = 1;
|
|
||||||
pReq->update = 0;
|
|
||||||
pReq->cacheLastRow = 0;
|
|
||||||
pReq->ignoreExist = 1;
|
|
||||||
|
|
||||||
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DB, pReq, contLen);
|
||||||
ASSERT_NE(pRsp, nullptr);
|
ASSERT_NE(pRsp, nullptr);
|
||||||
|
|
|
@ -69,31 +69,35 @@ char *ctgTestCTablename = "ctable1";
|
||||||
char *ctgTestSTablename = "stable1";
|
char *ctgTestSTablename = "stable1";
|
||||||
|
|
||||||
void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
|
void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
|
||||||
SCreateDbReq *pReq = (SCreateDbReq *)rpcMallocCont(sizeof(SCreateDbReq));
|
SCreateDbReq createReq = {0};
|
||||||
strcpy(pReq->db, "1.db1");
|
strcpy(createReq.db, "1.db1");
|
||||||
pReq->numOfVgroups = htonl(2);
|
createReq.numOfVgroups = 2;
|
||||||
pReq->cacheBlockSize = htonl(16);
|
createReq.cacheBlockSize = 16;
|
||||||
pReq->totalBlocks = htonl(10);
|
createReq.totalBlocks = 10;
|
||||||
pReq->daysPerFile = htonl(10);
|
createReq.daysPerFile = 10;
|
||||||
pReq->daysToKeep0 = htonl(3650);
|
createReq.daysToKeep0 = 3650;
|
||||||
pReq->daysToKeep1 = htonl(3650);
|
createReq.daysToKeep1 = 3650;
|
||||||
pReq->daysToKeep2 = htonl(3650);
|
createReq.daysToKeep2 = 3650;
|
||||||
pReq->minRows = htonl(100);
|
createReq.minRows = 100;
|
||||||
pReq->maxRows = htonl(4096);
|
createReq.maxRows = 4096;
|
||||||
pReq->commitTime = htonl(3600);
|
createReq.commitTime = 3600;
|
||||||
pReq->fsyncPeriod = htonl(3000);
|
createReq.fsyncPeriod = 3000;
|
||||||
pReq->walLevel = 1;
|
createReq.walLevel = 1;
|
||||||
pReq->precision = 0;
|
createReq.precision = 0;
|
||||||
pReq->compression = 2;
|
createReq.compression = 2;
|
||||||
pReq->replications = 1;
|
createReq.replications = 1;
|
||||||
pReq->quorum = 1;
|
createReq.quorum = 1;
|
||||||
pReq->update = 0;
|
createReq.update = 0;
|
||||||
pReq->cacheLastRow = 0;
|
createReq.cacheLastRow = 0;
|
||||||
pReq->ignoreExist = 1;
|
createReq.ignoreExist = 1;
|
||||||
|
|
||||||
|
int32_t contLen = tSerializeSCreateDbReq(NULL, 0, &createReq);
|
||||||
|
void *pReq = rpcMallocCont(contLen);
|
||||||
|
tSerializeSCreateDbReq(pReq, contLen, &createReq);
|
||||||
|
|
||||||
SRpcMsg rpcMsg = {0};
|
SRpcMsg rpcMsg = {0};
|
||||||
rpcMsg.pCont = pReq;
|
rpcMsg.pCont = pReq;
|
||||||
rpcMsg.contLen = sizeof(SCreateDbReq);
|
rpcMsg.contLen = contLen;
|
||||||
rpcMsg.msgType = TDMT_MND_CREATE_DB;
|
rpcMsg.msgType = TDMT_MND_CREATE_DB;
|
||||||
|
|
||||||
SRpcMsg rpcRsp = {0};
|
SRpcMsg rpcRsp = {0};
|
||||||
|
@ -210,7 +214,6 @@ void ctgTestBuildDBVgroup(SDBVgroupInfo **pdbVgroup) {
|
||||||
*pdbVgroup = dbVgroup;
|
*pdbVgroup = dbVgroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestBuildSTableMetaRsp(STableMetaRsp *rspMsg) {
|
void ctgTestBuildSTableMetaRsp(STableMetaRsp *rspMsg) {
|
||||||
strcpy(rspMsg->dbFName, ctgTestDbname);
|
strcpy(rspMsg->dbFName, ctgTestDbname);
|
||||||
sprintf(rspMsg->tbName, "%s", ctgTestSTablename);
|
sprintf(rspMsg->tbName, "%s", ctgTestSTablename);
|
||||||
|
@ -248,7 +251,6 @@ void ctgTestBuildSTableMetaRsp(STableMetaRsp *rspMsg) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareDbVgroups(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareDbVgroups(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
SUseDbRsp *rspMsg = NULL; // todo
|
SUseDbRsp *rspMsg = NULL; // todo
|
||||||
|
|
||||||
|
@ -656,7 +658,6 @@ void *ctgTestSetSameDbVgroupThread(void *param) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *ctgTestSetDiffDbVgroupThread(void *param) {
|
void *ctgTestSetDiffDbVgroupThread(void *param) {
|
||||||
struct SCatalog *pCtg = (struct SCatalog *)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
@ -681,7 +682,6 @@ void *ctgTestSetDiffDbVgroupThread(void *param) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *ctgTestGetCtableMetaThread(void *param) {
|
void *ctgTestGetCtableMetaThread(void *param) {
|
||||||
struct SCatalog *pCtg = (struct SCatalog *)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
@ -741,7 +741,6 @@ void *ctgTestSetCtableMetaThread(void *param) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(tableMeta, normalTable) {
|
TEST(tableMeta, normalTable) {
|
||||||
struct SCatalog *pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
|
@ -1150,8 +1149,6 @@ TEST(tableMeta, updateStbMeta) {
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST(tableDistVgroup, normalTable) {
|
TEST(tableDistVgroup, normalTable) {
|
||||||
struct SCatalog *pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
|
@ -1418,8 +1415,6 @@ TEST(multiThread, getSetRmDiffDbVgroup) {
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST(multiThread, ctableMeta) {
|
TEST(multiThread, ctableMeta) {
|
||||||
struct SCatalog *pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
|
@ -1470,8 +1465,6 @@ TEST(multiThread, ctableMeta) {
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST(rentTest, allRent) {
|
TEST(rentTest, allRent) {
|
||||||
struct SCatalog *pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
|
@ -1530,7 +1523,8 @@ TEST(rentTest, allRent) {
|
||||||
printf("%d - expired stableNum:%d\n", i, num);
|
printf("%d - expired stableNum:%d\n", i, num);
|
||||||
if (stable) {
|
if (stable) {
|
||||||
for (int32_t n = 0; n < num; ++n) {
|
for (int32_t n = 0; n < num; ++n) {
|
||||||
printf("suid:%" PRId64 ", dbFName:%s, stbName:%s, sversion:%d, tversion:%d\n", stable[n].suid, stable[n].dbFName, stable[n].stbName, stable[n].sversion, stable[n].tversion);
|
printf("suid:%" PRId64 ", dbFName:%s, stbName:%s, sversion:%d, tversion:%d\n", stable[n].suid,
|
||||||
|
stable[n].dbFName, stable[n].stbName, stable[n].sversion, stable[n].tversion);
|
||||||
}
|
}
|
||||||
free(stable);
|
free(stable);
|
||||||
stable = NULL;
|
stable = NULL;
|
||||||
|
|
|
@ -77,7 +77,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PTR, "Invalid pointer")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MEMORY_CORRUPTED, "Memory corrupted")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MEMORY_CORRUPTED, "Memory corrupted")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_FILE_CORRUPTED, "Data file corrupted")
|
TAOS_DEFINE_ERROR(TSDB_CODE_FILE_CORRUPTED, "Data file corrupted")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_CHECKSUM_ERROR, "Checksum error")
|
TAOS_DEFINE_ERROR(TSDB_CODE_CHECKSUM_ERROR, "Checksum error")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_MSG, "Invalid config message")
|
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_MSG, "Invalid message")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_MSG_NOT_PROCESSED, "Message not processed")
|
TAOS_DEFINE_ERROR(TSDB_CODE_MSG_NOT_PROCESSED, "Message not processed")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PARA, "Invalid parameters")
|
TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_PARA, "Invalid parameters")
|
||||||
TAOS_DEFINE_ERROR(TSDB_CODE_REPEAT_INIT, "Repeat initialization")
|
TAOS_DEFINE_ERROR(TSDB_CODE_REPEAT_INIT, "Repeat initialization")
|
||||||
|
|
Loading…
Reference in New Issue