Skip to content

Commit

Permalink
sessionctx: remove variables tidb_enable_mpp_balance_with_continuous_…
Browse files Browse the repository at this point in the history
…region* (#29309)
  • Loading branch information
JinheLin authored Nov 2, 2021
1 parent 4876801 commit a96deab
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 169 deletions.
3 changes: 0 additions & 3 deletions kv/mpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,4 @@ type MPPClient interface {
type MPPBuildTasksRequest struct {
KeyRanges []KeyRange
StartTS uint64

BalanceWithContinuity bool
BalanceContinuousRegionCount int64
}
4 changes: 1 addition & 3 deletions planner/core/fragment.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ func (e *mppTaskGenerator) constructMPPTasksImpl(ctx context.Context, ts *Physic

func (e *mppTaskGenerator) constructMPPTasksForSinglePartitionTable(ctx context.Context, kvRanges []kv.KeyRange, tableID int64) ([]*kv.MPPTask, error) {
req := &kv.MPPBuildTasksRequest{
KeyRanges: kvRanges,
BalanceWithContinuity: e.ctx.GetSessionVars().EnableMPPBalanceWithContinuousRegion,
BalanceContinuousRegionCount: e.ctx.GetSessionVars().EnableMPPBalanceWithContinuousRegionCount,
KeyRanges: kvRanges,
}
ttl, err := time.ParseDuration(e.ctx.GetSessionVars().MPPStoreFailTTL)
if err != nil {
Expand Down
5 changes: 0 additions & 5 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,6 @@ type SessionVars struct {
curr int8
data [2]stmtctx.StatementContext
}

// EnableMPPBalanceWithContinuousRegion indicates whether MPP balance logic will take account of region's continuity in TiFlash.
EnableMPPBalanceWithContinuousRegion bool
// EnableMPPBalanceWithContinuousRegionCount indicates the continuous region count that balance logic assigns to a TiFlash instance each time.
EnableMPPBalanceWithContinuousRegionCount int64
}

// InitStatementContext initializes a StatementContext, the object is reused to reduce allocation.
Expand Down
8 changes: 0 additions & 8 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -1838,14 +1838,6 @@ var defaultSysVars = []*SysVar{
s.EnablePseudoForOutdatedStats = TiDBOptOn(val)
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBEnableMPPBalanceWithContinuousRegion, Type: TypeBool, Value: BoolToOnOff(DefEnableMPPBalanceWithContinuousRegion), SetSession: func(s *SessionVars, val string) error {
s.EnableMPPBalanceWithContinuousRegion = TiDBOptOn(val)
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBEnableMPPBalanceWithContinuousRegionCount, Value: strconv.Itoa(DefEnableMPPBalanceWithContinuousRegionCount), Type: TypeInt, Hidden: true, MinValue: 1, MaxValue: 10000, AllowEmpty: true, SetSession: func(s *SessionVars, val string) error {
s.EnableMPPBalanceWithContinuousRegionCount = tidbOptInt64(val, DefEnableMPPBalanceWithContinuousRegionCount)
return nil
}},

{Scope: ScopeNone, Name: "version_compile_os", Value: runtime.GOOS},
{Scope: ScopeNone, Name: "version_compile_machine", Value: runtime.GOARCH},
Expand Down
291 changes: 142 additions & 149 deletions sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,6 @@ const (

// TiDBTmpTableMaxSize indicates the max memory size of temporary tables.
TiDBTmpTableMaxSize = "tidb_tmp_table_max_size"

// TiDBEnableMPPBalanceWithContinuousRegion indicates whether MPP balance logic will take account of region's continuity in TiFlash.
TiDBEnableMPPBalanceWithContinuousRegion = "tidb_enable_mpp_balance_with_continuous_region"
// TiDBEnableMPPBalanceWithContinuousRegionCount indicates the continuous region count that balance logic assigns to a TiFlash instance each time.
TiDBEnableMPPBalanceWithContinuousRegionCount = "tidb_enable_mpp_balance_with_continuous_region_count"
)

// TiDB vars that have only global scope
Expand Down Expand Up @@ -632,150 +627,148 @@ const (

// Default TiDB system variable values.
const (
DefHostname = "localhost"
DefIndexLookupConcurrency = ConcurrencyUnset
DefIndexLookupJoinConcurrency = ConcurrencyUnset
DefIndexSerialScanConcurrency = 1
DefIndexJoinBatchSize = 25000
DefIndexLookupSize = 20000
DefDistSQLScanConcurrency = 15
DefBuildStatsConcurrency = 4
DefAutoAnalyzeRatio = 0.5
DefAutoAnalyzeStartTime = "00:00 +0000"
DefAutoAnalyzeEndTime = "23:59 +0000"
DefAutoIncrementIncrement = 1
DefAutoIncrementOffset = 1
DefChecksumTableConcurrency = 4
DefSkipUTF8Check = false
DefSkipASCIICheck = false
DefOptAggPushDown = false
DefOptBCJ = false
DefOptCartesianBCJ = 1
DefOptMPPOuterJoinFixedBuildSide = false
DefOptWriteRowID = false
DefOptEnableCorrelationAdjustment = true
DefOptLimitPushDownThreshold = 100
DefOptCorrelationThreshold = 0.9
DefOptCorrelationExpFactor = 1
DefOptCPUFactor = 3.0
DefOptCopCPUFactor = 3.0
DefOptTiFlashConcurrencyFactor = 24.0
DefOptNetworkFactor = 1.0
DefOptScanFactor = 1.5
DefOptDescScanFactor = 3.0
DefOptSeekFactor = 20.0
DefOptMemoryFactor = 0.001
DefOptDiskFactor = 1.5
DefOptConcurrencyFactor = 3.0
DefOptInSubqToJoinAndAgg = true
DefOptPreferRangeScan = false
DefBatchInsert = false
DefBatchDelete = false
DefBatchCommit = false
DefCurretTS = 0
DefInitChunkSize = 32
DefMaxChunkSize = 1024
DefDMLBatchSize = 0
DefMaxPreparedStmtCount = -1
DefWaitTimeout = 0
DefTiDBMemQuotaApplyCache = 32 << 20 // 32MB.
DefTiDBMemQuotaHashJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaMergeJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaSort = 32 << 30 // 32GB.
DefTiDBMemQuotaTopn = 32 << 30 // 32GB.
DefTiDBMemQuotaIndexLookupReader = 32 << 30 // 32GB.
DefTiDBMemQuotaIndexLookupJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaDistSQL = 32 << 30 // 32GB.
DefTiDBGeneralLog = false
DefTiDBPProfSQLCPU = 0
DefTiDBRetryLimit = 10
DefTiDBDisableTxnAutoRetry = true
DefTiDBConstraintCheckInPlace = false
DefTiDBHashJoinConcurrency = ConcurrencyUnset
DefTiDBProjectionConcurrency = ConcurrencyUnset
DefBroadcastJoinThresholdSize = 100 * 1024 * 1024
DefBroadcastJoinThresholdCount = 10 * 1024
DefTiDBOptimizerSelectivityLevel = 0
DefTiDBAllowBatchCop = 1
DefTiDBAllowMPPExecution = true
DefTiDBHashExchangeWithNewCollation = true
DefTiDBEnforceMPPExecution = false
DefTiDBMPPStoreFailTTL = "60s"
DefTiDBTxnMode = ""
DefTiDBRowFormatV1 = 1
DefTiDBRowFormatV2 = 2
DefTiDBDDLReorgWorkerCount = 4
DefTiDBDDLReorgBatchSize = 256
DefTiDBDDLErrorCountLimit = 512
DefTiDBMaxDeltaSchemaCount = 1024
DefTiDBChangeMultiSchema = false
DefTiDBPointGetCache = false
DefTiDBEnableAlterPlacement = false
DefTiDBEnableAutoIncrementInGenerated = false
DefTiDBHashAggPartialConcurrency = ConcurrencyUnset
DefTiDBHashAggFinalConcurrency = ConcurrencyUnset
DefTiDBWindowConcurrency = ConcurrencyUnset
DefTiDBMergeJoinConcurrency = 1 // disable optimization by default
DefTiDBStreamAggConcurrency = 1
DefTiDBForcePriority = mysql.NoPriority
DefEnableWindowFunction = true
DefEnablePipelinedWindowFunction = true
DefEnableStrictDoubleTypeCheck = true
DefEnableVectorizedExpression = true
DefTiDBOptJoinReorderThreshold = 0
DefTiDBDDLSlowOprThreshold = 300
DefTiDBUseFastAnalyze = false
DefTiDBSkipIsolationLevelCheck = false
DefTiDBExpensiveQueryTimeThreshold = 60 // 60s
DefTiDBScatterRegion = false
DefTiDBWaitSplitRegionFinish = true
DefWaitSplitRegionTimeout = 300 // 300s
DefTiDBEnableNoopFuncs = Off
DefTiDBAllowRemoveAutoInc = false
DefTiDBUsePlanBaselines = true
DefTiDBEvolvePlanBaselines = false
DefTiDBEvolvePlanTaskMaxTime = 600 // 600s
DefTiDBEvolvePlanTaskStartTime = "00:00 +0000"
DefTiDBEvolvePlanTaskEndTime = "23:59 +0000"
DefInnodbLockWaitTimeout = 50 // 50s
DefTiDBStoreLimit = 0
DefTiDBMetricSchemaStep = 60 // 60s
DefTiDBMetricSchemaRangeDuration = 60 // 60s
DefTiDBFoundInPlanCache = false
DefTiDBFoundInBinding = false
DefTiDBEnableCollectExecutionInfo = true
DefTiDBAllowAutoRandExplicitInsert = false
DefTiDBEnableClusteredIndex = ClusteredIndexDefModeIntOnly
DefTiDBRedactLog = false
DefTiDBRestrictedReadOnly = false
DefTiDBShardAllocateStep = math.MaxInt64
DefTiDBEnableTelemetry = true
DefTiDBEnableParallelApply = false
DefTiDBEnableAmendPessimisticTxn = false
DefTiDBPartitionPruneMode = "static"
DefTiDBEnableRateLimitAction = true
DefTiDBEnableAsyncCommit = false
DefTiDBEnable1PC = false
DefTiDBGuaranteeLinearizability = true
DefTiDBAnalyzeVersion = 2
DefTiDBEnableIndexMergeJoin = false
DefTiDBTrackAggregateMemoryUsage = true
DefTiDBEnableExchangePartition = false
DefCTEMaxRecursionDepth = 1000
DefTiDBTopSQLEnable = false
DefTiDBTopSQLPrecisionSeconds = 1
DefTiDBTopSQLMaxStatementCount = 200
DefTiDBTopSQLMaxCollect = 10000
DefTiDBTopSQLReportIntervalSeconds = 60
DefTiDBTmpTableMaxSize = 64 << 20 // 64MB.
DefTiDBEnableLocalTxn = false
DefTiDBTSOClientBatchMaxWaitTime = 0 // 0ms
DefTiDBEnableTSOFollowerProxy = false
DefTiDBEnableOrderedResultMode = false
DefTiDBEnablePseudoForOutdatedStats = true
DefEnableMPPBalanceWithContinuousRegion = true
DefEnableMPPBalanceWithContinuousRegionCount = 20
DefEnablePlacementCheck = true
DefHostname = "localhost"
DefIndexLookupConcurrency = ConcurrencyUnset
DefIndexLookupJoinConcurrency = ConcurrencyUnset
DefIndexSerialScanConcurrency = 1
DefIndexJoinBatchSize = 25000
DefIndexLookupSize = 20000
DefDistSQLScanConcurrency = 15
DefBuildStatsConcurrency = 4
DefAutoAnalyzeRatio = 0.5
DefAutoAnalyzeStartTime = "00:00 +0000"
DefAutoAnalyzeEndTime = "23:59 +0000"
DefAutoIncrementIncrement = 1
DefAutoIncrementOffset = 1
DefChecksumTableConcurrency = 4
DefSkipUTF8Check = false
DefSkipASCIICheck = false
DefOptAggPushDown = false
DefOptBCJ = false
DefOptCartesianBCJ = 1
DefOptMPPOuterJoinFixedBuildSide = false
DefOptWriteRowID = false
DefOptEnableCorrelationAdjustment = true
DefOptLimitPushDownThreshold = 100
DefOptCorrelationThreshold = 0.9
DefOptCorrelationExpFactor = 1
DefOptCPUFactor = 3.0
DefOptCopCPUFactor = 3.0
DefOptTiFlashConcurrencyFactor = 24.0
DefOptNetworkFactor = 1.0
DefOptScanFactor = 1.5
DefOptDescScanFactor = 3.0
DefOptSeekFactor = 20.0
DefOptMemoryFactor = 0.001
DefOptDiskFactor = 1.5
DefOptConcurrencyFactor = 3.0
DefOptInSubqToJoinAndAgg = true
DefOptPreferRangeScan = false
DefBatchInsert = false
DefBatchDelete = false
DefBatchCommit = false
DefCurretTS = 0
DefInitChunkSize = 32
DefMaxChunkSize = 1024
DefDMLBatchSize = 0
DefMaxPreparedStmtCount = -1
DefWaitTimeout = 0
DefTiDBMemQuotaApplyCache = 32 << 20 // 32MB.
DefTiDBMemQuotaHashJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaMergeJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaSort = 32 << 30 // 32GB.
DefTiDBMemQuotaTopn = 32 << 30 // 32GB.
DefTiDBMemQuotaIndexLookupReader = 32 << 30 // 32GB.
DefTiDBMemQuotaIndexLookupJoin = 32 << 30 // 32GB.
DefTiDBMemQuotaDistSQL = 32 << 30 // 32GB.
DefTiDBGeneralLog = false
DefTiDBPProfSQLCPU = 0
DefTiDBRetryLimit = 10
DefTiDBDisableTxnAutoRetry = true
DefTiDBConstraintCheckInPlace = false
DefTiDBHashJoinConcurrency = ConcurrencyUnset
DefTiDBProjectionConcurrency = ConcurrencyUnset
DefBroadcastJoinThresholdSize = 100 * 1024 * 1024
DefBroadcastJoinThresholdCount = 10 * 1024
DefTiDBOptimizerSelectivityLevel = 0
DefTiDBAllowBatchCop = 1
DefTiDBAllowMPPExecution = true
DefTiDBHashExchangeWithNewCollation = true
DefTiDBEnforceMPPExecution = false
DefTiDBMPPStoreFailTTL = "60s"
DefTiDBTxnMode = ""
DefTiDBRowFormatV1 = 1
DefTiDBRowFormatV2 = 2
DefTiDBDDLReorgWorkerCount = 4
DefTiDBDDLReorgBatchSize = 256
DefTiDBDDLErrorCountLimit = 512
DefTiDBMaxDeltaSchemaCount = 1024
DefTiDBChangeMultiSchema = false
DefTiDBPointGetCache = false
DefTiDBEnableAlterPlacement = false
DefTiDBEnableAutoIncrementInGenerated = false
DefTiDBHashAggPartialConcurrency = ConcurrencyUnset
DefTiDBHashAggFinalConcurrency = ConcurrencyUnset
DefTiDBWindowConcurrency = ConcurrencyUnset
DefTiDBMergeJoinConcurrency = 1 // disable optimization by default
DefTiDBStreamAggConcurrency = 1
DefTiDBForcePriority = mysql.NoPriority
DefEnableWindowFunction = true
DefEnablePipelinedWindowFunction = true
DefEnableStrictDoubleTypeCheck = true
DefEnableVectorizedExpression = true
DefTiDBOptJoinReorderThreshold = 0
DefTiDBDDLSlowOprThreshold = 300
DefTiDBUseFastAnalyze = false
DefTiDBSkipIsolationLevelCheck = false
DefTiDBExpensiveQueryTimeThreshold = 60 // 60s
DefTiDBScatterRegion = false
DefTiDBWaitSplitRegionFinish = true
DefWaitSplitRegionTimeout = 300 // 300s
DefTiDBEnableNoopFuncs = Off
DefTiDBAllowRemoveAutoInc = false
DefTiDBUsePlanBaselines = true
DefTiDBEvolvePlanBaselines = false
DefTiDBEvolvePlanTaskMaxTime = 600 // 600s
DefTiDBEvolvePlanTaskStartTime = "00:00 +0000"
DefTiDBEvolvePlanTaskEndTime = "23:59 +0000"
DefInnodbLockWaitTimeout = 50 // 50s
DefTiDBStoreLimit = 0
DefTiDBMetricSchemaStep = 60 // 60s
DefTiDBMetricSchemaRangeDuration = 60 // 60s
DefTiDBFoundInPlanCache = false
DefTiDBFoundInBinding = false
DefTiDBEnableCollectExecutionInfo = true
DefTiDBAllowAutoRandExplicitInsert = false
DefTiDBEnableClusteredIndex = ClusteredIndexDefModeIntOnly
DefTiDBRedactLog = false
DefTiDBRestrictedReadOnly = false
DefTiDBShardAllocateStep = math.MaxInt64
DefTiDBEnableTelemetry = true
DefTiDBEnableParallelApply = false
DefTiDBEnableAmendPessimisticTxn = false
DefTiDBPartitionPruneMode = "static"
DefTiDBEnableRateLimitAction = true
DefTiDBEnableAsyncCommit = false
DefTiDBEnable1PC = false
DefTiDBGuaranteeLinearizability = true
DefTiDBAnalyzeVersion = 2
DefTiDBEnableIndexMergeJoin = false
DefTiDBTrackAggregateMemoryUsage = true
DefTiDBEnableExchangePartition = false
DefCTEMaxRecursionDepth = 1000
DefTiDBTopSQLEnable = false
DefTiDBTopSQLPrecisionSeconds = 1
DefTiDBTopSQLMaxStatementCount = 200
DefTiDBTopSQLMaxCollect = 10000
DefTiDBTopSQLReportIntervalSeconds = 60
DefTiDBTmpTableMaxSize = 64 << 20 // 64MB.
DefTiDBEnableLocalTxn = false
DefTiDBTSOClientBatchMaxWaitTime = 0 // 0ms
DefTiDBEnableTSOFollowerProxy = false
DefTiDBEnableOrderedResultMode = false
DefTiDBEnablePseudoForOutdatedStats = true
DefEnablePlacementCheck = true
)

// Process global variables.
Expand Down
2 changes: 1 addition & 1 deletion store/copr/mpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (c *MPPClient) ConstructMPPTasks(ctx context.Context, req *kv.MPPBuildTasks
return c.selectAllTiFlashStore(), nil
}
ranges := NewKeyRanges(req.KeyRanges)
tasks, err := buildBatchCopTasks(bo, c.store, ranges, kv.TiFlash, mppStoreLastFailTime, ttl, req.BalanceWithContinuity, req.BalanceContinuousRegionCount)
tasks, err := buildBatchCopTasks(bo, c.store, ranges, kv.TiFlash, mppStoreLastFailTime, ttl, true, 20)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down

0 comments on commit a96deab

Please sign in to comment.