fix: Add kMaxSpillBytes to system config -> velox query config mapping#27132
fix: Add kMaxSpillBytes to system config -> velox query config mapping#27132han-yan01 merged 1 commit intoprestodb:masterfrom
Conversation
Reviewer's GuidePropagates the max spill bytes system configuration into Velox QueryConfig and extends tests to cover the new mapping and its interaction with session properties and system configs. Sequence diagram for propagation of kMaxSpillBytes from system config to Velox QueryConfigsequenceDiagram
actor Admin
participant PrestoServer
participant SystemConfig
participant PrestoToVeloxQueryConfig
participant VeloxQueryConfig
Admin->>SystemConfig: set kMaxSpillBytes
PrestoServer->>SystemConfig: load system configs
SystemConfig-->>PrestoServer: configs map
PrestoServer->>PrestoToVeloxQueryConfig: updateFromSystemConfigs(configs)
PrestoToVeloxQueryConfig->>PrestoToVeloxQueryConfig: lookup kMaxSpillBytes mapping
PrestoToVeloxQueryConfig->>VeloxQueryConfig: set kMaxSpillBytes from SystemConfig
VeloxQueryConfig-->>PrestoServer: effective spill limit
PrestoServer-->>Admin: execute query with configured spill limit
Sequence diagram for precedence between session kMaxSpillBytes and system configsequenceDiagram
actor User
participant Client
participant PrestoServer
participant SessionProperties
participant SystemConfig
participant PrestoToVeloxQueryConfig
participant VeloxQueryConfig
User->>Client: set session kMaxSpillBytes (optional)
Client->>PrestoServer: submit query
PrestoServer->>SessionProperties: read session kMaxSpillBytes
SessionProperties-->>PrestoServer: value or null
PrestoServer->>SystemConfig: read kMaxSpillBytes
SystemConfig-->>PrestoServer: system value
PrestoServer->>PrestoToVeloxQueryConfig: build QueryConfig
PrestoToVeloxQueryConfig->>PrestoToVeloxQueryConfig: if session value exists use it
PrestoToVeloxQueryConfig->>PrestoToVeloxQueryConfig: else use system kMaxSpillBytes
PrestoToVeloxQueryConfig->>VeloxQueryConfig: set kMaxSpillBytes
VeloxQueryConfig-->>PrestoServer: effective spill limit used for execution
Class diagram for Presto system config to Velox QueryConfig mapping of kMaxSpillBytesclassDiagram
class SystemConfig {
+kAggregationSpillEnabled string
+kMaxSpillBytes string
+kRequestDataSizesMaxWaitSec string
}
class QueryConfig {
+kAggregationSpillEnabled string
+kMaxSpillBytes string
+kRequestDataSizesMaxWaitSec string
}
class ConfigMappingEntry {
+prestoSystemConfig string
+veloxConfig string
}
class PrestoToVeloxQueryConfig {
+updateFromSystemConfigs(systemConfigValues, queryConfig)
-veloxToPrestoConfigMapping ConfigMappingEntry[]
}
PrestoToVeloxQueryConfig "1" o-- "*" ConfigMappingEntry : uses
SystemConfig <.. PrestoToVeloxQueryConfig : reads_keys
QueryConfig <.. PrestoToVeloxQueryConfig : writes_keys
ConfigMappingEntry <|-- MaxSpillBytesMapping
class MaxSpillBytesMapping {
+prestoSystemConfig = SystemConfig.kMaxSpillBytes
+veloxConfig = QueryConfig.kMaxSpillBytes
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `presto-native-execution/presto_cpp/main/tests/PrestoToVeloxQueryConfigTest.cpp:144-153` </location>
<code_context>
expectedValue == "true", config.aggregationSpillEnabled());
}},
+ {.veloxConfigKey = core::QueryConfig::kMaxSpillBytes,
+ .sessionPropertyKey = std::make_optional<std::string>(
+ SessionProperties::kMaxSpillBytes),
+ .systemConfigKey = std::string(SystemConfig::kMaxSpillBytes),
+ .sessionValue = "214748364800",
+ .differentSessionValue = "107374182400",
+ .validator =
+ [](const core::QueryConfig& config,
+ const std::string& expectedValue) {
+ EXPECT_EQ(
+ std::stoull(expectedValue), config.maxSpillBytes());
+ }},
+
</code_context>
<issue_to_address>
**suggestion (testing):** Consider adding a test that explicitly verifies the default maxSpillBytes when neither session nor system configs are set
You already cover system-only and session-overrides-system cases. To avoid regressions, please also add coverage for when neither `SystemConfig::kMaxSpillBytes` nor `SessionProperties::kMaxSpillBytes` is set (either via a new test or an extra assertion). That test should assert that the default (the 100GB hardcoded limit) is still used and not altered by this mapping.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| {.veloxConfigKey = core::QueryConfig::kMaxSpillBytes, | ||
| .sessionPropertyKey = std::make_optional<std::string>( | ||
| SessionProperties::kMaxSpillBytes), | ||
| .systemConfigKey = std::string(SystemConfig::kMaxSpillBytes), | ||
| .sessionValue = "214748364800", | ||
| .differentSessionValue = "107374182400", | ||
| .validator = | ||
| [](const core::QueryConfig& config, | ||
| const std::string& expectedValue) { | ||
| EXPECT_EQ( |
There was a problem hiding this comment.
suggestion (testing): Consider adding a test that explicitly verifies the default maxSpillBytes when neither session nor system configs are set
You already cover system-only and session-overrides-system cases. To avoid regressions, please also add coverage for when neither SystemConfig::kMaxSpillBytes nor SessionProperties::kMaxSpillBytes is set (either via a new test or an extra assertion). That test should assert that the default (the 100GB hardcoded limit) is still used and not altered by this mapping.
e1b989f to
c6acc08
Compare
prestodb#27132) Summary: max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Differential Revision: D93147231
prestodb#27132) Summary: max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Differential Revision: D93147231
c6acc08 to
1bc55ec
Compare
prestodb#27132) Summary: Pull Request resolved: prestodb#27132 max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Differential Revision: D93147231
1bc55ec to
4e91ff4
Compare
prestodb#27132) Summary: max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Reviewed By: tanjialiang Differential Revision: D93147231
4e91ff4 to
79956be
Compare
prestodb#27132) Summary: max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Reviewed By: tanjialiang Differential Revision: D93147231
79956be to
7fe7dd7
Compare
prestodb#27132) Summary: Pull Request resolved: prestodb#27132 max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Reviewed By: tanjialiang Differential Revision: D93147231
7fe7dd7 to
464f060
Compare
prestodb#27132) Summary: max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs(). this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions. # Release Notes ``` == NO RELEASE NOTE == ``` Differential Revision: D93147231 ## Summary by Sourcery Propagate the max spill bytes system configuration into the Velox query config and extend tests to cover this mapping. Bug Fixes: - Ensure the configured max spill bytes value is honored instead of always using the hardcoded default spill limit. Tests: - Add and update query config mapping tests to validate propagation of max spill bytes from system configs and session properties.
Summary:
max-spill-bytes from config.properties was not propagated to velox QueryConfig because it was missing from veloxToPrestoConfigMapping in updateFromSystemConfigs().
this caused queries to always use the hardcoded 100GB default spill limit regardless of the configured value, resulting in spurious "local spill limit exceeded" exceptions.
Release Notes
Differential Revision: D93147231
Summary by Sourcery
Propagate the max spill bytes system configuration into the Velox query config and extend tests to cover this mapping.
Bug Fixes:
Tests: