Skip to content

Commit de30719

Browse files
committed
Merge branch 'master' of github.com:pingcap/tidb into fix59055
2 parents bef13bf + 444c38f commit de30719

File tree

574 files changed

+20917
-18747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

574 files changed

+20917
-18747
lines changed

DEPS.bzl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,13 +2855,13 @@ def go_deps():
28552855
name = "com_github_golang_glog",
28562856
build_file_proto_mode = "disable_global",
28572857
importpath = "github.com/golang/glog",
2858-
sha256 = "07688d418628ff30ffd40fde44956d1fb6bae4436003d7fcca40c85236b9484a",
2859-
strip_prefix = "github.com/golang/[email protected].0",
2858+
sha256 = "6636c4a48a010844df02886621c32706af2f5e707ad23acb52fe22510b60c822",
2859+
strip_prefix = "github.com/golang/[email protected].4",
28602860
urls = [
2861-
"http://bazel-cache.pingcap.net:8080/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.0.zip",
2862-
"http://ats.apps.svc/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.0.zip",
2863-
"https://cache.hawkingrei.com/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.0.zip",
2864-
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.0.zip",
2861+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.4.zip",
2862+
"http://ats.apps.svc/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.4.zip",
2863+
"https://cache.hawkingrei.com/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.4.zip",
2864+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/golang/glog/com_github_golang_glog-v1.2.4.zip",
28652865
],
28662866
)
28672867
go_repository(
@@ -7050,13 +7050,13 @@ def go_deps():
70507050
name = "com_github_tikv_client_go_v2",
70517051
build_file_proto_mode = "disable_global",
70527052
importpath = "github.com/tikv/client-go/v2",
7053-
sha256 = "e59695d9b1dd460126e9c7dbc60ab44224e56d6a9c6fea04c88127fb0b82694c",
7054-
strip_prefix = "github.com/tikv/client-go/[email protected].20250117034919-61e09c6539bd",
7053+
sha256 = "f7393d26207f6117eb784e6eace4e6aa3a10a08cbcaa65c851b8c15bd6635bb7",
7054+
strip_prefix = "github.com/tikv/client-go/[email protected].20250124091023-d0d0c9712f43",
70557055
urls = [
7056-
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250117034919-61e09c6539bd.zip",
7057-
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250117034919-61e09c6539bd.zip",
7058-
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250117034919-61e09c6539bd.zip",
7059-
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250117034919-61e09c6539bd.zip",
7056+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250124091023-d0d0c9712f43.zip",
7057+
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250124091023-d0d0c9712f43.zip",
7058+
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250124091023-d0d0c9712f43.zip",
7059+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20250124091023-d0d0c9712f43.zip",
70607060
],
70617061
)
70627062
go_repository(
@@ -10248,13 +10248,13 @@ def go_deps():
1024810248
name = "org_golang_x_oauth2",
1024910249
build_file_proto_mode = "disable_global",
1025010250
importpath = "golang.org/x/oauth2",
10251-
sha256 = "fd0fa73afb9f7a1099bea44c12dc2b8078326f16d3b34ebebc174efdf035bce3",
10252-
strip_prefix = "golang.org/x/oauth2@v0.24.0",
10251+
sha256 = "09cda3779f2cab3558ad0da94f4c4ccfb56fe52a6f6cb54ac2edea94edf819c7",
10252+
strip_prefix = "golang.org/x/oauth2@v0.25.0",
1025310253
urls = [
10254-
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.24.0.zip",
10255-
"http://ats.apps.svc/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.24.0.zip",
10256-
"https://cache.hawkingrei.com/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.24.0.zip",
10257-
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.24.0.zip",
10254+
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.25.0.zip",
10255+
"http://ats.apps.svc/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.25.0.zip",
10256+
"https://cache.hawkingrei.com/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.25.0.zip",
10257+
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/oauth2/org_golang_x_oauth2-v0.25.0.zip",
1025810258
],
1025910259
)
1026010260
go_repository(
@@ -10339,13 +10339,13 @@ def go_deps():
1033910339
name = "org_golang_x_time",
1034010340
build_file_proto_mode = "disable_global",
1034110341
importpath = "golang.org/x/time",
10342-
sha256 = "ce9157f4961055bd942bbb02666ca5be9f92c92f8e64361aede9d1090df44464",
10343-
strip_prefix = "golang.org/x/time@v0.7.0",
10342+
sha256 = "e8a6b77acb93415e3819654d11f072c15eb1e72ba2bd37b6c732f05a359ff794",
10343+
strip_prefix = "golang.org/x/time@v0.9.0",
1034410344
urls = [
10345-
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/time/org_golang_x_time-v0.7.0.zip",
10346-
"http://ats.apps.svc/gomod/golang.org/x/time/org_golang_x_time-v0.7.0.zip",
10347-
"https://cache.hawkingrei.com/gomod/golang.org/x/time/org_golang_x_time-v0.7.0.zip",
10348-
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/time/org_golang_x_time-v0.7.0.zip",
10345+
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/time/org_golang_x_time-v0.9.0.zip",
10346+
"http://ats.apps.svc/gomod/golang.org/x/time/org_golang_x_time-v0.9.0.zip",
10347+
"https://cache.hawkingrei.com/gomod/golang.org/x/time/org_golang_x_time-v0.9.0.zip",
10348+
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/time/org_golang_x_time-v0.9.0.zip",
1034910349
],
1035010350
)
1035110351
go_repository(

OWNERS_ALIASES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,5 @@ aliases:
119119
- qw4990
120120
- time-and-fate
121121
- winoros
122+
- terry1purcell
123+
- ghazalfamilyusa

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ go_download_sdk(
8585
"https://mirrors.aliyun.com/golang/{}",
8686
"https://dl.google.com/go/{}",
8787
],
88-
version = "1.23.5",
88+
version = "1.23.6",
8989
)
9090

9191
go_register_toolchains(

br/cmd/br/operator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ func newListMigrationsCommand() *cobra.Command {
9696

9797
func newMigrateToCommand() *cobra.Command {
9898
cmd := &cobra.Command{
99-
Use: "migrate-to",
100-
Short: "migrate to a specific version",
101-
Args: cobra.NoArgs,
99+
Use: "unsafe-migrate-to",
100+
Short: "migrate to a specific version, use truncate will auto migrate to correct version, " +
101+
"you should never use this command unless you know what you are doing",
102+
Args: cobra.NoArgs,
102103
RunE: func(cmd *cobra.Command, args []string) error {
103104
cfg := operator.MigrateToConfig{}
104105
if err := cfg.ParseFromFlags(cmd.Flags()); err != nil {
@@ -109,6 +110,7 @@ func newMigrateToCommand() *cobra.Command {
109110
},
110111
}
111112
operator.DefineFlagsForMigrateToConfig(cmd.Flags())
113+
cmd.Hidden = true
112114
return cmd
113115
}
114116

br/pkg/backup/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ go_test(
7979
"//br/pkg/storage",
8080
"//br/pkg/utils",
8181
"//pkg/meta/model",
82-
"//pkg/sessionctx/variable",
82+
"//pkg/sessionctx/vardef",
8383
"//pkg/testkit",
8484
"//pkg/testkit/testsetup",
8585
"//pkg/util/table-filter",

br/pkg/backup/schema_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/pingcap/tidb/br/pkg/mock"
1919
"github.com/pingcap/tidb/br/pkg/storage"
2020
"github.com/pingcap/tidb/br/pkg/utils"
21-
"github.com/pingcap/tidb/pkg/sessionctx/variable"
21+
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
2222
"github.com/pingcap/tidb/pkg/testkit"
2323
filter "github.com/pingcap/tidb/pkg/util/table-filter"
2424
"github.com/stretchr/testify/require"
@@ -151,7 +151,7 @@ func TestBuildBackupRangeAndSchema(t *testing.T) {
151151
metaWriter := metautil.NewMetaWriter(es, metautil.MetaFileSize, false, "", &cipher)
152152
ctx := context.Background()
153153
err = backupSchemas.BackupSchemas(
154-
ctx, metaWriter, nil, m.Storage, nil, math.MaxUint64, 1, variable.DefChecksumTableConcurrency, skipChecksum, updateCh)
154+
ctx, metaWriter, nil, m.Storage, nil, math.MaxUint64, 1, vardef.DefChecksumTableConcurrency, skipChecksum, updateCh)
155155
require.Equal(t, int64(1), updateCh.get())
156156
require.NoError(t, err)
157157
err = metaWriter.FlushBackupMeta(ctx)
@@ -180,7 +180,7 @@ func TestBuildBackupRangeAndSchema(t *testing.T) {
180180
es2 := GetRandomStorage(t)
181181
metaWriter2 := metautil.NewMetaWriter(es2, metautil.MetaFileSize, false, "", &cipher)
182182
err = backupSchemas.BackupSchemas(
183-
ctx, metaWriter2, nil, m.Storage, nil, math.MaxUint64, 2, variable.DefChecksumTableConcurrency, skipChecksum, updateCh)
183+
ctx, metaWriter2, nil, m.Storage, nil, math.MaxUint64, 2, vardef.DefChecksumTableConcurrency, skipChecksum, updateCh)
184184
require.Equal(t, int64(2), updateCh.get())
185185
require.NoError(t, err)
186186
err = metaWriter2.FlushBackupMeta(ctx)
@@ -234,7 +234,7 @@ func TestBuildBackupRangeAndSchemaWithBrokenStats(t *testing.T) {
234234
metaWriter := metautil.NewMetaWriter(es, metautil.MetaFileSize, false, "", &cipher)
235235
ctx := context.Background()
236236
err = backupSchemas.BackupSchemas(
237-
ctx, metaWriter, nil, m.Storage, nil, math.MaxUint64, 1, variable.DefChecksumTableConcurrency, skipChecksum, updateCh)
237+
ctx, metaWriter, nil, m.Storage, nil, math.MaxUint64, 1, vardef.DefChecksumTableConcurrency, skipChecksum, updateCh)
238238
require.NoError(t, err)
239239
err = metaWriter.FlushBackupMeta(ctx)
240240
require.NoError(t, err)
@@ -262,7 +262,7 @@ func TestBuildBackupRangeAndSchemaWithBrokenStats(t *testing.T) {
262262
es2 := GetRandomStorage(t)
263263
metaWriter2 := metautil.NewMetaWriter(es2, metautil.MetaFileSize, false, "", &cipher)
264264
err = backupSchemas.BackupSchemas(
265-
ctx, metaWriter2, nil, m.Storage, statsHandle, math.MaxUint64, 1, variable.DefChecksumTableConcurrency, skipChecksum, updateCh)
265+
ctx, metaWriter2, nil, m.Storage, statsHandle, math.MaxUint64, 1, vardef.DefChecksumTableConcurrency, skipChecksum, updateCh)
266266
require.NoError(t, err)
267267
err = metaWriter2.FlushBackupMeta(ctx)
268268
require.NoError(t, err)
@@ -306,7 +306,7 @@ func TestBackupSchemasForSystemTable(t *testing.T) {
306306

307307
metaWriter2 := metautil.NewMetaWriter(es2, metautil.MetaFileSize, false, "", &cipher)
308308
err = backupSchemas.BackupSchemas(ctx, metaWriter2, nil, m.Storage, nil,
309-
math.MaxUint64, 1, variable.DefChecksumTableConcurrency, true, updateCh)
309+
math.MaxUint64, 1, vardef.DefChecksumTableConcurrency, true, updateCh)
310310
require.NoError(t, err)
311311
err = metaWriter2.FlushBackupMeta(ctx)
312312
require.NoError(t, err)

br/pkg/checksum/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ go_library(
1717
"//pkg/distsql",
1818
"//pkg/kv",
1919
"//pkg/meta/model",
20-
"//pkg/sessionctx/variable",
20+
"//pkg/sessionctx/vardef",
2121
"//pkg/tablecodec",
2222
"//pkg/util/ranger",
2323
"@com_github_gogo_protobuf//proto",
@@ -46,7 +46,7 @@ go_test(
4646
"//pkg/kv",
4747
"//pkg/meta/model",
4848
"//pkg/parser/ast",
49-
"//pkg/sessionctx/variable",
49+
"//pkg/sessionctx/vardef",
5050
"//pkg/testkit",
5151
"//pkg/testkit/testsetup",
5252
"@com_github_pingcap_failpoint//:failpoint",

br/pkg/checksum/executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/pingcap/tidb/pkg/distsql"
1515
"github.com/pingcap/tidb/pkg/kv"
1616
"github.com/pingcap/tidb/pkg/meta/model"
17-
"github.com/pingcap/tidb/pkg/sessionctx/variable"
17+
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
1818
"github.com/pingcap/tidb/pkg/tablecodec"
1919
"github.com/pingcap/tidb/pkg/util/ranger"
2020
"github.com/pingcap/tipb/go-tipb"
@@ -44,7 +44,7 @@ func NewExecutorBuilder(table *model.TableInfo, ts uint64) *ExecutorBuilder {
4444
table: table,
4545
ts: ts,
4646

47-
concurrency: variable.DefDistSQLScanConcurrency,
47+
concurrency: vardef.DefDistSQLScanConcurrency,
4848
}
4949
}
5050

br/pkg/checksum/executor_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/pingcap/tidb/pkg/kv"
1616
"github.com/pingcap/tidb/pkg/meta/model"
1717
"github.com/pingcap/tidb/pkg/parser/ast"
18-
"github.com/pingcap/tidb/pkg/sessionctx/variable"
18+
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
1919
"github.com/pingcap/tidb/pkg/testkit"
2020
"github.com/stretchr/testify/require"
2121
)
@@ -44,7 +44,7 @@ func TestChecksumContextDone(t *testing.T) {
4444
tk.MustExec("insert into t1 values (10, 10);")
4545
tableInfo1 := getTableInfo(t, mock, "test", "t1")
4646
exe, err := checksum.NewExecutorBuilder(tableInfo1, math.MaxUint64).
47-
SetConcurrency(variable.DefChecksumTableConcurrency).
47+
SetConcurrency(vardef.DefChecksumTableConcurrency).
4848
Build()
4949
require.NoError(t, err)
5050

@@ -73,12 +73,12 @@ func TestChecksum(t *testing.T) {
7373
tk.MustExec("insert into t1 values (10);")
7474
tableInfo1 := getTableInfo(t, mock, "test", "t1")
7575
exe1, err := checksum.NewExecutorBuilder(tableInfo1, math.MaxUint64).
76-
SetConcurrency(variable.DefChecksumTableConcurrency).
76+
SetConcurrency(vardef.DefChecksumTableConcurrency).
7777
Build()
7878
require.NoError(t, err)
7979
require.NoError(t, exe1.Each(func(r *kv.Request) error {
8080
require.True(t, r.NotFillCache)
81-
require.Equal(t, variable.DefChecksumTableConcurrency, r.Concurrency)
81+
require.Equal(t, vardef.DefChecksumTableConcurrency, r.Concurrency)
8282
return nil
8383
}))
8484
require.Equal(t, 1, exe1.Len())

br/pkg/restore/log_client/client.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (rc *LogClient) Close(ctx context.Context) {
270270
log.Info("Restore client closed")
271271
}
272272

273-
func rewriteRulesFor(sst SSTs, rules *restoreutils.RewriteRules) (*restoreutils.RewriteRules, error) {
273+
func (rc *LogClient) rewriteRulesFor(sst SSTs, rules *restoreutils.RewriteRules) (*restoreutils.RewriteRules, error) {
274274
if r, ok := sst.(RewrittenSSTs); ok {
275275
rewritten := r.RewrittenTo()
276276
if rewritten != sst.TableID() {
@@ -287,6 +287,10 @@ func rewriteRulesFor(sst SSTs, rules *restoreutils.RewriteRules) (*restoreutils.
287287
return rewriteRules, nil
288288
}
289289
}
290+
// Need to set ts range for compacted sst to filter out irrelevant data.
291+
if sst.Type() == CompactedSSTsType && !rules.HasSetTs() {
292+
rules.SetTsRange(rc.shiftStartTS, rc.startTS, rc.restoreTS)
293+
}
290294
return rules, nil
291295
}
292296

@@ -318,7 +322,7 @@ func (rc *LogClient) RestoreSSTFiles(
318322
log.Warn("[Compacted SST Restore] Skipping excluded table during restore.", zap.Int64("table_id", i.TableID()))
319323
continue
320324
}
321-
newRules, err := rewriteRulesFor(i, rewriteRules)
325+
newRules, err := rc.rewriteRulesFor(i, rewriteRules)
322326
if err != nil {
323327
return err
324328
}

0 commit comments

Comments
 (0)