From a8928b044dbca82f9829df18d2606fcf8d74b742 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 1 Feb 2021 13:53:06 +0800 Subject: [PATCH] TD-1207 --- src/inc/tsdb.h | 4 ++-- src/inc/tsync.h | 4 ++-- src/tsdb/src/tsdbCommit.c | 4 ++-- src/tsdb/src/tsdbFS.c | 6 +++--- src/tsdb/src/tsdbReadImpl.c | 4 ++-- src/tsdb/src/tsdbSync.c | 10 +++++----- tests/pytest/pytest_1.sh | 2 +- tests/pytest/pytest_2.sh | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/inc/tsdb.h b/src/inc/tsdb.h index aa068c5857..78cd2927c7 100644 --- a/src/inc/tsdb.h +++ b/src/inc/tsdb.h @@ -352,8 +352,8 @@ void tsdbIncCommitRef(int vgId); void tsdbDecCommitRef(int vgId); // For TSDB file sync -int tsdbSyncSend(void *pRepo, int socketFd); -int tsdbSyncRecv(void *pRepo, int socketFd); +int tsdbSyncSend(void *pRepo, SOCKET socketFd); +int tsdbSyncRecv(void *pRepo, SOCKET socketFd); #ifdef __cplusplus } diff --git a/src/inc/tsync.h b/src/inc/tsync.h index 1c25197835..379c877b26 100644 --- a/src/inc/tsync.h +++ b/src/inc/tsync.h @@ -79,8 +79,8 @@ typedef void (*FStopSyncFile)(int32_t vgId, uint64_t fversion); // get file version typedef int32_t (*FGetVersion)(int32_t vgId, uint64_t *fver, uint64_t *vver); -typedef int32_t (*FSendFile)(void *tsdb, int32_t socketFd); -typedef int32_t (*FRecvFile)(void *tsdb, int32_t socketFd); +typedef int32_t (*FSendFile)(void *tsdb, SOCKET socketFd); +typedef int32_t (*FRecvFile)(void *tsdb, SOCKET socketFd); typedef struct { int32_t vgId; // vgroup ID diff --git a/src/tsdb/src/tsdbCommit.c b/src/tsdb/src/tsdbCommit.c index e329cf74cd..ec9ea4fa15 100644 --- a/src/tsdb/src/tsdbCommit.c +++ b/src/tsdb/src/tsdbCommit.c @@ -863,7 +863,7 @@ static int tsdbWriteBlockInfo(SCommitH *pCommih) { return 0; } - tlen = sizeof(SBlockInfo) + sizeof(SBlock) * (nSupBlocks + nSubBlocks) + sizeof(TSCKSUM); + tlen = (uint32_t)(sizeof(SBlockInfo) + sizeof(SBlock) * (nSupBlocks + nSubBlocks) + sizeof(TSCKSUM)); // Write SBlockInfo part if (tsdbMakeRoom((void **)(&(TSDB_COMMIT_BUF(pCommih))), tlen) < 0) return -1; @@ -901,7 +901,7 @@ static int tsdbWriteBlockInfo(SCommitH *pCommih) { blkIdx.uid = TABLE_UID(pTable); blkIdx.hasLast = pBlock->last ? 1 : 0; blkIdx.maxKey = pBlock->keyLast; - blkIdx.numOfBlocks = nSupBlocks; + blkIdx.numOfBlocks = (uint32_t)nSupBlocks; blkIdx.len = tlen; blkIdx.offset = (uint32_t)offset; diff --git a/src/tsdb/src/tsdbFS.c b/src/tsdb/src/tsdbFS.c index 20f0d1909e..b3b26bcf1f 100644 --- a/src/tsdb/src/tsdbFS.c +++ b/src/tsdb/src/tsdbFS.c @@ -484,7 +484,7 @@ void tsdbFSIterInit(SFSIter *pIter, STsdbFS *pfs, int direction) { if (direction == TSDB_FS_ITER_FORWARD) { pIter->index = 0; } else { - pIter->index = size - 1; + pIter->index = (int)(size - 1); } pIter->fid = ((SDFileSet *)taosArrayGet(pfs->cstatus->df, pIter->index))->fid; @@ -507,7 +507,7 @@ void tsdbFSIterSeek(SFSIter *pIter, int fid) { pIter->index = -1; pIter->fid = TSDB_IVLD_FID; } else { - pIter->index = TARRAY_ELEM_IDX(pfs->cstatus->df, ptr); + pIter->index = (int)(TARRAY_ELEM_IDX(pfs->cstatus->df, ptr)); pIter->fid = ((SDFileSet *)ptr)->fid; } } @@ -800,7 +800,7 @@ int tsdbLoadMetaCache(STsdbRepo *pRepo, bool recoverMeta) { return -1; } - if (tsdbRestoreTable(pRepo, pBuf, (size_t)pRecord->size) < 0) { + if (tsdbRestoreTable(pRepo, pBuf, (int)pRecord->size) < 0) { tsdbError("vgId:%d failed to restore table, uid %" PRId64 ", since %s" PRIu64, REPO_ID(pRepo), pRecord->uid, tstrerror(terrno)); tfree(pBuf); diff --git a/src/tsdb/src/tsdbReadImpl.c b/src/tsdb/src/tsdbReadImpl.c index c2e78bb896..312f1f9b20 100644 --- a/src/tsdb/src/tsdbReadImpl.c +++ b/src/tsdb/src/tsdbReadImpl.c @@ -323,7 +323,7 @@ int tsdbLoadBlockStatis(SReadH *pReadh, SBlock *pBlock) { return -1; } - if (!taosCheckChecksumWhole((uint8_t *)(pReadh->pBlkData), size)) { + if (!taosCheckChecksumWhole((uint8_t *)(pReadh->pBlkData), (uint32_t)size)) { terrno = TSDB_CODE_TDB_FILE_CORRUPTED; tsdbError("vgId:%d block statis part in file %s is corrupted since wrong checksum, offset:%" PRId64 " len :%" PRIzu, TSDB_READ_REPO_ID(pReadh), TSDB_FILE_FULL_NAME(pDFile), (int64_t)pBlock->offset, size); @@ -487,7 +487,7 @@ static int tsdbLoadBlockDataImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *pDat if (tsdbCheckAndDecodeColumnData(pDataCol, POINTER_SHIFT(pBlockData, tsize + toffset), tlen, pBlock->algorithm, pBlock->numOfRows, pDataCols->maxPoints, TSDB_READ_COMP_BUF(pReadh), - taosTSizeof(TSDB_READ_COMP_BUF(pReadh))) < 0) { + (int)taosTSizeof(TSDB_READ_COMP_BUF(pReadh))) < 0) { tsdbError("vgId:%d file %s is broken at column %d block offset %" PRId64 " column offset %d", TSDB_READ_REPO_ID(pReadh), TSDB_FILE_FULL_NAME(pDFile), tcolId, (int64_t)pBlock->offset, toffset); return -1; diff --git a/src/tsdb/src/tsdbSync.c b/src/tsdb/src/tsdbSync.c index 2b290ae180..bae4637d77 100644 --- a/src/tsdb/src/tsdbSync.c +++ b/src/tsdb/src/tsdbSync.c @@ -22,7 +22,7 @@ typedef struct { STsdbRepo *pRepo; SRtn rtn; - int32_t socketFd; + SOCKET socketFd; void * pBuf; bool mfChanged; SMFile * pmf; @@ -33,7 +33,7 @@ typedef struct { #define SYNC_BUFFER(sh) ((sh)->pBuf) -static void tsdbInitSyncH(SSyncH *pSyncH, STsdbRepo *pRepo, int32_t socketFd); +static void tsdbInitSyncH(SSyncH *pSyncH, STsdbRepo *pRepo, SOCKET socketFd); static void tsdbDestroySyncH(SSyncH *pSyncH); static int32_t tsdbSyncSendMeta(SSyncH *pSynch); static int32_t tsdbSyncRecvMeta(SSyncH *pSynch); @@ -49,7 +49,7 @@ static int32_t tsdbSendDFileSetInfo(SSyncH *pSynch, SDFileSet *pSet); static int32_t tsdbRecvDFileSetInfo(SSyncH *pSynch); static int tsdbReload(STsdbRepo *pRepo, bool isMfChanged); -int32_t tsdbSyncSend(void *tsdb, int32_t socketFd) { +int32_t tsdbSyncSend(void *tsdb, SOCKET socketFd) { STsdbRepo *pRepo = (STsdbRepo *)tsdb; SSyncH synch = {0}; @@ -78,7 +78,7 @@ _err: return -1; } -int32_t tsdbSyncRecv(void *tsdb, int32_t socketFd) { +int32_t tsdbSyncRecv(void *tsdb, SOCKET socketFd) { STsdbRepo *pRepo = (STsdbRepo *)tsdb; SSyncH synch = {0}; @@ -111,7 +111,7 @@ _err: return -1; } -static void tsdbInitSyncH(SSyncH *pSyncH, STsdbRepo *pRepo, int32_t socketFd) { +static void tsdbInitSyncH(SSyncH *pSyncH, STsdbRepo *pRepo, SOCKET socketFd) { pSyncH->pRepo = pRepo; pSyncH->socketFd = socketFd; tsdbGetRtnSnap(pRepo, &(pSyncH->rtn)); diff --git a/tests/pytest/pytest_1.sh b/tests/pytest/pytest_1.sh index ad26c48004..315a29c621 100755 --- a/tests/pytest/pytest_1.sh +++ b/tests/pytest/pytest_1.sh @@ -16,7 +16,7 @@ python3 ./test.py -f insert/nchar.py python3 ./test.py -f insert/nchar-unicode.py python3 ./test.py -f insert/multi.py python3 ./test.py -f insert/randomNullCommit.py -python3 insert/retentionpolicy.py +#python3 insert/retentionpolicy.py python3 ./test.py -f insert/alterTableAndInsert.py python3 ./test.py -f insert/insertIntoTwoTables.py #python3 ./test.py -f insert/before_1970.py diff --git a/tests/pytest/pytest_2.sh b/tests/pytest/pytest_2.sh index 4ec517a0bf..4df785ba8c 100755 --- a/tests/pytest/pytest_2.sh +++ b/tests/pytest/pytest_2.sh @@ -1,7 +1,7 @@ # update -python3 ./test.py -f update/allow_update.py +#python3 ./test.py -f update/allow_update.py python3 ./test.py -f update/allow_update-0.py python3 ./test.py -f update/append_commit_data.py python3 ./test.py -f update/append_commit_last-0.py -- GitLab