fix: system memory not set in ut
This commit is contained in:
parent
07fa747429
commit
63e3529e0f
|
@ -3675,7 +3675,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
|
||||||
SReplica *pReplica = &pReq->replicas[i];
|
SReplica *pReplica = &pReq->replicas[i];
|
||||||
if (tDecodeSReplica(&decoder, pReplica) < 0) return -1;
|
if (tDecodeSReplica(&decoder, pReplica) < 0) return -1;
|
||||||
}
|
}
|
||||||
if (tDecodeI32(&decoder, &pReq->numOfRetensions) < 0) return -1;
|
if (tDecodeI32(&decoder, &pReq->numOfRetensions) < 0) return -1;
|
||||||
pReq->pRetensions = taosArrayInit(pReq->numOfRetensions, sizeof(SRetention));
|
pReq->pRetensions = taosArrayInit(pReq->numOfRetensions, sizeof(SRetention));
|
||||||
if (pReq->pRetensions == NULL) {
|
if (pReq->pRetensions == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
@ -3777,8 +3777,8 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq
|
||||||
if (tEncodeI32(&encoder, pReq->buffer) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->buffer) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->pageSize) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->pageSize) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->pages) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->pages) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->lastRowMem) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->lastRowMem) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->daysPerFile) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->daysPerFile) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->daysToKeep0) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->daysToKeep0) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->daysToKeep1) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->daysToKeep1) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->daysToKeep2) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->daysToKeep2) < 0) return -1;
|
||||||
|
@ -3823,7 +3823,7 @@ int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pR
|
||||||
SReplica *pReplica = &pReq->replicas[i];
|
SReplica *pReplica = &pReq->replicas[i];
|
||||||
if (tDecodeSReplica(&decoder, pReplica) < 0) return -1;
|
if (tDecodeSReplica(&decoder, pReplica) < 0) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tEndDecode(&decoder);
|
tEndDecode(&decoder);
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -30,12 +30,14 @@ void Testbase::InitLog(const char* path) {
|
||||||
tsdbDebugFlag = 0;
|
tsdbDebugFlag = 0;
|
||||||
tsLogEmbedded = 1;
|
tsLogEmbedded = 1;
|
||||||
tsAsyncLog = 0;
|
tsAsyncLog = 0;
|
||||||
tsRpcQueueMemoryAllowed = 1024 * 1024 * 64;
|
|
||||||
|
|
||||||
taosRemoveDir(path);
|
taosRemoveDir(path);
|
||||||
taosMkDir(path);
|
taosMkDir(path);
|
||||||
tstrncpy(tsLogDir, path, PATH_MAX);
|
tstrncpy(tsLogDir, path, PATH_MAX);
|
||||||
if (taosInitLog("taosdlog", 1) != 0) {
|
|
||||||
|
taosGetSystemInfo();
|
||||||
|
tsRpcQueueMemoryAllowed = tsTotalMemoryKB * 0.1;
|
||||||
|
if (taosInitLog("taosdlog", 1) != 0) {
|
||||||
printf("failed to init log file\n");
|
printf("failed to init log file\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue