Skip to content

feat(native): Add config for asyc cache flush threshold#27171

Merged
kewang1024 merged 1 commit intoprestodb:masterfrom
kewang1024:add-config
Feb 19, 2026
Merged

feat(native): Add config for asyc cache flush threshold#27171
kewang1024 merged 1 commit intoprestodb:masterfrom
kewang1024:add-config

Conversation

@kewang1024
Copy link
Copy Markdown
Collaborator

@kewang1024 kewang1024 commented Feb 19, 2026

== NO RELEASE NOTE ==

Summary by Sourcery

Add configuration support for an async cache SSD flush size threshold and wire it through to the async cache initialization.

New Features:

  • Introduce a configurable async cache SSD flush threshold in bytes with a default of 0 (disabled).

Tests:

  • Add unit coverage for the async cache SSD flush threshold configuration default and custom values.

@kewang1024 kewang1024 requested review from a team as code owners February 19, 2026 09:16
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Feb 19, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Feb 19, 2026

Reviewer's Guide

Adds a new system configuration option async-cache-ssd-flush-threshold-bytes (default 0) to control when the async SSD cache triggers a flush, wires it through SystemConfig into PrestoServer’s AsyncDataCache creation, and adds a unit test to validate default and override behavior.

Sequence diagram for async SSD cache flush threshold configuration

sequenceDiagram
    participant PrestoServer
    participant SystemConfig
    participant AsyncDataCache

    PrestoServer->>SystemConfig: asyncCacheNumShards()
    SystemConfig-->>PrestoServer: numShards

    PrestoServer->>SystemConfig: asyncCacheSsdFlushThresholdBytes()
    SystemConfig-->>PrestoServer: flushThresholdBytes

    PrestoServer->>AsyncDataCache: create(allocator, ssdCache, numShards, flushThresholdBytes)
    AsyncDataCache-->>PrestoServer: asyncDataCacheInstance
Loading

Updated class diagram for SystemConfig and AsyncDataCache wiring

classDiagram
    class ConfigBase

    class SystemConfig {
        +static kAsyncCacheSsdFlushThresholdBytes : string_view
        +asyncCacheSsdFlushThresholdBytes() uint64_t
    }

    class PrestoServer {
        +initializeVeloxMemory() void
    }

    class AsyncDataCache {
        +create(allocator, ssdCache, config) AsyncDataCache
    }

    SystemConfig --|> ConfigBase
    PrestoServer --> SystemConfig : reads_config
    PrestoServer --> AsyncDataCache : creates_with_flush_threshold
Loading

File-Level Changes

Change Details Files
Introduce new async cache SSD flush threshold config key with default value and accessor on SystemConfig.
  • Add kAsyncCacheSsdFlushThresholdBytes constant with documentation to SystemConfig.
  • Register the new property in SystemConfig constructor with numeric default value 0.
  • Implement asyncCacheSsdFlushThresholdBytes() accessor returning a uint64_t property.
presto-native-execution/presto_cpp/main/common/Configs.h
presto-native-execution/presto_cpp/main/common/Configs.cpp
Propagate the new flush threshold config into async cache initialization.
  • Extend the AsyncDataCache configuration struct/argument list in PrestoServer::initializeVeloxMemory to include the new flush threshold value from SystemConfig.
presto-native-execution/presto_cpp/main/PrestoServer.cpp
Add unit test coverage for the new SSD flush threshold configuration.
  • Add a ConfigTest that asserts the default threshold is 0 and that a custom value (e.g., 134217728) is honored via init().
presto-native-execution/presto_cpp/main/common/tests/ConfigTest.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kewang1024 kewang1024 requested a review from xiaoxmeng February 19, 2026 19:47
@kewang1024 kewang1024 merged commit 151cc8c into prestodb:master Feb 19, 2026
84 of 86 checks passed
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.

3 participants