@@ -19,7 +19,6 @@ import (
19
19
"encoding/json"
20
20
"flag"
21
21
"fmt"
22
- "math"
23
22
"net/url"
24
23
"os"
25
24
"path/filepath"
@@ -1159,9 +1158,6 @@ type PDServerConfig struct {
1159
1158
MetricStorage string `toml:"metric-storage" json:"metric-storage"`
1160
1159
// There are some values supported: "auto", "none", or a specific address, default: "auto"
1161
1160
DashboardAddress string `toml:"dashboard-address" json:"dashboard-address"`
1162
- // TraceRegionFlow the option to update flow information of regions.
1163
- // WARN: TraceRegionFlow is deprecated.
1164
- TraceRegionFlow bool `toml:"trace-region-flow" json:"trace-region-flow,string,omitempty"`
1165
1161
// FlowRoundByDigit used to discretization processing flow information.
1166
1162
FlowRoundByDigit int `toml:"flow-round-by-digit" json:"flow-round-by-digit"`
1167
1163
// MinResolvedTSPersistenceInterval is the interval to save the min resolved ts.
@@ -1188,35 +1184,21 @@ func (c *PDServerConfig) adjust(meta *configMetaData) error {
1188
1184
if ! meta .IsDefined ("min-resolved-ts-persistence-interval" ) {
1189
1185
adjustDuration (& c .MinResolvedTSPersistenceInterval , DefaultMinResolvedTSPersistenceInterval )
1190
1186
}
1191
- c . migrateConfigurationFromFile (meta )
1187
+ migrateConfigurationFromFile (meta )
1192
1188
return c .Validate ()
1193
1189
}
1194
1190
1195
- func ( c * PDServerConfig ) migrateConfigurationFromFile (meta * configMetaData ) error {
1191
+ func migrateConfigurationFromFile (meta * configMetaData ) error {
1196
1192
oldName , newName := "trace-region-flow" , "flow-round-by-digit"
1197
- defineOld , defineNew := meta .IsDefined (oldName ), meta . IsDefined ( newName )
1193
+ defineOld := meta .IsDefined (oldName )
1198
1194
switch {
1199
- case defineOld && defineNew :
1200
- if c .TraceRegionFlow && (c .FlowRoundByDigit == defaultFlowRoundByDigit ) {
1201
- return errors .Errorf ("config item %s and %s(deprecated) are conflict" , newName , oldName )
1202
- }
1203
- case defineOld && ! defineNew :
1204
- if ! c .TraceRegionFlow {
1205
- c .FlowRoundByDigit = math .MaxInt8
1206
- }
1195
+ case defineOld :
1196
+ return errors .Errorf ("config item %s and %s(deprecated) are conflict" , newName , oldName )
1197
+ default :
1207
1198
}
1208
1199
return nil
1209
1200
}
1210
1201
1211
- // MigrateDeprecatedFlags updates new flags according to deprecated flags.
1212
- func (c * PDServerConfig ) MigrateDeprecatedFlags () {
1213
- if ! c .TraceRegionFlow {
1214
- c .FlowRoundByDigit = math .MaxInt8
1215
- }
1216
- // json omity the false. next time will not persist to the kv.
1217
- c .TraceRegionFlow = false
1218
- }
1219
-
1220
1202
// Clone returns a cloned PD server config.
1221
1203
func (c * PDServerConfig ) Clone () * PDServerConfig {
1222
1204
runtimeServices := append (c .RuntimeServices [:0 :0 ], c .RuntimeServices ... )
0 commit comments