enh: limit snap replication msg by size of block data in tsdbSnapReadTimeSeriesData
This commit is contained in:
parent
e85c6349a4
commit
e66a1d6c9a
|
@ -278,6 +278,15 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int64_t tBlockDataSize(SBlockData* pBlockData) {
|
||||||
|
int64_t nData = 0;
|
||||||
|
for (int32_t iCol = 0; iCol < pBlockData->nColData; iCol++) {
|
||||||
|
SColData* pColData = tBlockDataGetColDataByIdx(pBlockData, iCol);
|
||||||
|
nData += pColData->nData;
|
||||||
|
}
|
||||||
|
return nData;
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* reader, uint8_t** data) {
|
static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* reader, uint8_t** data) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
@ -320,10 +329,13 @@ static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* reader, uint8_t** dat
|
||||||
code = tsdbIterMergerNext(reader->dataIterMerger);
|
code = tsdbIterMergerNext(reader->dataIterMerger);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
|
||||||
if (reader->blockData->nRow >= 81920) {
|
if (!(reader->blockData->nRow % 16)) {
|
||||||
|
int64_t nData = tBlockDataSize(reader->blockData);
|
||||||
|
if (nData >= 1 * 1024 * 1024) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (reader->blockData->nRow > 0) {
|
if (reader->blockData->nRow > 0) {
|
||||||
ASSERT(reader->blockData->suid || reader->blockData->uid);
|
ASSERT(reader->blockData->suid || reader->blockData->uid);
|
||||||
|
|
Loading…
Reference in New Issue