From 46ddf535f8ebbea9c97ec56c16bec6146e701389 Mon Sep 17 00:00:00 2001 From: Chunzhu Li Date: Wed, 23 Nov 2022 17:25:40 +0800 Subject: [PATCH] address comments --- br/pkg/lightning/mydump/region.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/br/pkg/lightning/mydump/region.go b/br/pkg/lightning/mydump/region.go index d5d5b06f9ded4..796a09a38a3f3 100644 --- a/br/pkg/lightning/mydump/region.go +++ b/br/pkg/lightning/mydump/region.go @@ -35,6 +35,7 @@ const ( // the increment ratio of large CSV file size threshold by `region-split-size` largeCSVLowerThresholdRation = 10 // TableFileSizeINF for compressed size, for lightning 10TB is a relatively big value and will strongly affect efficiency + // It's used to make sure compressed files can be read until EOF. Because we can't get the exact decompressed size of the compressed files. TableFileSizeINF = 10 * 1024 * tableRegionSizeWarningThreshold ) @@ -300,7 +301,7 @@ func MakeSourceFileRegion( // set fileSize to INF to make sure compressed files can be read until EOF. Because we can't get the exact size of the compressed files. // TODO: update progress bar calculation for compressed files. if fi.FileMeta.Compression != CompressionNone { - rowIDMax = fileSize * 100 / divisor + rowIDMax = fileSize * 100 / divisor // FIXME: this is not accurate. Need more tests and fix solution. fileSize = TableFileSizeINF } tableRegion := &TableRegion{