TD-1207
This commit is contained in:
parent
57502cd9c0
commit
cb167af5b3
|
@ -470,7 +470,7 @@ static int dumpResultToFile(const char* fname, TAOS_RES* tres) {
|
||||||
|
|
||||||
wordexp_t full_path;
|
wordexp_t full_path;
|
||||||
|
|
||||||
if (wordexp(fname, &full_path, 0) != 0) {
|
if (wordexp((char *)fname, &full_path, 0) != 0) {
|
||||||
fprintf(stderr, "ERROR: invalid file name: %s\n", fname);
|
fprintf(stderr, "ERROR: invalid file name: %s\n", fname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,13 +201,15 @@ int gettimeofday(struct timeval *ptv, void *pTimeZone);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int we_wordc;
|
int we_wordc;
|
||||||
char **we_wordv;
|
char *we_wordv[1];
|
||||||
int we_offs;
|
int we_offs;
|
||||||
char wordPos[20];
|
char wordPos[1025];
|
||||||
} wordexp_t;
|
} wordexp_t;
|
||||||
int wordexp(const char *words, wordexp_t *pwordexp, int flags);
|
int wordexp(char *words, wordexp_t *pwordexp, int flags);
|
||||||
void wordfree(wordexp_t *pwordexp);
|
void wordfree(wordexp_t *pwordexp);
|
||||||
|
|
||||||
|
char *realpath(char *path, char *resolved_path);
|
||||||
|
|
||||||
#define openlog(a, b, c)
|
#define openlog(a, b, c)
|
||||||
#define closelog()
|
#define closelog()
|
||||||
#define LOG_ERR 0
|
#define LOG_ERR 0
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "tconfig.h"
|
#include "tconfig.h"
|
||||||
#include "tglobal.h"
|
#include "tglobal.h"
|
||||||
#include "tulog.h"
|
#include "tulog.h"
|
||||||
|
#include "taoserror.h"
|
||||||
|
|
||||||
#ifndef TAOS_OS_FUNC_SYSINFO
|
#ifndef TAOS_OS_FUNC_SYSINFO
|
||||||
|
|
||||||
|
@ -320,11 +321,12 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
|
||||||
struct statvfs info;
|
struct statvfs info;
|
||||||
if (statvfs(tsDataDir, &info)) {
|
if (statvfs(tsDataDir, &info)) {
|
||||||
uError("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno));
|
uError("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno));
|
||||||
return false;
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
diskSize->tsize = info.f_blocks * info.f_frsize;
|
diskSize->tsize = info.f_blocks * info.f_frsize;
|
||||||
diskSize->avail = info.f_bavail * info.f_frsize;
|
diskSize->avail = info.f_bavail * info.f_frsize;
|
||||||
return true;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "ttimer.h"
|
#include "ttimer.h"
|
||||||
#include "tulog.h"
|
#include "tulog.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
#include "taoserror.h"
|
||||||
#if (_WIN64)
|
#if (_WIN64)
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <mswsock.h>
|
#include <mswsock.h>
|
||||||
|
@ -126,34 +127,21 @@ bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosGetDisk() {
|
int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
|
||||||
const double unit = 1024 * 1024 * 1024;
|
|
||||||
BOOL fResult;
|
|
||||||
unsigned _int64 i64FreeBytesToCaller;
|
unsigned _int64 i64FreeBytesToCaller;
|
||||||
unsigned _int64 i64TotalBytes;
|
unsigned _int64 i64TotalBytes;
|
||||||
unsigned _int64 i64FreeBytes;
|
unsigned _int64 i64FreeBytes;
|
||||||
|
|
||||||
if (tscEmbedded) {
|
BOOL fResult = GetDiskFreeSpaceExA(dataDir, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes,
|
||||||
fResult = GetDiskFreeSpaceExA(tsDataDir, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes,
|
|
||||||
(PULARGE_INTEGER)&i64FreeBytes);
|
(PULARGE_INTEGER)&i64FreeBytes);
|
||||||
if (fResult) {
|
if (fResult) {
|
||||||
tsTotalDataDirGB = (float)(i64TotalBytes / unit);
|
diskSize->tsize = (int64_t)(i64TotalBytes);
|
||||||
tsAvailDataDirGB = (float)(i64FreeBytes / unit);
|
diskSize->avail = (int64_t)(i64FreeBytes);
|
||||||
}
|
return 0;
|
||||||
}
|
} else {
|
||||||
|
uError("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno));
|
||||||
fResult = GetDiskFreeSpaceExA(tsLogDir, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes,
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
(PULARGE_INTEGER)&i64FreeBytes);
|
return -1;
|
||||||
if (fResult) {
|
|
||||||
tsTotalLogDirGB = (float)(i64TotalBytes / unit);
|
|
||||||
tsAvailLogDirGB = (float)(i64FreeBytes / unit);
|
|
||||||
}
|
|
||||||
|
|
||||||
fResult = GetDiskFreeSpaceExA(tsTempDir, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes,
|
|
||||||
(PULARGE_INTEGER)&i64FreeBytes);
|
|
||||||
if (fResult) {
|
|
||||||
tsTotalTmpDirGB = (float)(i64TotalBytes / unit);
|
|
||||||
tsAvailTmpDirectorySpace = (float)(i64FreeBytes / unit);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +193,7 @@ void taosGetSystemInfo() {
|
||||||
tsTotalMemoryMB = taosGetTotalMemory();
|
tsTotalMemoryMB = taosGetTotalMemory();
|
||||||
|
|
||||||
float tmp1, tmp2;
|
float tmp1, tmp2;
|
||||||
taosGetDisk();
|
// taosGetDisk();
|
||||||
taosGetBandSpeed(&tmp1);
|
taosGetBandSpeed(&tmp1);
|
||||||
taosGetCpuUsage(&tmp1, &tmp2);
|
taosGetCpuUsage(&tmp1, &tmp2);
|
||||||
taosGetProcIO(&tmp1, &tmp2);
|
taosGetProcIO(&tmp1, &tmp2);
|
||||||
|
|
|
@ -21,13 +21,24 @@
|
||||||
#include "tulog.h"
|
#include "tulog.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
|
||||||
int wordexp(const char *words, wordexp_t *pwordexp, int flags) {
|
int wordexp(char *words, wordexp_t *pwordexp, int flags) {
|
||||||
pwordexp->we_offs = 0;
|
pwordexp->we_offs = 0;
|
||||||
pwordexp->we_wordc = 1;
|
pwordexp->we_wordc = 1;
|
||||||
pwordexp->we_wordv = (char **)(pwordexp->wordPos);
|
pwordexp->we_wordv[0] = pwordexp->wordPos;
|
||||||
pwordexp->we_wordv[0] = (char *)words;
|
|
||||||
|
memset(pwordexp->wordPos, 0, 1025);
|
||||||
|
if (_fullpath(words, pwordexp->wordPos, 1024) == NULL) {
|
||||||
|
pwordexp->we_wordv[0] = words;
|
||||||
|
uError("failed to parse relative path:%s to abs path", words);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uTrace("parse relative path:%s to abs path:%s", words, pwordexp->wordPos);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wordfree(wordexp_t *pwordexp) {}
|
void wordfree(wordexp_t *pwordexp) {}
|
||||||
|
|
||||||
|
char *realpath(char *path, char *resolved_path) {
|
||||||
|
return _fullpath(path, resolved_path, TSDB_FILENAME_LEN - 1);
|
||||||
|
}
|
|
@ -42,17 +42,17 @@ SDisk *tfsFreeDisk(SDisk *pDisk) {
|
||||||
int tfsUpdateDiskInfo(SDisk *pDisk) {
|
int tfsUpdateDiskInfo(SDisk *pDisk) {
|
||||||
ASSERT(pDisk != NULL);
|
ASSERT(pDisk != NULL);
|
||||||
|
|
||||||
struct statvfs dstat;
|
SysDiskSize diskSize = {0};
|
||||||
if (statvfs(pDisk->dir, &dstat) < 0) {
|
|
||||||
|
int code = taosGetDiskSize(pDisk->dir, &diskSize);
|
||||||
|
if (code != 0) {
|
||||||
fError("failed to update disk information at level %d id %d dir %s since %s", pDisk->level, pDisk->id, pDisk->dir,
|
fError("failed to update disk information at level %d id %d dir %s since %s", pDisk->level, pDisk->id, pDisk->dir,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
pDisk->dmeta.size = 0;
|
|
||||||
pDisk->dmeta.free = 0;
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
pDisk->dmeta.size = dstat.f_blocks * dstat.f_frsize;
|
|
||||||
pDisk->dmeta.free = dstat.f_bavail * dstat.f_frsize;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pDisk->dmeta.size = diskSize.tsize;
|
||||||
|
pDisk->dmeta.free = diskSize.tsize - diskSize.avail;
|
||||||
|
|
||||||
|
return code;
|
||||||
}
|
}
|
|
@ -21,9 +21,6 @@
|
||||||
#include "tfs.h"
|
#include "tfs.h"
|
||||||
#include "tfsint.h"
|
#include "tfsint.h"
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
pthread_spinlock_t lock;
|
pthread_spinlock_t lock;
|
||||||
SFSMeta meta;
|
SFSMeta meta;
|
||||||
|
@ -582,19 +579,17 @@ void taosGetDisk() {
|
||||||
|
|
||||||
if (tscEmbedded) {
|
if (tscEmbedded) {
|
||||||
tfsUpdateInfo(&fsMeta);
|
tfsUpdateInfo(&fsMeta);
|
||||||
tsTotalDataDirGB = (float)fsMeta.tsize / unit;
|
tsTotalDataDirGB = (float)(fsMeta.tsize / unit);
|
||||||
tsAvailDataDirGB = (float)fsMeta.avail / unit;
|
tsAvailDataDirGB = (float)(fsMeta.avail / unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosGetDiskSize(tsLogDir, &diskSize)) {
|
if (taosGetDiskSize(tsLogDir, &diskSize) == 0) {
|
||||||
tsTotalLogDirGB = (float)diskSize.tsize / unit;
|
tsTotalLogDirGB = (float)(diskSize.tsize / unit);
|
||||||
tsAvailLogDirGB = (float)diskSize.avail / unit;
|
tsAvailLogDirGB = (float)(diskSize.avail / unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosGetDiskSize("/tmp", &diskSize)) {
|
if (taosGetDiskSize("/tmp", &diskSize) == 0) {
|
||||||
tsTotalTmpDirGB = (float)diskSize.tsize / unit;
|
tsTotalTmpDirGB = (float)(diskSize.tsize / unit);
|
||||||
tsAvailTmpDirectorySpace = (float)diskSize.avail / unit;
|
tsAvailTmpDirectorySpace = (float)(diskSize.avail / unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
|
@ -133,7 +133,7 @@ static FORCE_INLINE int tsdbAppendMFile(SMFile* pMFile, void* buf, int64_t nbyte
|
||||||
|
|
||||||
pMFile->info.size += nbyte;
|
pMFile->info.size += nbyte;
|
||||||
|
|
||||||
return nbyte;
|
return (int)nbyte;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FORCE_INLINE int tsdbRemoveMFile(SMFile* pMFile) { return tfsremove(TSDB_FILE_F(pMFile)); }
|
static FORCE_INLINE int tsdbRemoveMFile(SMFile* pMFile) { return tfsremove(TSDB_FILE_F(pMFile)); }
|
||||||
|
@ -246,7 +246,7 @@ static FORCE_INLINE int tsdbAppendDFile(SDFile* pDFile, void* buf, int64_t nbyte
|
||||||
|
|
||||||
pDFile->info.size += nbyte;
|
pDFile->info.size += nbyte;
|
||||||
|
|
||||||
return nbyte;
|
return (int)nbyte;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FORCE_INLINE int tsdbRemoveDFile(SDFile* pDFile) { return tfsremove(TSDB_FILE_F(pDFile)); }
|
static FORCE_INLINE int tsdbRemoveDFile(SDFile* pDFile) { return tfsremove(TSDB_FILE_F(pDFile)); }
|
||||||
|
|
|
@ -205,9 +205,9 @@ void tsdbGetRtnSnap(STsdbRepo *pRepo, SRtn *pRtn) {
|
||||||
maxKey = now - pCfg->keep1 * tsMsPerDay[pCfg->precision];
|
maxKey = now - pCfg->keep1 * tsMsPerDay[pCfg->precision];
|
||||||
|
|
||||||
pRtn->minKey = minKey;
|
pRtn->minKey = minKey;
|
||||||
pRtn->minFid = TSDB_KEY_FID(minKey, pCfg->daysPerFile, pCfg->precision);
|
pRtn->minFid = (int)(TSDB_KEY_FID(minKey, pCfg->daysPerFile, pCfg->precision));
|
||||||
pRtn->midFid = TSDB_KEY_FID(midKey, pCfg->daysPerFile, pCfg->precision);
|
pRtn->midFid = (int)(TSDB_KEY_FID(midKey, pCfg->daysPerFile, pCfg->precision));
|
||||||
pRtn->maxFid = TSDB_KEY_FID(maxKey, pCfg->daysPerFile, pCfg->precision);
|
pRtn->maxFid = (int)(TSDB_KEY_FID(maxKey, pCfg->daysPerFile, pCfg->precision));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tsdbUpdateMetaRecord(STsdbFS *pfs, SMFile *pMFile, uint64_t uid, void *cont, int contLen) {
|
static int tsdbUpdateMetaRecord(STsdbFS *pfs, SMFile *pMFile, uint64_t uid, void *cont, int contLen) {
|
||||||
|
@ -571,7 +571,7 @@ static int tsdbNextCommitFid(SCommitH *pCommith) {
|
||||||
if (nextKey == TSDB_DATA_TIMESTAMP_NULL) {
|
if (nextKey == TSDB_DATA_TIMESTAMP_NULL) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
int tfid = TSDB_KEY_FID(nextKey, pCfg->daysPerFile, pCfg->precision);
|
int tfid = (int)(TSDB_KEY_FID(nextKey, pCfg->daysPerFile, pCfg->precision));
|
||||||
if (fid == TSDB_IVLD_FID || fid > tfid) {
|
if (fid == TSDB_IVLD_FID || fid > tfid) {
|
||||||
fid = tfid;
|
fid = tfid;
|
||||||
}
|
}
|
||||||
|
@ -950,7 +950,7 @@ static int tsdbWriteBlockIdx(SCommitH *pCommih) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tsdbUpdateDFileMagic(pHeadf, POINTER_SHIFT(TSDB_COMMIT_BUF(pCommih), tlen - sizeof(TSCKSUM)));
|
tsdbUpdateDFileMagic(pHeadf, POINTER_SHIFT(TSDB_COMMIT_BUF(pCommih), tlen - sizeof(TSCKSUM)));
|
||||||
pHeadf->info.offset = offset;
|
pHeadf->info.offset = (uint32_t)offset;
|
||||||
pHeadf->info.len = tlen;
|
pHeadf->info.len = tlen;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
* 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 "os.h"
|
||||||
#include "tsdbint.h"
|
#include "tsdbint.h"
|
||||||
|
#include <regex.h>
|
||||||
|
|
||||||
typedef enum { TSDB_TXN_TEMP_FILE = 0, TSDB_TXN_CURR_FILE } TSDB_TXN_FILE_T;
|
typedef enum { TSDB_TXN_TEMP_FILE = 0, TSDB_TXN_CURR_FILE } TSDB_TXN_FILE_T;
|
||||||
static const char *tsdbTxnFname[] = {"current.t", "current"};
|
static const char *tsdbTxnFname[] = {"current.t", "current"};
|
||||||
|
@ -162,7 +164,7 @@ static void tsdbSetStatusMFile(SFSStatus *pStatus, const SMFile *pMFile) {
|
||||||
ASSERT(pStatus->pmf == NULL);
|
ASSERT(pStatus->pmf == NULL);
|
||||||
|
|
||||||
pStatus->pmf = &(pStatus->mf);
|
pStatus->pmf = &(pStatus->mf);
|
||||||
tsdbInitMFileEx(pStatus->pmf, pMFile);
|
tsdbInitMFileEx(pStatus->pmf, (SMFile *)pMFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tsdbAddDFileSetToStatus(SFSStatus *pStatus, const SDFileSet *pSet) {
|
static int tsdbAddDFileSetToStatus(SFSStatus *pStatus, const SDFileSet *pSet) {
|
||||||
|
@ -590,7 +592,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nread = taosRead(fd, buffer, TSDB_FILE_HEAD_SIZE);
|
int nread = (int)taosRead(fd, buffer, TSDB_FILE_HEAD_SIZE);
|
||||||
if (nread < 0) {
|
if (nread < 0) {
|
||||||
tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pRepo), TSDB_FILENAME_LEN, current,
|
tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pRepo), TSDB_FILENAME_LEN, current,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
@ -624,7 +626,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
nread = taosRead(fd, buffer, fsheader.len);
|
nread = (int)taosRead(fd, buffer, fsheader.len);
|
||||||
if (nread < 0) {
|
if (nread < 0) {
|
||||||
tsdbError("vgId:%d failed to read file %s since %s", REPO_ID(pRepo), current, strerror(errno));
|
tsdbError("vgId:%d failed to read file %s since %s", REPO_ID(pRepo), current, strerror(errno));
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
@ -763,7 +765,7 @@ int tsdbLoadMetaCache(STsdbRepo *pRepo, bool recoverMeta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recoverMeta) {
|
if (recoverMeta) {
|
||||||
pBuf = malloc(maxBufSize);
|
pBuf = malloc((size_t)maxBufSize);
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||||
tsdbCloseMFile(pMFile);
|
tsdbCloseMFile(pMFile);
|
||||||
|
@ -780,7 +782,7 @@ int tsdbLoadMetaCache(STsdbRepo *pRepo, bool recoverMeta) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nread = tsdbReadMFile(pMFile, pBuf, pRecord->size);
|
int nread = (int)tsdbReadMFile(pMFile, pBuf, pRecord->size);
|
||||||
if (nread < 0) {
|
if (nread < 0) {
|
||||||
tsdbError("vgId:%d failed to read file %s since %s", REPO_ID(pRepo), TSDB_FILE_FULL_NAME(pMFile),
|
tsdbError("vgId:%d failed to read file %s since %s", REPO_ID(pRepo), TSDB_FILE_FULL_NAME(pMFile),
|
||||||
tstrerror(terrno));
|
tstrerror(terrno));
|
||||||
|
@ -798,7 +800,7 @@ int tsdbLoadMetaCache(STsdbRepo *pRepo, bool recoverMeta) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsdbRestoreTable(pRepo, pBuf, pRecord->size) < 0) {
|
if (tsdbRestoreTable(pRepo, pBuf, (size_t)pRecord->size) < 0) {
|
||||||
tsdbError("vgId:%d failed to restore table, uid %" PRId64 ", since %s" PRIu64, REPO_ID(pRepo), pRecord->uid,
|
tsdbError("vgId:%d failed to restore table, uid %" PRId64 ", since %s" PRIu64, REPO_ID(pRepo), pRecord->uid,
|
||||||
tstrerror(terrno));
|
tstrerror(terrno));
|
||||||
tfree(pBuf);
|
tfree(pBuf);
|
||||||
|
|
|
@ -149,10 +149,10 @@ static int32_t tsdbSyncSendMeta(SSyncH *pSynch) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t writeLen = mf.info.size;
|
int32_t writeLen = (int32_t)mf.info.size;
|
||||||
tsdbInfo("vgId:%d, metafile:%s will be sent, size:%d", REPO_ID(pRepo), mf.f.aname, writeLen);
|
tsdbInfo("vgId:%d, metafile:%s will be sent, size:%d", REPO_ID(pRepo), mf.f.aname, writeLen);
|
||||||
|
|
||||||
int32_t ret = taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&mf), 0, writeLen);
|
int32_t ret = (int32_t)taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&mf), 0, writeLen);
|
||||||
if (ret != writeLen) {
|
if (ret != writeLen) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
tsdbError("vgId:%d, failed to send metafile since %s, ret:%d writeLen:%d", REPO_ID(pRepo), tstrerror(terrno), ret,
|
tsdbError("vgId:%d, failed to send metafile since %s, ret:%d writeLen:%d", REPO_ID(pRepo), tstrerror(terrno), ret,
|
||||||
|
@ -213,7 +213,7 @@ static int32_t tsdbSyncRecvMeta(SSyncH *pSynch) {
|
||||||
|
|
||||||
tsdbInfo("vgId:%d, metafile:%s is created", REPO_ID(pRepo), mf.f.aname);
|
tsdbInfo("vgId:%d, metafile:%s is created", REPO_ID(pRepo), mf.f.aname);
|
||||||
|
|
||||||
int32_t readLen = pSynch->pmf->info.size;
|
int32_t readLen = (int32_t)pSynch->pmf->info.size;
|
||||||
int32_t ret = taosCopyFds(pSynch->socketFd, TSDB_FILE_FD(&mf), readLen);
|
int32_t ret = taosCopyFds(pSynch->socketFd, TSDB_FILE_FD(&mf), readLen);
|
||||||
if (ret != readLen) {
|
if (ret != readLen) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
@ -458,7 +458,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
|
||||||
tsdbInfo("vgId:%d, file:%s will be received, osize:%" PRIu64 " rsize:%" PRIu64, REPO_ID(pRepo),
|
tsdbInfo("vgId:%d, file:%s will be received, osize:%" PRIu64 " rsize:%" PRIu64, REPO_ID(pRepo),
|
||||||
pDFile->f.aname, pDFile->info.size, pRDFile->info.size);
|
pDFile->f.aname, pDFile->info.size, pRDFile->info.size);
|
||||||
|
|
||||||
int32_t writeLen = pRDFile->info.size;
|
int32_t writeLen = (int32_t)pRDFile->info.size;
|
||||||
int32_t ret = taosCopyFds(pSynch->socketFd, pDFile->fd, writeLen);
|
int32_t ret = taosCopyFds(pSynch->socketFd, pDFile->fd, writeLen);
|
||||||
if (ret != writeLen) {
|
if (ret != writeLen) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
@ -570,10 +570,10 @@ static int32_t tsdbSyncSendDFileSet(SSyncH *pSynch, SDFileSet *pSet) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t writeLen = df.info.size;
|
int32_t writeLen = (int32_t)df.info.size;
|
||||||
tsdbInfo("vgId:%d, file:%s will be sent, size:%d", REPO_ID(pRepo), df.f.aname, writeLen);
|
tsdbInfo("vgId:%d, file:%s will be sent, size:%d", REPO_ID(pRepo), df.f.aname, writeLen);
|
||||||
|
|
||||||
int32_t ret = taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&df), 0, writeLen);
|
int32_t ret = (int32_t)taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&df), 0, writeLen);
|
||||||
if (ret != writeLen) {
|
if (ret != writeLen) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
tsdbError("vgId:%d, failed to send file:%s since %s, ret:%d writeLen:%d", REPO_ID(pRepo), df.f.aname,
|
tsdbError("vgId:%d, failed to send file:%s since %s, ret:%d writeLen:%d", REPO_ID(pRepo), df.f.aname,
|
||||||
|
|
Loading…
Reference in New Issue