提交 c9b8e748 编写于 作者: S Shengliang Guan

add logs

上级 3c0077a3
......@@ -71,7 +71,7 @@ class Testbase {
const char* GetShowBinary(int32_t len);
private:
int32_t showId;
int64_t showId;
STableMetaMsg* pMeta;
SRetrieveTableRsp* pRetrieveRsp;
char* pData;
......
......@@ -79,7 +79,7 @@ void Testbase::SendShowMetaMsg(int8_t showType, const char* db) {
SShowRsp* pShowRsp = (SShowRsp*)pMsg->pCont;
ASSERT(pShowRsp != nullptr);
pShowRsp->showId = htonl(pShowRsp->showId);
pShowRsp->showId = htobe64(pShowRsp->showId);
pMeta = &pShowRsp->tableMeta;
pMeta->numOfTags = htonl(pMeta->numOfTags);
pMeta->numOfColumns = htonl(pMeta->numOfColumns);
......@@ -121,7 +121,7 @@ void Testbase::SendShowRetrieveMsg() {
int32_t contLen = sizeof(SRetrieveTableMsg);
SRetrieveTableMsg* pRetrieve = (SRetrieveTableMsg*)rpcMallocCont(contLen);
pRetrieve->showId = htonl(showId);
pRetrieve->showId = htobe64(showId);
pRetrieve->free = 0;
SRpcMsg* pMsg = SendMsg(TDMT_MND_SHOW_RETRIEVE, pRetrieve, contLen);
......
......@@ -33,7 +33,7 @@ static void mndCancelGetNextCluster(SMnode *pMnode, void *pIter);
int32_t mndInitCluster(SMnode *pMnode) {
SSdbTable table = {.sdbType = SDB_CLUSTER,
.keyType = SDB_KEY_INT32,
.keyType = SDB_KEY_INT64,
.deployFp = (SdbDeployFp)mndCreateDefaultCluster,
.encodeFp = (SdbEncodeFp)mndClusterActionEncode,
.decodeFp = (SdbDecodeFp)mndClusterActionDecode,
......@@ -128,6 +128,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
clusterObj.id = mndGenerateUid(clusterObj.name, TSDB_CLUSTER_ID_LEN);
clusterObj.id = (clusterObj.id >= 0 ? clusterObj.id : -clusterObj.id);
pMnode->clusterId = clusterObj.id;
mDebug("cluster:%" PRId64 ", name is %s", clusterObj.id, clusterObj.name);
SSdbRaw *pRaw = mndClusterActionEncode(&clusterObj);
......
......@@ -72,7 +72,9 @@ typedef struct SSdb {
} SSdb;
int32_t sdbWriteFile(SSdb *pSdb);
void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper);
const char *sdbTableName(ESdbType type);
void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper);
#ifdef __cplusplus
}
......
......@@ -121,6 +121,8 @@ int32_t sdbWriteFile(SSdb *pSdb) {
char curfile[PATH_MAX] = {0};
snprintf(curfile, sizeof(curfile), "%s%ssdb.data", pSdb->currDir, TD_DIRSEP);
mDebug("start to write file:%s", curfile);
FileFd fd = taosOpenFileCreateWrite(tmpfile);
if (fd <= 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
......@@ -132,6 +134,8 @@ int32_t sdbWriteFile(SSdb *pSdb) {
SdbEncodeFp encodeFp = pSdb->encodeFps[i];
if (encodeFp == NULL) continue;
mTrace("sdb write %s, total %d rows", sdbTableName(i), sdbGetSize(pSdb, i));
SHashObj *hash = pSdb->hashObjs[i];
SRWLatch *pLock = &pSdb->locks[i];
taosWLockLatch(pLock);
......@@ -144,6 +148,8 @@ int32_t sdbWriteFile(SSdb *pSdb) {
continue;
}
sdbPrintOper(pSdb, pRow, "writeFile");
SSdbRaw *pRaw = (*encodeFp)(pRow->pObj);
if (pRaw != NULL) {
pRaw->status = pRow->status;
......
......@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE
#include "sdbInt.h"
static const char *sdbTableName(ESdbType type) {
const char *sdbTableName(ESdbType type) {
switch (type) {
case SDB_TRANS:
return "trans";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册