Skip to content

[Native] Add local-exchange.max-partition-buffer-size system config #25578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kagamiori
Copy link
Contributor

@kagamiori kagamiori commented Jul 18, 2025

Description

Expose the Velox max_local_exchange_partition_buffer_size query config as a system config local-exchange.max-partition-buffer-size to allow tuning.

Motivation and Context

Impact

Test Plan

Updated unit tests in BaseVeloxQueryConfigTest.cpp

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@kagamiori kagamiori requested a review from a team as a code owner July 18, 2025 19:38
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Jul 18, 2025
@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from ef1e4fc to a6f10f2 Compare July 18, 2025 19:40
@steveburnett
Copy link
Contributor

If this session property is being added to Prestissimo, then it should probably be added to the Presto C++ Session Properties documentation.

@kagamiori kagamiori changed the title [Native] Expose Velox max_local_exchange_partition_buffer_size query config to Prestissimo [Native] Make Velox max_local_exchange_partition_buffer_size Tunable via velox.property config file Jul 21, 2025
@kagamiori kagamiori changed the title [Native] Make Velox max_local_exchange_partition_buffer_size Tunable via velox.property config file [Native] Make Velox max_local_exchange_partition_buffer_size tunable through velox.property config file Jul 21, 2025
@kagamiori
Copy link
Contributor Author

If this session property is being added to Prestissimo, then it should probably be added to the Presto C++ Session Properties documentation.

Hi @steveburnett, this PR doesn't add max_local_exchange_partition_buffer_size as a session property. It makes this property tunable through the 'velox.properties' config file. I've updated the PR title and summary to be more accurate. (Please see bafb615 about the velox.properties config file.)

@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from a6f10f2 to 62a843a Compare July 22, 2025 00:16
@kagamiori kagamiori changed the title [Native] Make Velox max_local_exchange_partition_buffer_size tunable through velox.property config file [Native] Add local-exchange.max-partition-buffer-size system config Jul 22, 2025
@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from 62a843a to 8873891 Compare July 22, 2025 00:29
@kagamiori kagamiori requested review from steveburnett, elharo and a team as code owners July 22, 2025 00:29
@aditi-pandit
Copy link
Contributor

@kagamiori : We are generally not bringing new config from velox.properties these days and prefer to get from SystemConfig. Is it possible to do the same with this property as well ?

@kagamiori
Copy link
Contributor Author

kagamiori commented Jul 22, 2025

@kagamiori : We are generally not bringing new config from velox.properties these days and prefer to get from SystemConfig. Is it possible to do the same with this property as well ?

Hi @aditi-pandit, I've updated it as a system config instead of velox.properties according to @kewang1024's suggestion.

@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from 8873891 to 83043ba Compare July 22, 2025 17:13
aditi-pandit
aditi-pandit previously approved these changes Jul 22, 2025
Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kagamiori. Please get review from @steveburnett as well.

Copy link
Collaborator

@kewang1024 kewang1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for changing to using SystemConfig @kagamiori

@kagamiori
Copy link
Contributor Author

If this session property is being added to Prestissimo, then it should probably be added to the Presto C++ Session Properties documentation.

Hi @steveburnett, I've updated this PR to make the new config a system config, and updated the presto-docs/src/main/sphinx/presto_cpp/properties.rst file. Thank you for the suggestion!

Copy link
Collaborator

@kewang1024 kewang1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just took another look, since we're deprecating velox.properties and only use config.properties, we shouldn't use updateLoadedValues from BaseVeloxQueryConfig, instead we should use updateFromSystemConfigs

For testing, consider add an equivalent of BaseVeloxQueryConfigTest for SystemConfig

Comment on lines 1078 to 1080
{QueryConfig::kMaxLocalExchangePartitionBufferSize,
systemConfig->capacityPropertyAsBytesString(
SystemConfig::kMaxLocalExchangePartitionBufferSize)},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kewang1024, uint tests in QueryContextManagerTest.cpp only update session properties using protocol::SessionRepresentation. How should I add a test case that updates system config there?

@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from 83043ba to 9a4a97b Compare July 23, 2025 18:07
@@ -127,6 +127,8 @@ TEST_F(QueryContextManagerTest, defaultSessionProperties) {
queryConfig.spillWriteBufferSize(), defaultQC->spillWriteBufferSize());
EXPECT_EQ(
queryConfig.requestDataSizesMaxWaitSec(), defaultQC->requestDataSizesMaxWaitSec());
EXPECT_EQ(
queryConfig.maxLocalExchangePartitionBufferSize(), defaultQC->maxLocalExchangePartitionBufferSize());
}

TEST_F(QueryContextManagerTest, overridingSessionProperties) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the test on overriding session property

QueryContextManager will do the following

  • get base map<string, string> from BaseVeloxQueryConfig (which comes from velox.properties which we will deprecate)
  • update the session property value
  • updateFromSystemConfigs

@kagamiori kagamiori force-pushed the local_partition_buffer_size_config branch from 9a4a97b to 42ef635 Compare July 23, 2025 22:08
@kagamiori kagamiori requested a review from kewang1024 July 24, 2025 00:22
Copy link
Collaborator

@kewang1024 kewang1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! @kagamiori

@kagamiori
Copy link
Contributor Author

Hi @steveburnett, I've updated the document. Could you take another look? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:Meta PR from Meta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants