Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Nov 14, 2024
1 parent 2b60522 commit f9d3d92
Show file tree
Hide file tree
Showing 54 changed files with 398 additions and 289 deletions.
123 changes: 79 additions & 44 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,30 @@ def go_deps():
name = "com_github_azure_azure_sdk_for_go_sdk_azcore",
build_file_proto_mode = "disable_global",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/azcore",
sum = "h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA=",
version = "v0.20.0",
sum = "h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M=",
version = "v1.16.0",
)
go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_azidentity",
build_file_proto_mode = "disable_global",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/azidentity",
sum = "h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI=",
version = "v0.12.0",
sum = "h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g=",
version = "v1.8.0",
)
go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_azidentity_cache",
build_file_proto_mode = "disable",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache",
sum = "h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw=",
version = "v0.3.0",
)

go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_internal",
build_file_proto_mode = "disable_global",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/internal",
sum = "h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc=",
version = "v0.8.1",
sum = "h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=",
version = "v1.10.0",
)
go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_resourcemanager_compute_armcompute_v5",
Expand Down Expand Up @@ -451,12 +459,20 @@ def go_deps():
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4/com_github_azure_azure_sdk_for_go_sdk_resourcemanager_network_armnetwork_v4-v4.3.0.zip",
],
)
go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_resourcemanager_storage_armstorage",
build_file_proto_mode = "disable",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage",
sum = "h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c=",
version = "v1.6.0",
)

go_repository(
name = "com_github_azure_azure_sdk_for_go_sdk_storage_azblob",
build_file_proto_mode = "disable_global",
importpath = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob",
sum = "h1:62Ew5xXg5UCGIXDOM7+y4IL5/6mQJq1nenhBCJAeGX8=",
version = "v0.2.0",
sum = "h1:mlmW46Q0B79I+Aj4azKC6xDMFN9a9SyZWESlGWYXbFs=",
version = "v1.5.0",
)
go_repository(
name = "com_github_azure_go_autorest",
Expand All @@ -479,18 +495,20 @@ def go_deps():
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/Azure/go-ntlmssp/com_github_azure_go_ntlmssp-v0.0.0-20221128193559-754e69321358.zip",
],
)
go_repository(
name = "com_github_azuread_microsoft_authentication_extensions_for_go_cache",
build_file_proto_mode = "disable",
importpath = "github.com/AzureAD/microsoft-authentication-extensions-for-go/cache",
sum = "h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=",
version = "v0.1.1",
)

go_repository(
name = "com_github_azuread_microsoft_authentication_library_for_go",
build_file_proto_mode = "disable_global",
importpath = "github.com/AzureAD/microsoft-authentication-library-for-go",
sha256 = "895ac3948492180ed21eabe651bebe45c9d99b92c2738206759d6faf4f430d26",
strip_prefix = "github.com/AzureAD/[email protected]",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/AzureAD/microsoft-authentication-library-for-go/com_github_azuread_microsoft_authentication_library_for_go-v1.2.2.zip",
"http://ats.apps.svc/gomod/github.com/AzureAD/microsoft-authentication-library-for-go/com_github_azuread_microsoft_authentication_library_for_go-v1.2.2.zip",
"https://cache.hawkingrei.com/gomod/github.com/AzureAD/microsoft-authentication-library-for-go/com_github_azuread_microsoft_authentication_library_for_go-v1.2.2.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/AzureAD/microsoft-authentication-library-for-go/com_github_azuread_microsoft_authentication_library_for_go-v1.2.2.zip",
],
sum = "h1:gUDtaZk8heteyfdmv+pcfHvhR9llnh7c7GMwZ8RVG04=",
version = "v1.3.1",
)
go_repository(
name = "com_github_bazelbuild_buildtools",
Expand Down Expand Up @@ -1299,6 +1317,14 @@ def go_deps():
sum = "h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=",
version = "v0.0.0-20200201041132-a6ae2369ad13",
)
go_repository(
name = "com_github_dgryski_go_rendezvous",
build_file_proto_mode = "disable",
importpath = "github.com/dgryski/go-rendezvous",
sum = "h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=",
version = "v0.0.0-20200823014737-9f7001d12a5f",
)

go_repository(
name = "com_github_dgryski_go_sip13",
build_file_proto_mode = "disable",
Expand Down Expand Up @@ -2412,14 +2438,8 @@ def go_deps():
name = "com_github_golang_jwt_jwt_v5",
build_file_proto_mode = "disable_global",
importpath = "github.com/golang-jwt/jwt/v5",
sha256 = "ad5cdc5c6bac562a2b890e96347208ffdb30a940243b558465ab7de90913a180",
strip_prefix = "github.com/golang-jwt/jwt/[email protected]",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/golang-jwt/jwt/v5/com_github_golang_jwt_jwt_v5-v5.2.1.zip",
"http://ats.apps.svc/gomod/github.com/golang-jwt/jwt/v5/com_github_golang_jwt_jwt_v5-v5.2.1.zip",
"https://cache.hawkingrei.com/gomod/github.com/golang-jwt/jwt/v5/com_github_golang_jwt_jwt_v5-v5.2.1.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/golang-jwt/jwt/v5/com_github_golang_jwt_jwt_v5-v5.2.1.zip",
],
sum = "h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=",
version = "v5.2.1",
)
go_repository(
name = "com_github_golang_mock",
Expand Down Expand Up @@ -2723,8 +2743,8 @@ def go_deps():
name = "com_github_google_uuid",
build_file_proto_mode = "disable_global",
importpath = "github.com/google/uuid",
sum = "h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=",
version = "v1.3.1",
sum = "h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=",
version = "v1.6.0",
)
go_repository(
name = "com_github_googleapis_enterprise_certificate_proxy",
Expand Down Expand Up @@ -3748,6 +3768,14 @@ def go_deps():
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/kballard/go-shellquote/com_github_kballard_go_shellquote-v0.0.0-20180428030007-95032a82bc51.zip",
],
)
go_repository(
name = "com_github_keybase_go_keychain",
build_file_proto_mode = "disable",
importpath = "github.com/keybase/go-keychain",
sum = "h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs=",
version = "v0.0.0-20231219164618-57a3676c3af6",
)

go_repository(
name = "com_github_kimmachinegun_automemlimit",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -4458,8 +4486,8 @@ def go_deps():
name = "com_github_montanaflynn_stats",
build_file_proto_mode = "disable_global",
importpath = "github.com/montanaflynn/stats",
sum = "h1:pmpDGKLw4n82EtrNiLqB+xSz/JQwFOaZuMALYUHwX5s=",
version = "v0.0.0-20180911141734-db72e6cae808",
sum = "h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=",
version = "v0.7.0",
)
go_repository(
name = "com_github_moricho_tparallel",
Expand Down Expand Up @@ -4990,8 +5018,8 @@ def go_deps():
name = "com_github_pkg_browser",
build_file_proto_mode = "disable_global",
importpath = "github.com/pkg/browser",
sum = "h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=",
version = "v0.0.0-20180916011732-0a3d74bf9ce4",
sum = "h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=",
version = "v0.0.0-20240102092130-5ac0b6a4141c",
)
go_repository(
name = "com_github_pkg_diff",
Expand Down Expand Up @@ -5253,6 +5281,13 @@ def go_deps():
sum = "h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=",
version = "v0.0.0-20201227073835-cf1acfcdf475",
)
go_repository(
name = "com_github_redis_go_redis_v9",
build_file_proto_mode = "disable",
importpath = "github.com/redis/go-redis/v9",
sum = "h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4=",
version = "v9.6.1",
)

go_repository(
name = "com_github_remyoudompheng_bigfft",
Expand Down Expand Up @@ -5300,8 +5335,8 @@ def go_deps():
name = "com_github_rogpeppe_go_internal",
build_file_proto_mode = "disable_global",
importpath = "github.com/rogpeppe/go-internal",
sum = "h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=",
version = "v1.10.0",
sum = "h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=",
version = "v1.12.0",
)
go_repository(
name = "com_github_rubyist_circuitbreaker",
Expand Down Expand Up @@ -7863,8 +7898,8 @@ def go_deps():
name = "org_golang_x_crypto",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/crypto",
sum = "h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=",
version = "v0.26.0",
sum = "h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=",
version = "v0.29.0",
)
go_repository(
name = "org_golang_x_exp",
Expand Down Expand Up @@ -7912,8 +7947,8 @@ def go_deps():
name = "org_golang_x_net",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/net",
sum = "h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=",
version = "v0.28.0",
sum = "h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=",
version = "v0.31.0",
)
go_repository(
name = "org_golang_x_oauth2",
Expand All @@ -7939,15 +7974,15 @@ def go_deps():
name = "org_golang_x_sync",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sync",
sum = "h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=",
version = "v0.8.0",
sum = "h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=",
version = "v0.9.0",
)
go_repository(
name = "org_golang_x_sys",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sys",
sum = "h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=",
version = "v0.23.0",
sum = "h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=",
version = "v0.27.0",
)
go_repository(
name = "org_golang_x_telemetry",
Expand All @@ -7960,15 +7995,15 @@ def go_deps():
name = "org_golang_x_term",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/term",
sum = "h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=",
version = "v0.23.0",
sum = "h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=",
version = "v0.26.0",
)
go_repository(
name = "org_golang_x_text",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/text",
sum = "h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=",
version = "v0.17.0",
sum = "h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=",
version = "v0.20.0",
)
go_repository(
name = "org_golang_x_time",
Expand Down
9 changes: 5 additions & 4 deletions br/pkg/lightning/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package backend

import (
"cmp"
"context"
"fmt"
"time"
Expand Down Expand Up @@ -303,11 +304,11 @@ func (be Backend) CheckDiskQuota(quota int64) (
totalMemSize int64,
) {
sizes := be.abstract.EngineFileSizes()
slices.SortFunc(sizes, func(i, j EngineFileSize) bool {
if i.IsImporting != j.IsImporting {
return i.IsImporting
slices.SortFunc(sizes, func(i, j EngineFileSize) int {
if i.IsImporting != j.IsImporting && i.IsImporting {
return -1
}
return i.DiskSize+i.MemSize < j.DiskSize+j.MemSize
return cmp.Compare(i.DiskSize+i.MemSize, j.DiskSize+j.MemSize)
})
for _, size := range sizes {
totalDiskSize += size.DiskSize
Expand Down
5 changes: 3 additions & 2 deletions br/pkg/lightning/backend/kv/sql2kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package kv

import (
"cmp"
"context"
"fmt"
"math"
Expand Down Expand Up @@ -186,8 +187,8 @@ func collectGeneratedColumns(se *session, meta *model.TableInfo, cols []*table.C
}

// order the result by column offset so they match the evaluation order.
slices.SortFunc(genCols, func(i, j genCol) bool {
return cols[i.index].Offset < cols[j.index].Offset
slices.SortFunc(genCols, func(i, j genCol) int {
return cmp.Compare(cols[i.index].Offset, cols[j.index].Offset)
})
return genCols, nil
}
Expand Down
12 changes: 6 additions & 6 deletions br/pkg/lightning/backend/local/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,8 @@ func (e *Engine) batchIngestSSTs(metas []*sstMeta) error {
if len(metas) == 0 {
return nil
}
slices.SortFunc(metas, func(i, j *sstMeta) bool {
return bytes.Compare(i.minKey, j.minKey) < 0
slices.SortFunc(metas, func(i, j *sstMeta) int {
return bytes.Compare(i.minKey, j.minKey)
})

metaLevels := make([][]*sstMeta, 0)
Expand Down Expand Up @@ -914,8 +914,8 @@ func sortAndMergeRanges(ranges []Range) []Range {
return ranges
}

slices.SortFunc(ranges, func(i, j Range) bool {
return bytes.Compare(i.start, j.start) < 0
slices.SortFunc(ranges, func(i, j Range) int {
return bytes.Compare(i.start, j.start)
})

curEnd := ranges[0].end
Expand Down Expand Up @@ -1181,8 +1181,8 @@ func (w *Writer) flushKVs(ctx context.Context) error {
return errors.Trace(err)
}
if !w.isWriteBatchSorted {
slices.SortFunc(w.writeBatch[:w.batchCount], func(i, j common.KvPair) bool {
return bytes.Compare(i.Key, j.Key) < 0
slices.SortFunc(w.writeBatch[:w.batchCount], func(i, j common.KvPair) int {
return bytes.Compare(i.Key, j.Key)
})
w.isWriteBatchSorted = true
}
Expand Down
12 changes: 6 additions & 6 deletions br/pkg/lightning/backend/local/localhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ func (local *local) SplitAndScatterRegionByRanges(
var err1 error
region := sp.region
keys := sp.keys
slices.SortFunc(keys, func(i, j []byte) bool {
return bytes.Compare(i, j) < 0
slices.SortFunc(keys, func(i, j []byte) int {
return bytes.Compare(i, j)
})
splitRegion := region
startIdx := 0
Expand Down Expand Up @@ -247,8 +247,8 @@ func (local *local) SplitAndScatterRegionByRanges(
log.FromContext(ctx).Info("batch split region", zap.Uint64("region_id", splitRegion.Region.Id),
zap.Int("keys", endIdx-startIdx), zap.Binary("firstKey", keys[startIdx]),
zap.Binary("end", keys[endIdx-1]))
slices.SortFunc(newRegions, func(i, j *split.RegionInfo) bool {
return bytes.Compare(i.Region.StartKey, j.Region.StartKey) < 0
slices.SortFunc(newRegions, func(i, j *split.RegionInfo) int {
return bytes.Compare(i.Region.StartKey, j.Region.StartKey)
})
syncLock.Lock()
scatterRegions = append(scatterRegions, newRegions...)
Expand Down Expand Up @@ -293,8 +293,8 @@ func (local *local) SplitAndScatterRegionByRanges(
if len(retryKeys) == 0 {
break
}
slices.SortFunc(retryKeys, func(i, j []byte) bool {
return bytes.Compare(i, j) < 0
slices.SortFunc(retryKeys, func(i, j []byte) int {
return bytes.Compare(i, j)
})
minKey = codec.EncodeBytes([]byte{}, retryKeys[0])
maxKey = codec.EncodeBytes([]byte{}, nextKey(retryKeys[len(retryKeys)-1]))
Expand Down
12 changes: 10 additions & 2 deletions br/pkg/lightning/checkpoints/checkpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package checkpoints

import (
"cmp"
"context"
"database/sql"
"encoding/json"
Expand Down Expand Up @@ -229,6 +230,13 @@ func (key *ChunkCheckpointKey) String() string {
return fmt.Sprintf("%s:%d", key.Path, key.Offset)
}

func (key *ChunkCheckpointKey) compare(other *ChunkCheckpointKey) int {
if c := cmp.Compare(key.Path, other.Path); c != 0 {
return c
}
return cmp.Compare(key.Offset, other.Offset)
}

func (key *ChunkCheckpointKey) less(other *ChunkCheckpointKey) bool {
switch {
case key.Path < other.Path:
Expand Down Expand Up @@ -1257,8 +1265,8 @@ func (cpdb *FileCheckpointsDB) Get(_ context.Context, tableName string) (*TableC
})
}

slices.SortFunc(engine.Chunks, func(i, j *ChunkCheckpoint) bool {
return i.Key.less(&j.Key)
slices.SortFunc(engine.Chunks, func(i, j *ChunkCheckpoint) int {
return i.Key.compare(&j.Key)
})

cp.Engines[engineID] = engine
Expand Down
Loading

0 comments on commit f9d3d92

Please sign in to comment.