enh: control playload size of tsdb snap replication with TSDB_SNAP_DATA_PAYLOAD_SIZE

This commit is contained in:
Benguang Zhao 2023-12-06 17:51:40 +08:00
parent 5cdf2b0b04
commit ebd3b69745
4 changed files with 3 additions and 15 deletions

View File

@ -288,6 +288,7 @@ typedef enum ELogicConditionType {
#define TSDB_CONN_ACTIVE_KEY_LEN 255 #define TSDB_CONN_ACTIVE_KEY_LEN 255
#define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE #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_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE
#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value #define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value

View File

@ -26,18 +26,6 @@
extern "C" { extern "C" {
#endif #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 ======================================= // STsdbDataRAWBlockHeader =======================================
typedef struct STsdbDataRAWBlockHeader { typedef struct STsdbDataRAWBlockHeader {
struct { struct {

View File

@ -331,7 +331,7 @@ static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* reader, uint8_t** dat
if (!(reader->blockData->nRow % 16)) { if (!(reader->blockData->nRow % 16)) {
int64_t nData = tBlockDataSize(reader->blockData); int64_t nData = tBlockDataSize(reader->blockData);
if (nData >= 1 * 1024 * 1024) { if (nData >= TSDB_SNAP_DATA_PAYLOAD_SIZE) {
break; break;
} }
} }

View File

@ -21,7 +21,6 @@
static int32_t tsdbSnapRAWReadFileSetCloseReader(STsdbSnapRAWReader* reader); static int32_t tsdbSnapRAWReadFileSetCloseReader(STsdbSnapRAWReader* reader);
// reader // reader
typedef struct SDataFileRAWReaderIter { typedef struct SDataFileRAWReaderIter {
int32_t count; int32_t count;
int32_t idx; int32_t idx;
@ -180,7 +179,7 @@ static int32_t tsdbSnapRAWReadFileSetCloseIter(STsdbSnapRAWReader* reader) {
} }
static int64_t tsdbSnapRAWReadPeek(SDataFileRAWReader* 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; return size;
} }