Skip to content

[feature](file-cache) Separate file cache control for OLAP tables and external catalogs#60583

Open
wenzhenghu wants to merge 2 commits intoapache:masterfrom
wenzhenghu:refactor_datacache_session_switchvar
Open

[feature](file-cache) Separate file cache control for OLAP tables and external catalogs#60583
wenzhenghu wants to merge 2 commits intoapache:masterfrom
wenzhenghu:refactor_datacache_session_switchvar

Conversation

@wenzhenghu
Copy link
Contributor

… external catalogs

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

_read_context->runtime_state->query_options().enable_file_cache;
_read_options.io_ctx.is_disposable =
_read_context->runtime_state->query_options().disable_file_cache;
_read_context->runtime_state->query_options().enable_file_cache_olap_tables;
Copy link
Contributor

Choose a reason for hiding this comment

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

When cache is enable, it is disposable? Originally, it is disposable when cache is disable?

@dataroaring
Copy link
Contributor

Code review

Found 2 issues:

  1. Inverted is_disposable logic in beta_rowset_reader.cpp -- Missing ! negation. The old code was is_disposable = disable_file_cache, so when cache is disabled, data is disposable (correct). The new code is is_disposable = enable_file_cache_olap_tables, which marks data as disposable when cache is enabled (wrong). Should be !enable_file_cache_olap_tables, consistent with how file_scanner.cpp handles the same pattern.

_read_options.io_ctx.query_id = &_read_context->runtime_state->query_id();
_read_options.io_ctx.is_disposable =
_read_context->runtime_state->query_options().enable_file_cache_olap_tables;
}

  1. Wrong variable used in file_scanner.cpp -- FileScanner is used for external catalog scans (Hive, S3, etc.), but line 172 uses enable_file_cache_olap_tables instead of enable_file_cache_external_catalogs. Line 1815 in the same file correctly uses enable_file_cache_external_catalogs, confirming the variable at line 172 should match. This defeats the purpose of separating OLAP vs external catalog cache control.

_io_ctx->file_reader_stats = _file_reader_stats.get();
_io_ctx->is_disposable = !_state->query_options().enable_file_cache_olap_tables;

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants