From 06ac7b17ef3aaaff6d3632bac0db1c14fcee2ef8 Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Mon, 18 Nov 2024 21:30:29 +0800 Subject: [PATCH] lightning: log error cause when SampleFileCompressRatio fail (#57455) --- pkg/lightning/mydump/loader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/lightning/mydump/loader.go b/pkg/lightning/mydump/loader.go index af747045a93d4..ff6ed08d7e74f 100644 --- a/pkg/lightning/mydump/loader.go +++ b/pkg/lightning/mydump/loader.go @@ -530,7 +530,8 @@ func (s *mdLoaderSetup) constructFileInfo(ctx context.Context, path string, size compressRatio, err2 := SampleFileCompressRatio(ctx, info.FileMeta, s.loader.GetStore()) if err2 != nil { logger.Error("fail to calculate data file compress ratio", zap.String("category", "loader"), - zap.String("schema", res.Schema), zap.String("table", res.Name), zap.Stringer("type", res.Type)) + zap.String("schema", res.Schema), zap.String("table", res.Name), + zap.Stringer("type", res.Type), zap.Error(err2)) } else { info.FileMeta.RealSize = int64(compressRatio * float64(info.FileMeta.FileSize)) }