Skip to content

Commit 29116c0

Browse files
authored
storage: replace standard gzip with klauspost/compress to increase effiency (pingcap#43129) (pingcap#43186) (pingcap#43203)
close pingcap#43128
1 parent c741cfc commit 29116c0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

br/pkg/storage/BUILD.bazel

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ go_library(
3838
"@com_github_azure_azure_sdk_for_go_sdk_azcore//policy",
3939
"@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
4040
"@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob",
41-
"@com_github_golang_snappy//:snappy",
4241
"@com_github_google_uuid//:uuid",
42+
"@com_github_klauspost_compress//gzip",
43+
"@com_github_klauspost_compress//snappy",
4344
"@com_github_klauspost_compress//zstd",
4445
"@com_github_pingcap_errors//:errors",
4546
"@com_github_pingcap_kvproto//pkg/brpb",

br/pkg/storage/writer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package storage
22

33
import (
44
"bytes"
5-
"compress/gzip"
65
"context"
76
"io"
87

9-
"github.com/golang/snappy"
8+
"github.com/klauspost/compress/gzip"
9+
"github.com/klauspost/compress/snappy"
1010
"github.com/klauspost/compress/zstd"
1111
"github.com/pingcap/errors"
1212
"github.com/pingcap/log"

table/column.go

+4
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ func CastValue(ctx sessionctx.Context, val types.Datum, col *model.ColumnInfo, r
300300
if returnErr && err != nil {
301301
return casted, err
302302
}
303+
if err != nil {
304+
logutil.BgLogger().Debug("[debug] ConvertTo FieldType failed", zap.Stringer("FieldType", &col.FieldType),
305+
zap.Stringer("Datum", val), zap.Error(err))
306+
}
303307
if err != nil && types.ErrTruncated.Equal(err) && col.GetType() != mysql.TypeSet && col.GetType() != mysql.TypeEnum {
304308
str, err1 := val.ToString()
305309
if err1 != nil {

0 commit comments

Comments
 (0)