enh: control playload size of tsdb snap replication with TSDB_SNAP_DATA_PAYLOAD_SIZE
This commit is contained in:
parent
5cdf2b0b04
commit
ebd3b69745
|
@ -288,6 +288,7 @@ typedef enum ELogicConditionType {
|
|||
#define TSDB_CONN_ACTIVE_KEY_LEN 255
|
||||
|
||||
#define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE
|
||||
#define TSDB_SNAP_DATA_PAYLOAD_SIZE (1 * 1024 * 1024)
|
||||
|
||||
#define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE
|
||||
#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value
|
||||
|
|
|
@ -26,18 +26,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define TSDB_SNAP_RAW_PAYLOAD_SIZE (4096 * 1024)
|
||||
#if 0
|
||||
struct SDataRAWBlock {
|
||||
int8_t *data;
|
||||
int64_t size;
|
||||
};
|
||||
|
||||
int32_t tsdbDataRAWBlockReset(SDataRAWBlock *pBlock);
|
||||
int32_t tsdbDataRAWBlockAlloc(SDataRawBlock *pBlock);
|
||||
void tsdbDataRAWBlockFree(SDataRAWBlock *pBlock);
|
||||
#endif
|
||||
|
||||
// STsdbDataRAWBlockHeader =======================================
|
||||
typedef struct STsdbDataRAWBlockHeader {
|
||||
struct {
|
||||
|
|
|
@ -331,7 +331,7 @@ static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* reader, uint8_t** dat
|
|||
|
||||
if (!(reader->blockData->nRow % 16)) {
|
||||
int64_t nData = tBlockDataSize(reader->blockData);
|
||||
if (nData >= 1 * 1024 * 1024) {
|
||||
if (nData >= TSDB_SNAP_DATA_PAYLOAD_SIZE) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
static int32_t tsdbSnapRAWReadFileSetCloseReader(STsdbSnapRAWReader* reader);
|
||||
|
||||
// reader
|
||||
|
||||
typedef struct SDataFileRAWReaderIter {
|
||||
int32_t count;
|
||||
int32_t idx;
|
||||
|
@ -180,7 +179,7 @@ static int32_t tsdbSnapRAWReadFileSetCloseIter(STsdbSnapRAWReader* reader) {
|
|||
}
|
||||
|
||||
static int64_t tsdbSnapRAWReadPeek(SDataFileRAWReader* reader) {
|
||||
int64_t size = TMIN(reader->config->file.size - reader->ctx->offset, TSDB_SNAP_RAW_PAYLOAD_SIZE);
|
||||
int64_t size = TMIN(reader->config->file.size - reader->ctx->offset, TSDB_SNAP_DATA_PAYLOAD_SIZE);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue