From 65644730302f21edbedf7afc95da105eed426608 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Tue, 7 Feb 2023 21:18:26 +0800 Subject: [PATCH 01/18] forbid tiflash while enabling API v2 Signed-off-by: iosmanthus --- ddl/ddl_api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddl/ddl_api.go b/ddl/ddl_api.go index cd002a5968251..8ad78ae4cf74a 100644 --- a/ddl/ddl_api.go +++ b/ddl/ddl_api.go @@ -31,6 +31,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" + "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/ddl/label" "github.com/pingcap/tidb/ddl/resourcegroup" @@ -5398,6 +5399,10 @@ func shouldModifyTiFlashReplica(tbReplicaInfo *model.TiFlashReplicaInfo, replica // AlterTableSetTiFlashReplica sets the TiFlash replicas info. func (d *ddl) AlterTableSetTiFlashReplica(ctx sessionctx.Context, ident ast.Ident, replicaInfo *ast.TiFlashReplicaSpec) error { + // TiDB 6.6 doesn't support tiflash multi-tenancy yet. + if d.ddlCtx.store.GetCodec().GetAPIVersion() == kvrpcpb.APIVersion_V2 && replicaInfo.Count > 0 { + return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) + } schema, tb, err := d.getSchemaAndTableByIdent(ctx, ident) if err != nil { return errors.Trace(err) From a8f190812d0d3656f564cdb75f1f33648b099c95 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 00:36:22 +0800 Subject: [PATCH 02/18] forbid tiflash replica in br and tiflash_manager Signed-off-by: iosmanthus --- br/pkg/restore/client.go | 7 +++++++ ddl/BUILD.bazel | 1 + ddl/attributes_sql_test.go | 13 +++++++------ ddl/ddl_api.go | 5 ----- ddl/main_test.go | 3 ++- domain/BUILD.bazel | 1 + domain/db_test.go | 5 +++-- domain/domain.go | 9 ++++++++- domain/infosync/BUILD.bazel | 3 +++ domain/infosync/info.go | 20 ++++++++++++++++---- domain/infosync/info_test.go | 7 ++++--- domain/infosync/tiflash_manager.go | 9 +++++++++ server/BUILD.bazel | 1 + server/stat_test.go | 3 ++- 14 files changed, 64 insertions(+), 23 deletions(-) diff --git a/br/pkg/restore/client.go b/br/pkg/restore/client.go index 2d0ae75408ebb..701f46f6f91fa 100644 --- a/br/pkg/restore/client.go +++ b/br/pkg/restore/client.go @@ -20,6 +20,7 @@ import ( "github.com/pingcap/failpoint" backuppb "github.com/pingcap/kvproto/pkg/brpb" "github.com/pingcap/kvproto/pkg/import_sstpb" + "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/log" "github.com/pingcap/tidb/br/pkg/backup" @@ -1737,6 +1738,12 @@ func (rc *Client) PreCheckTableTiFlashReplica( recorder *tiflashrec.TiFlashRecorder, ) error { tiFlashStoreCount, err := rc.getTiFlashNodeCount(ctx) + // For TiDB 6.6, we do not support recover TiFlash replica while enabling API V2. + // TODO(iosmanthus): remove this after TiFlash support API V2. + if rc.GetDomain().Store().GetCodec().GetAPIVersion() == kvrpcpb.APIVersion_V2 { + log.Warn("TiFlash does not support API V2, reset replica count to 0") + tiFlashStoreCount = 0 + } if err != nil { return err } diff --git a/ddl/BUILD.bazel b/ddl/BUILD.bazel index 48dfa40426b6a..3df662361bccd 100644 --- a/ddl/BUILD.bazel +++ b/ddl/BUILD.bazel @@ -227,6 +227,7 @@ go_test( "//errno", "//executor", "//infoschema", + "//keyspace", "//kv", "//meta", "//meta/autoid", diff --git a/ddl/attributes_sql_test.go b/ddl/attributes_sql_test.go index 6950b44645ecf..9fe551d05d555 100644 --- a/ddl/attributes_sql_test.go +++ b/ddl/attributes_sql_test.go @@ -24,6 +24,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/ddl/util" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/store/gcworker" "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/util/gcutil" @@ -273,7 +274,7 @@ PARTITION BY RANGE (c) ( func TestFlashbackTable(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") @@ -331,7 +332,7 @@ PARTITION BY RANGE (c) ( func TestDropTable(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") @@ -384,7 +385,7 @@ PARTITION BY RANGE (c) ( func TestCreateWithSameName(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") @@ -448,7 +449,7 @@ PARTITION BY RANGE (c) ( func TestPartition(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") @@ -508,7 +509,7 @@ PARTITION BY RANGE (c) ( func TestDropSchema(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") @@ -534,7 +535,7 @@ PARTITION BY RANGE (c) ( func TestDefaultKeyword(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") diff --git a/ddl/ddl_api.go b/ddl/ddl_api.go index 8ad78ae4cf74a..cd002a5968251 100644 --- a/ddl/ddl_api.go +++ b/ddl/ddl_api.go @@ -31,7 +31,6 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/ddl/label" "github.com/pingcap/tidb/ddl/resourcegroup" @@ -5399,10 +5398,6 @@ func shouldModifyTiFlashReplica(tbReplicaInfo *model.TiFlashReplicaInfo, replica // AlterTableSetTiFlashReplica sets the TiFlash replicas info. func (d *ddl) AlterTableSetTiFlashReplica(ctx sessionctx.Context, ident ast.Ident, replicaInfo *ast.TiFlashReplicaSpec) error { - // TiDB 6.6 doesn't support tiflash multi-tenancy yet. - if d.ddlCtx.store.GetCodec().GetAPIVersion() == kvrpcpb.APIVersion_V2 && replicaInfo.Count > 0 { - return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) - } schema, tb, err := d.getSchemaAndTableByIdent(ctx, ident) if err != nil { return errors.Trace(err) diff --git a/ddl/main_test.go b/ddl/main_test.go index 6db3ace76e6a6..1984d07ab36e8 100644 --- a/ddl/main_test.go +++ b/ddl/main_test.go @@ -25,6 +25,7 @@ import ( "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/testkit/testsetup" "github.com/tikv/client-go/v2/tikv" @@ -54,7 +55,7 @@ func TestMain(m *testing.M) { conf.Experimental.AllowsExpressionIndex = true }) - _, err := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, true) + _, err := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, keyspace.CodecV1, true) if err != nil { _, _ = fmt.Fprintf(os.Stderr, "ddl: infosync.GlobalInfoSyncerInit: %v\n", err) os.Exit(1) diff --git a/domain/BUILD.bazel b/domain/BUILD.bazel index ccbf75dd48ee6..ccb70230b9829 100644 --- a/domain/BUILD.bazel +++ b/domain/BUILD.bazel @@ -113,6 +113,7 @@ go_test( "//ddl", "//domain/infosync", "//errno", + "//keyspace", "//kv", "//metrics", "//parser/ast", diff --git a/domain/db_test.go b/domain/db_test.go index 9b122664f8397..5587bfd7aa02e 100644 --- a/domain/db_test.go +++ b/domain/db_test.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/server" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" @@ -73,7 +74,7 @@ func TestNormalSessionPool(t *testing.T) { domain, err := session.BootstrapSession(store) require.NoError(t, err) defer domain.Close() - info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, true) + info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, keyspace.CodecV1, true) require.NoError(t, err1) conf := config.GetGlobalConfig() conf.Socket = "" @@ -107,7 +108,7 @@ func TestAbnormalSessionPool(t *testing.T) { domain, err := session.BootstrapSession(store) require.NoError(t, err) defer domain.Close() - info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, true) + info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, nil, keyspace.CodecV1, true) require.NoError(t, err1) conf := config.GetGlobalConfig() conf.Socket = "" diff --git a/domain/domain.go b/domain/domain.go index 67341449876d4..c20c9739dbb5a 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -1048,7 +1048,14 @@ func (do *Domain) Init( // step 1: prepare the info/schema syncer which domain reload needed. skipRegisterToDashboard := config.GetGlobalConfig().SkipRegisterToDashboard - do.info, err = infosync.GlobalInfoSyncerInit(ctx, do.ddl.GetID(), do.ServerID, do.etcdClient, do.unprefixedEtcdCli, skipRegisterToDashboard) + do.info, err = infosync.GlobalInfoSyncerInit( + ctx, + do.ddl.GetID(), + do.ServerID, + do.etcdClient, + do.unprefixedEtcdCli, + do.store.GetCodec(), + skipRegisterToDashboard) if err != nil { return err } diff --git a/domain/infosync/BUILD.bazel b/domain/infosync/BUILD.bazel index 0952dfc300490..f050873ee128f 100644 --- a/domain/infosync/BUILD.bazel +++ b/domain/infosync/BUILD.bazel @@ -41,10 +41,12 @@ go_library( "@com_github_gorilla_mux//:mux", "@com_github_pingcap_errors//:errors", "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", "@com_github_pingcap_kvproto//pkg/metapb", "@com_github_pingcap_kvproto//pkg/resource_manager", "@com_github_pingcap_log//:log", "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", "@com_github_tikv_pd_client//:client", "@io_etcd_go_etcd_client_v3//:client", "@io_etcd_go_etcd_client_v3//concurrency", @@ -62,6 +64,7 @@ go_test( deps = [ "//ddl/placement", "//ddl/util", + "//keyspace", "//parser/model", "//testkit/testsetup", "//util", diff --git a/domain/infosync/info.go b/domain/infosync/info.go index 6c9e721959cf9..f7bb73065f053 100644 --- a/domain/infosync/info.go +++ b/domain/infosync/info.go @@ -55,6 +55,7 @@ import ( "github.com/pingcap/tidb/util/pdapi" "github.com/pingcap/tidb/util/versioninfo" "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/client/v3/concurrency" @@ -186,7 +187,14 @@ func setGlobalInfoSyncer(is *InfoSyncer) { } // GlobalInfoSyncerInit return a new InfoSyncer. It is exported for testing. -func GlobalInfoSyncerInit(ctx context.Context, id string, serverIDGetter func() uint64, etcdCli *clientv3.Client, unprefixedEtcdCli *clientv3.Client, skipRegisterToDashBoard bool) (*InfoSyncer, error) { +func GlobalInfoSyncerInit( + ctx context.Context, + id string, + serverIDGetter func() uint64, + etcdCli *clientv3.Client, + unprefixedEtcdCli *clientv3.Client, + codec tikv.Codec, + skipRegisterToDashBoard bool) (*InfoSyncer, error) { is := &InfoSyncer{ etcdCli: etcdCli, unprefixedEtcdCli: unprefixedEtcdCli, @@ -202,7 +210,7 @@ func GlobalInfoSyncerInit(ctx context.Context, id string, serverIDGetter func() is.placementManager = initPlacementManager(etcdCli) is.scheduleManager = initScheduleManager(etcdCli) is.resourceGroupManager = initResourceGroupManager(etcdCli) - is.tiflashReplicaManager = initTiFlashReplicaManager(etcdCli) + is.tiflashReplicaManager = initTiFlashReplicaManager(etcdCli, codec) setGlobalInfoSyncer(is) return is, nil } @@ -254,13 +262,13 @@ func initResourceGroupManager(etcdCli *clientv3.Client) ResourceGroupManager { return NewResourceManager(etcdCli) } -func initTiFlashReplicaManager(etcdCli *clientv3.Client) TiFlashReplicaManager { +func initTiFlashReplicaManager(etcdCli *clientv3.Client, codec tikv.Codec) TiFlashReplicaManager { if etcdCli == nil { m := mockTiFlashReplicaManagerCtx{tiflashProgressCache: make(map[int64]float64)} return &m } logutil.BgLogger().Warn("init TiFlashReplicaManager", zap.Strings("pd addrs", etcdCli.Endpoints())) - return &TiFlashReplicaManagerCtx{etcdCli: etcdCli, tiflashProgressCache: make(map[int64]float64)} + return &TiFlashReplicaManagerCtx{etcdCli: etcdCli, tiflashProgressCache: make(map[int64]float64), codec: codec} } func initScheduleManager(etcdCli *clientv3.Client) ScheduleManager { @@ -1218,6 +1226,10 @@ func ConfigureTiFlashPDForTable(id int64, count uint64, locationLabels *[]string // ConfigureTiFlashPDForPartitions configures pd rule for all partition in partitioned tables. func ConfigureTiFlashPDForPartitions(accel bool, definitions *[]model.PartitionDefinition, count uint64, locationLabels *[]string, tableID int64) error { + if config.GetGlobalKeyspaceName() != "" && count > 0 { + // TiDB 6.6 doesn't support tiflash multi-tenancy yet. + return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) + } is, err := getGlobalInfoSyncer() if err != nil { return errors.Trace(err) diff --git a/domain/infosync/info_test.go b/domain/infosync/info_test.go index 3264c0adca3c6..0654b3bc0ef97 100644 --- a/domain/infosync/info_test.go +++ b/domain/infosync/info_test.go @@ -28,6 +28,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/ddl/placement" "github.com/pingcap/tidb/ddl/util" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/testkit/testsetup" util2 "github.com/pingcap/tidb/util" @@ -67,7 +68,7 @@ func TestTopology(t *testing.T) { require.NoError(t, err) }() - info, err := GlobalInfoSyncerInit(ctx, currentID, func() uint64 { return 1 }, client, client, false) + info, err := GlobalInfoSyncerInit(ctx, currentID, func() uint64 { return 1 }, client, client, keyspace.CodecV1, false) require.NoError(t, err) err = info.newTopologySessionAndStoreServerInfo(ctx, util2.NewSessionDefaultRetryCnt) @@ -152,7 +153,7 @@ func (is *InfoSyncer) ttlKeyExists(ctx context.Context) (bool, error) { } func TestPutBundlesRetry(t *testing.T) { - _, err := GlobalInfoSyncerInit(context.TODO(), "test", func() uint64 { return 1 }, nil, nil, false) + _, err := GlobalInfoSyncerInit(context.TODO(), "test", func() uint64 { return 1 }, nil, nil, keyspace.CodecV1, false) require.NoError(t, err) bundle, err := placement.NewBundleFromOptions(&model.PlacementSettings{PrimaryRegion: "r1", Regions: "r1,r2"}) @@ -216,7 +217,7 @@ func TestPutBundlesRetry(t *testing.T) { func TestTiFlashManager(t *testing.T) { ctx := context.Background() - _, err := GlobalInfoSyncerInit(ctx, "test", func() uint64 { return 1 }, nil, nil, false) + _, err := GlobalInfoSyncerInit(ctx, "test", func() uint64 { return 1 }, nil, nil, keyspace.CodecV1, false) tiflash := NewMockTiFlash() SetMockTiFlash(tiflash) diff --git a/domain/infosync/tiflash_manager.go b/domain/infosync/tiflash_manager.go index d5cc46f95db95..4551f827bf6c2 100644 --- a/domain/infosync/tiflash_manager.go +++ b/domain/infosync/tiflash_manager.go @@ -32,12 +32,15 @@ import ( "github.com/gorilla/mux" "github.com/pingcap/errors" "github.com/pingcap/failpoint" + "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/ddl/placement" "github.com/pingcap/tidb/store/helper" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/util/codec" + "github.com/pingcap/tidb/util/dbterror" "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/pdapi" + "github.com/tikv/client-go/v2/tikv" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" ) @@ -77,6 +80,7 @@ type TiFlashReplicaManagerCtx struct { etcdCli *clientv3.Client sync.RWMutex // protect tiflashProgressCache tiflashProgressCache map[int64]float64 + codec tikv.Codec } // Close is called to close TiFlashReplicaManagerCtx. @@ -230,6 +234,11 @@ func (m *TiFlashReplicaManagerCtx) SetTiFlashGroupConfig(ctx context.Context) er // SetPlacementRule is a helper function to set placement rule. func (m *TiFlashReplicaManagerCtx) SetPlacementRule(ctx context.Context, rule placement.TiFlashRule) error { + // TiDB 6.6 doesn't support tiflash multi-tenancy yet. + // TODO(iosmanthus): remove this check after TiDB supports tiflash multi-tenancy. + if m.codec.GetAPIVersion() == kvrpcpb.APIVersion_V2 && rule.Count > 0 { + return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) + } if err := m.SetTiFlashGroupConfig(ctx); err != nil { return err } diff --git a/server/BUILD.bazel b/server/BUILD.bazel index c0477b9248e5c..2f7de500099cf 100644 --- a/server/BUILD.bazel +++ b/server/BUILD.bazel @@ -162,6 +162,7 @@ go_test( "//expression", "//extension", "//infoschema", + "//keyspace", "//kv", "//meta", "//metrics", diff --git a/server/stat_test.go b/server/stat_test.go index 4484823f6dc83..656d66e5d00b8 100644 --- a/server/stat_test.go +++ b/server/stat_test.go @@ -21,6 +21,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" "github.com/stretchr/testify/require" @@ -46,7 +47,7 @@ func TestUptime(t *testing.T) { }() require.NoError(t, err) - _, err = infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), true) + _, err = infosync.GlobalInfoSyncerInit(context.Background(), dom.DDL().GetID(), dom.ServerID, dom.GetEtcdClient(), dom.GetEtcdClient(), keyspace.CodecV1, true) require.NoError(t, err) tidbdrv := NewTiDBDriver(store) From 92421d24380163c253fcce50bd62d8a77081ca70 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 00:59:10 +0800 Subject: [PATCH 03/18] reset all tiflash replica Signed-off-by: iosmanthus --- br/pkg/restore/client.go | 7 +++++-- domain/infosync/tiflash_manager.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/br/pkg/restore/client.go b/br/pkg/restore/client.go index 701f46f6f91fa..c818c479e1fca 100644 --- a/br/pkg/restore/client.go +++ b/br/pkg/restore/client.go @@ -1737,13 +1737,16 @@ func (rc *Client) PreCheckTableTiFlashReplica( tables []*metautil.Table, recorder *tiflashrec.TiFlashRecorder, ) error { - tiFlashStoreCount, err := rc.getTiFlashNodeCount(ctx) // For TiDB 6.6, we do not support recover TiFlash replica while enabling API V2. // TODO(iosmanthus): remove this after TiFlash support API V2. if rc.GetDomain().Store().GetCodec().GetAPIVersion() == kvrpcpb.APIVersion_V2 { log.Warn("TiFlash does not support API V2, reset replica count to 0") - tiFlashStoreCount = 0 + for _, table := range tables { + table.Info.TiFlashReplica = nil + } + return nil } + tiFlashStoreCount, err := rc.getTiFlashNodeCount(ctx) if err != nil { return err } diff --git a/domain/infosync/tiflash_manager.go b/domain/infosync/tiflash_manager.go index 4551f827bf6c2..29b9958dbdf4e 100644 --- a/domain/infosync/tiflash_manager.go +++ b/domain/infosync/tiflash_manager.go @@ -236,7 +236,7 @@ func (m *TiFlashReplicaManagerCtx) SetTiFlashGroupConfig(ctx context.Context) er func (m *TiFlashReplicaManagerCtx) SetPlacementRule(ctx context.Context, rule placement.TiFlashRule) error { // TiDB 6.6 doesn't support tiflash multi-tenancy yet. // TODO(iosmanthus): remove this check after TiDB supports tiflash multi-tenancy. - if m.codec.GetAPIVersion() == kvrpcpb.APIVersion_V2 && rule.Count > 0 { + if m.codec.GetAPIVersion() == kvrpcpb.APIVersion_V2 { return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) } if err := m.SetTiFlashGroupConfig(ctx); err != nil { From 2a5f2e9735ee2e611ff732583fa467ab39c4232c Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 01:06:50 +0800 Subject: [PATCH 04/18] goimports -w ./ Signed-off-by: iosmanthus --- domain/db_test.go | 2 +- domain/infosync/info_test.go | 2 +- server/stat_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/domain/db_test.go b/domain/db_test.go index abcdfda6f2925..02f716a27b3a8 100644 --- a/domain/db_test.go +++ b/domain/db_test.go @@ -16,7 +16,6 @@ package domain_test import ( "context" - "github.com/pingcap/tidb/keyspace" "testing" "time" @@ -24,6 +23,7 @@ import ( "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/server" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" diff --git a/domain/infosync/info_test.go b/domain/infosync/info_test.go index 2d14fcecaf2c8..ee97406eef01a 100644 --- a/domain/infosync/info_test.go +++ b/domain/infosync/info_test.go @@ -19,7 +19,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/pingcap/tidb/keyspace" "os" "path" "runtime" @@ -29,6 +28,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/ddl/placement" "github.com/pingcap/tidb/ddl/util" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/testkit/testsetup" util2 "github.com/pingcap/tidb/util" diff --git a/server/stat_test.go b/server/stat_test.go index 4b18a4c91a133..dfa2228467911 100644 --- a/server/stat_test.go +++ b/server/stat_test.go @@ -16,12 +16,12 @@ package server import ( "context" - "github.com/pingcap/tidb/keyspace" "testing" "time" "github.com/pingcap/failpoint" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" "github.com/stretchr/testify/require" From 981a36ff68c549d414e0e9d490a49ac62cb592b4 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 01:07:56 +0800 Subject: [PATCH 05/18] goimports -w ./ Signed-off-by: iosmanthus --- ddl/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/main_test.go b/ddl/main_test.go index 5e0d300572e2c..b1bbd8516fa94 100644 --- a/ddl/main_test.go +++ b/ddl/main_test.go @@ -17,7 +17,6 @@ package ddl_test import ( "context" "fmt" - "github.com/pingcap/tidb/keyspace" "os" "testing" "time" @@ -26,6 +25,7 @@ import ( "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/domain/infosync" + "github.com/pingcap/tidb/keyspace" "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/testkit/testsetup" "github.com/tikv/client-go/v2/tikv" From d3c20de8037c6ed7e96d2b10d153f8e198399be5 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 08:47:44 +0800 Subject: [PATCH 06/18] update error msg Signed-off-by: iosmanthus --- domain/infosync/tiflash_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/infosync/tiflash_manager.go b/domain/infosync/tiflash_manager.go index 29b9958dbdf4e..6e47d881215d4 100644 --- a/domain/infosync/tiflash_manager.go +++ b/domain/infosync/tiflash_manager.go @@ -237,7 +237,7 @@ func (m *TiFlashReplicaManagerCtx) SetPlacementRule(ctx context.Context, rule pl // TiDB 6.6 doesn't support tiflash multi-tenancy yet. // TODO(iosmanthus): remove this check after TiDB supports tiflash multi-tenancy. if m.codec.GetAPIVersion() == kvrpcpb.APIVersion_V2 { - return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) + return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("set TiFlash replica count while enabling API V2")) } if err := m.SetTiFlashGroupConfig(ctx); err != nil { return err From 833d0bea47f487213a453ec3c3585d05bd61cd99 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 08:52:35 +0800 Subject: [PATCH 07/18] remove useless error report Signed-off-by: iosmanthus --- domain/infosync/info.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/domain/infosync/info.go b/domain/infosync/info.go index 96795cabf0472..1e82ce308ac9b 100644 --- a/domain/infosync/info.go +++ b/domain/infosync/info.go @@ -1230,10 +1230,6 @@ func ConfigureTiFlashPDForTable(id int64, count uint64, locationLabels *[]string // ConfigureTiFlashPDForPartitions configures pd rule for all partition in partitioned tables. func ConfigureTiFlashPDForPartitions(accel bool, definitions *[]model.PartitionDefinition, count uint64, locationLabels *[]string, tableID int64) error { - if config.GetGlobalKeyspaceName() != "" && count > 0 { - // TiDB 6.6 doesn't support tiflash multi-tenancy yet. - return errors.Trace(dbterror.ErrNotSupportedYet.GenWithStackByArgs("TiFlash replica doesn't support API V2")) - } is, err := getGlobalInfoSyncer() if err != nil { return errors.Trace(err) From bba54724d8a56157d2b27ae22e85a365dd2c93b6 Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 13:59:39 +0800 Subject: [PATCH 08/18] startup --host_jvm_args=-Xmx5g Signed-off-by: iosmanthus --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 1ac13a3e138a7..67135217bc707 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,4 @@ -startup --host_jvm_args=-Xmx8g +startup --host_jvm_args=-Xmx5g startup --unlimit_coredumps run:ci --color=yes From adbf08fa1a276ec303bf0961ede7d4988fc96cdc Mon Sep 17 00:00:00 2001 From: iosmanthus Date: Wed, 8 Feb 2023 15:00:26 +0800 Subject: [PATCH 09/18] startup --host_jvm_args=-Xmx8g Signed-off-by: iosmanthus --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 67135217bc707..1ac13a3e138a7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,4 @@ -startup --host_jvm_args=-Xmx5g +startup --host_jvm_args=-Xmx8g startup --unlimit_coredumps run:ci --color=yes From 977ba9b6a3339883203548b98d9b5d411c287e26 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 8 Feb 2023 22:53:26 +0800 Subject: [PATCH 10/18] update Signed-off-by: Weizhen Wang --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6e00960f7dbda..bb5af86ee8b85 100644 --- a/Makefile +++ b/Makefile @@ -410,20 +410,20 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare - bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) \ --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... - bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) \ --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... bazel_build: bazel_ci_prepare mkdir -p bin - bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) \ //... --//build:with_nogo_flag=true - bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) \ //cmd/importer:importer //tidb-server:tidb-server //tidb-server:tidb-server-check --//build:with_nogo_flag=true cp bazel-out/k8-fastbuild/bin/tidb-server/tidb-server_/tidb-server ./bin cp bazel-out/k8-fastbuild/bin/cmd/importer/importer_/importer ./bin From 1a4237ff8bc7ae4cf8813ecdc4b8026dfdc16dc8 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 8 Feb 2023 23:34:32 +0800 Subject: [PATCH 11/18] update Signed-off-by: Weizhen Wang --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bb5af86ee8b85..dcf616f5c9891 100644 --- a/Makefile +++ b/Makefile @@ -410,11 +410,11 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... From 4998d878dde15860e9a800570a8e8aa76a46f6d5 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 8 Feb 2023 23:36:12 +0800 Subject: [PATCH 12/18] update Signed-off-by: Weizhen Wang --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dcf616f5c9891..3c7bf2e904923 100644 --- a/Makefile +++ b/Makefile @@ -410,12 +410,20 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ + --define gotags=deadlock,intest \ + -- //... -//cmd/... -//tests/graceshutdown/... \ + -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ - --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ + --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ + -- //... -//cmd/... -//tests/graceshutdown/... \ + -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ + --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ - --build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ + --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... From bd98d8543a69855fee4d9c6603fb0c1a3a4eba84 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 8 Feb 2023 23:46:46 +0800 Subject: [PATCH 13/18] update Signed-off-by: Weizhen Wang --- Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Makefile b/Makefile index 3c7bf2e904923..b930b08b96fef 100644 --- a/Makefile +++ b/Makefile @@ -410,18 +410,10 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ - --define gotags=deadlock,intest \ - -- //... -//cmd/... -//tests/graceshutdown/... \ - -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ - --define gotags=deadlock,intest,distributereorg \ - -- //... -//cmd/... -//tests/graceshutdown/... \ - -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ From 9b6d8194087dd7157c41983ba37ec5cee59790ff Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 8 Feb 2023 23:57:23 +0800 Subject: [PATCH 14/18] update Signed-off-by: Weizhen Wang --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b930b08b96fef..1457087ef61d4 100644 --- a/Makefile +++ b/Makefile @@ -410,11 +410,11 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... From c1066cd13cd0b504a47559a698f2c4d33c7cbbd0 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 9 Feb 2023 00:06:36 +0800 Subject: [PATCH 15/18] update Signed-off-by: Weizhen Wang --- statistics/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/statistics/BUILD.bazel b/statistics/BUILD.bazel index 8dccd523fc887..7186245a79bda 100644 --- a/statistics/BUILD.bazel +++ b/statistics/BUILD.bazel @@ -82,6 +82,7 @@ go_test( data = glob(["testdata/**"]), embed = [":statistics"], flaky = True, + shard_count = 50, deps = [ "//config", "//domain", From dc3916d36c58d0d9d0858f0d33de2bac4de32fde Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 9 Feb 2023 00:25:30 +0800 Subject: [PATCH 16/18] update Signed-off-by: Weizhen Wang --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1457087ef61d4..493cd46844c4e 100644 --- a/Makefile +++ b/Makefile @@ -421,7 +421,7 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare bazel_build: bazel_ci_prepare mkdir -p bin - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ //... --//build:with_nogo_flag=true bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) \ //cmd/importer:importer //tidb-server:tidb-server //tidb-server:tidb-server-check --//build:with_nogo_flag=true From e700e743d05d1b667e11f8f0e243cabae0fee482 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 9 Feb 2023 00:41:40 +0800 Subject: [PATCH 17/18] update Signed-off-by: Weizhen Wang --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 493cd46844c4e..d2d503e5cb725 100644 --- a/Makefile +++ b/Makefile @@ -410,11 +410,11 @@ bazel_test: failpoint-enable bazel_ci_prepare bazel_coverage_test: failpoint-enable bazel_ci_prepare - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=30720 --jobs=25 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --local_ram_resources=30720 --jobs=25 \ --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest,distributereorg \ -- //... -//cmd/... -//tests/graceshutdown/... \ -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... From 2add6b2057626f25f7e82a5e33423f14136e87e4 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Thu, 9 Feb 2023 00:58:42 +0800 Subject: [PATCH 18/18] update Signed-off-by: Weizhen Wang --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d2d503e5cb725..3254d88aab401 100644 --- a/Makefile +++ b/Makefile @@ -421,7 +421,7 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare bazel_build: bazel_ci_prepare mkdir -p bin - bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=50 \ + bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) --local_ram_resources=61440 --jobs=25 \ //... --//build:with_nogo_flag=true bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc build $(BAZEL_CMD_CONFIG) \ //cmd/importer:importer //tidb-server:tidb-server //tidb-server:tidb-server-check --//build:with_nogo_flag=true