@@ -23,8 +23,6 @@ import (
23
23
24
24
"github.com/pingcap/tidb/br/pkg/lightning/backend/local"
25
25
"github.com/pingcap/tidb/br/pkg/lightning/config"
26
- "github.com/pingcap/tidb/pkg/ddl/util"
27
- "github.com/pingcap/tidb/pkg/sessionctx"
28
26
"github.com/pingcap/tidb/pkg/util/generic"
29
27
"github.com/pingcap/tidb/pkg/util/logutil"
30
28
kvutil "github.com/tikv/client-go/v2/util"
@@ -42,12 +40,11 @@ type BackendCtxMgr interface {
42
40
43
41
type litBackendCtxMgr struct {
44
42
generic.SyncMap [int64 , * litBackendCtx ]
45
- memRoot MemRoot
46
- diskRoot DiskRoot
47
- isRaftKV2 bool
43
+ memRoot MemRoot
44
+ diskRoot DiskRoot
48
45
}
49
46
50
- func newLitBackendCtxMgr (ctx context. Context , sctx sessionctx. Context , path string , memQuota uint64 ) BackendCtxMgr {
47
+ func newLitBackendCtxMgr (path string , memQuota uint64 ) BackendCtxMgr {
51
48
mgr := & litBackendCtxMgr {
52
49
SyncMap : generic.NewSyncMap [int64 , * litBackendCtx ](10 ),
53
50
memRoot : nil ,
@@ -62,11 +59,6 @@ func newLitBackendCtxMgr(ctx context.Context, sctx sessionctx.Context, path stri
62
59
if err != nil {
63
60
logutil .BgLogger ().Warn ("ingest backfill may not be available" , zap .String ("category" , "ddl-ingest" ), zap .Error (err ))
64
61
}
65
- isRaftKV2 , err := util .IsRaftKv2 (ctx , sctx )
66
- if err != nil {
67
- logutil .BgLogger ().Warn ("failed to get 'storage.engine'" , zap .String ("category" , "ddl-ingest" ), zap .Error (err ))
68
- }
69
- mgr .isRaftKV2 = isRaftKV2
70
62
return mgr
71
63
}
72
64
@@ -95,7 +87,7 @@ func (m *litBackendCtxMgr) Register(ctx context.Context, unique bool, jobID int6
95
87
if ! ok {
96
88
return nil , genBackendAllocMemFailedErr (ctx , m .memRoot , jobID )
97
89
}
98
- cfg , err := genConfig (ctx , m .memRoot , jobID , unique , m . isRaftKV2 )
90
+ cfg , err := genConfig (ctx , m .memRoot , jobID , unique )
99
91
if err != nil {
100
92
logutil .Logger (ctx ).Warn (LitWarnConfigError , zap .Int64 ("job ID" , jobID ), zap .Error (err ))
101
93
return nil , err
@@ -130,10 +122,9 @@ func createLocalBackend(ctx context.Context, cfg *Config, resourceGroupName stri
130
122
regionSizeGetter := & local.TableRegionSizeGetterImpl {
131
123
DB : nil ,
132
124
}
125
+ // We disable the switch TiKV mode feature for now,
126
+ // because the impact is not fully tested.
133
127
var raftKV2SwitchModeDuration time.Duration
134
- if cfg .IsRaftKV2 {
135
- raftKV2SwitchModeDuration = config .DefaultSwitchTiKVModeInterval
136
- }
137
128
backendConfig := local .NewBackendConfig (cfg .Lightning , int (LitRLimit ), cfg .KeyspaceName , resourceGroupName , kvutil .ExplicitTypeDDL , raftKV2SwitchModeDuration )
138
129
return local .NewBackend (ctx , tls , backendConfig , regionSizeGetter )
139
130
}
0 commit comments