Skip to content

Commit

Permalink
storage: replace standard gzip with klauspost/compress to increase ef…
Browse files Browse the repository at this point in the history
…fiency (#43129) (#43186) (#43203)

close #43128
  • Loading branch information
ti-chi-bot authored Apr 19, 2023
1 parent c741cfc commit 29116c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion br/pkg/storage/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ go_library(
"@com_github_azure_azure_sdk_for_go_sdk_azcore//policy",
"@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
"@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob",
"@com_github_golang_snappy//:snappy",
"@com_github_google_uuid//:uuid",
"@com_github_klauspost_compress//gzip",
"@com_github_klauspost_compress//snappy",
"@com_github_klauspost_compress//zstd",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand Down
4 changes: 2 additions & 2 deletions br/pkg/storage/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package storage

import (
"bytes"
"compress/gzip"
"context"
"io"

"github.com/golang/snappy"
"github.com/klauspost/compress/gzip"
"github.com/klauspost/compress/snappy"
"github.com/klauspost/compress/zstd"
"github.com/pingcap/errors"
"github.com/pingcap/log"
Expand Down
4 changes: 4 additions & 0 deletions table/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ func CastValue(ctx sessionctx.Context, val types.Datum, col *model.ColumnInfo, r
if returnErr && err != nil {
return casted, err
}
if err != nil {
logutil.BgLogger().Debug("[debug] ConvertTo FieldType failed", zap.Stringer("FieldType", &col.FieldType),
zap.Stringer("Datum", val), zap.Error(err))
}
if err != nil && types.ErrTruncated.Equal(err) && col.GetType() != mysql.TypeSet && col.GetType() != mysql.TypeEnum {
str, err1 := val.ToString()
if err1 != nil {
Expand Down

0 comments on commit 29116c0

Please sign in to comment.