@@ -1314,13 +1314,6 @@ const (
13141314 // SpanPartitionReason_ROUND_ROBIN is reported when there is no locality info
13151315 // on any of the instances and so we default to a naive round-robin strategy.
13161316 SpanPartitionReason_ROUND_ROBIN
1317- // SpanPartitionReason_GOSSIP_GATEWAY_TARGET_UNHEALTHY is reported when the
1318- // target node retrieved via gossip is deemed unhealthy. In this case we
1319- // default to the gateway node.
1320- SpanPartitionReason_GOSSIP_GATEWAY_TARGET_UNHEALTHY
1321- // SpanPartitionReason_GOSSIP_TARGET_HEALTHY is reported when the
1322- // target node retrieved via gossip is deemed healthy.
1323- SpanPartitionReason_GOSSIP_TARGET_HEALTHY
13241317 // SpanPartitionReason_LOCALITY_FILTERED_RANDOM_GATEWAY_OVERLOADED is reported
13251318 // when there is no match to the provided locality filter and the gateway is
13261319 // eligible but overloaded with other partitions. In this case we pick a
@@ -1350,10 +1343,6 @@ func (r SpanPartitionReason) String() string {
13501343 return "locality-filtered-random"
13511344 case SpanPartitionReason_ROUND_ROBIN :
13521345 return "round-robin"
1353- case SpanPartitionReason_GOSSIP_GATEWAY_TARGET_UNHEALTHY :
1354- return "gossip-gateway-target-unhealthy"
1355- case SpanPartitionReason_GOSSIP_TARGET_HEALTHY :
1356- return "gossip-target-healthy"
13571346 case SpanPartitionReason_LOCALITY_FILTERED_RANDOM_GATEWAY_OVERLOADED :
13581347 return "locality-filtered-random-gateway-overloaded"
13591348 default :
@@ -1527,9 +1516,6 @@ func (dsp *DistSQLPlanner) partitionSpansEx(
15271516 return []SpanPartition {{SQLInstanceID : dsp .gatewaySQLInstanceID , Spans : spans }},
15281517 true /* ignoreMisplannedRanges */ , nil
15291518 }
1530- if dsp .useGossipPlanning (ctx , planCtx ) {
1531- return dsp .deprecatedPartitionSpansSystem (ctx , planCtx , spans )
1532- }
15331519 return dsp .partitionSpans (ctx , planCtx , spans , bound )
15341520}
15351521
@@ -1651,27 +1637,6 @@ func (dsp *DistSQLPlanner) partitionSpan(
16511637 return partitions , lastPartitionIdx , nil
16521638}
16531639
1654- // deprecatedPartitionSpansSystem finds node owners for ranges touching the given spans
1655- // for a system tenant.
1656- func (dsp * DistSQLPlanner ) deprecatedPartitionSpansSystem (
1657- ctx context.Context , planCtx * PlanningCtx , spans roachpb.Spans ,
1658- ) (partitions []SpanPartition , ignoreMisplannedRanges bool , _ error ) {
1659- nodeMap := make (map [base.SQLInstanceID ]int )
1660- resolver := func (nodeID roachpb.NodeID ) (base.SQLInstanceID , SpanPartitionReason ) {
1661- return dsp .deprecatedHealthySQLInstanceIDForKVNodeIDSystem (ctx , planCtx , nodeID )
1662- }
1663- for _ , span := range spans {
1664- var err error
1665- partitions , _ , err = dsp .partitionSpan (
1666- ctx , planCtx , span , partitions , nodeMap , resolver , & ignoreMisplannedRanges ,
1667- )
1668- if err != nil {
1669- return nil , false , err
1670- }
1671- }
1672- return partitions , ignoreMisplannedRanges , nil
1673- }
1674-
16751640// partitionSpans assigns SQL instances to spans. In mixed sql and KV mode it
16761641// generally assigns each span to the instance hosted on the KV node chosen by
16771642// the configured replica oracle, while in clusters operating with standalone
@@ -1730,26 +1695,6 @@ func (dsp *DistSQLPlanner) partitionSpans(
17301695 return partitions , ignoreMisplannedRanges , nil
17311696}
17321697
1733- // deprecatedHealthySQLInstanceIDForKVNodeIDSystem returns the SQL instance that
1734- // should handle the range with the given node ID when planning is done on
1735- // behalf of the system tenant. It ensures that the chosen SQL instance is
1736- // healthy and of the compatible DistSQL version.
1737- func (dsp * DistSQLPlanner ) deprecatedHealthySQLInstanceIDForKVNodeIDSystem (
1738- ctx context.Context , planCtx * PlanningCtx , nodeID roachpb.NodeID ,
1739- ) (base.SQLInstanceID , SpanPartitionReason ) {
1740- sqlInstanceID := base .SQLInstanceID (nodeID )
1741- status := dsp .checkInstanceHealthAndVersionSystem (ctx , planCtx , sqlInstanceID )
1742- // If the node is unhealthy, use the gateway to process this span instead of
1743- // the unhealthy host. An empty address indicates an unhealthy host.
1744- reason := SpanPartitionReason_GOSSIP_TARGET_HEALTHY
1745- if status != NodeOK {
1746- log .VEventf (ctx , 2 , "not planning on node %d: %s" , sqlInstanceID , status )
1747- sqlInstanceID = dsp .gatewaySQLInstanceID
1748- reason = SpanPartitionReason_GOSSIP_GATEWAY_TARGET_UNHEALTHY
1749- }
1750- return sqlInstanceID , reason
1751- }
1752-
17531698// checkInstanceHealth returns the instance health status by dialing the node.
17541699// It also caches the result to avoid redialing for a query.
17551700func (dsp * DistSQLPlanner ) checkInstanceHealth (
@@ -2129,10 +2074,6 @@ func (dsp *DistSQLPlanner) getInstanceIDForScan(
21292074 return 0 , err
21302075 }
21312076
2132- if dsp .useGossipPlanning (ctx , planCtx ) {
2133- sqlInstanceID , _ := dsp .deprecatedHealthySQLInstanceIDForKVNodeIDSystem (ctx , planCtx , replDesc .NodeID )
2134- return sqlInstanceID , nil
2135- }
21362077 resolver , err := dsp .makeInstanceResolver (ctx , planCtx )
21372078 if err != nil {
21382079 return 0 , err
@@ -2142,23 +2083,6 @@ func (dsp *DistSQLPlanner) getInstanceIDForScan(
21422083 return sqlInstanceID , nil
21432084}
21442085
2145- // TODO(yuzefovich): retire this setting altogether in 25.3 release.
2146- var useGossipPlanning = settings .RegisterBoolSetting (
2147- settings .ApplicationLevel ,
2148- "sql.distsql_planning.use_gossip.enabled" ,
2149- "if enabled, the DistSQL physical planner falls back to gossip-based planning" ,
2150- false ,
2151- )
2152-
2153- func (dsp * DistSQLPlanner ) useGossipPlanning (_ context.Context , planCtx * PlanningCtx ) bool {
2154- var gossipPlanningEnabled bool
2155- // Some of the planCtx fields can be left unset in tests.
2156- if planCtx .ExtendedEvalCtx != nil && planCtx .ExtendedEvalCtx .Settings != nil {
2157- gossipPlanningEnabled = useGossipPlanning .Get (& planCtx .ExtendedEvalCtx .Settings .SV )
2158- }
2159- return dsp .codec .ForSystemTenant () && planCtx .localityFilter .Empty () && gossipPlanningEnabled
2160- }
2161-
21622086// convertOrdering maps the columns in props.ordering to the output columns of a
21632087// processor.
21642088func (dsp * DistSQLPlanner ) convertOrdering (
0 commit comments