From 95b735a8837ae3090220f981f97f223a8802573f Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 24 May 2021 15:22:57 +0300 Subject: [PATCH] lib/storage: allow filling all the rows up to their capacity in rawRowsShard.addRows This should reduce memory usage a bit on data ingestion path --- lib/storage/partition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/storage/partition.go b/lib/storage/partition.go index 9b5118737a..22ace71754 100644 --- a/lib/storage/partition.go +++ b/lib/storage/partition.go @@ -484,7 +484,7 @@ func (rrs *rawRowsShard) addRows(pt *partition, rows []rawRow) { if cap(rrs.rows) == 0 { rrs.rows = getRawRowsMaxSize().rows } - maxRowsCount := getMaxRawRowsPerPartition() + maxRowsCount := cap(rrs.rows) for { capacity := maxRowsCount - len(rrs.rows) if capacity >= len(rows) {