Skip to content

[Enhancement] only read iceberg cache when mv refresh and inesert select stmt#68942

Draft
Wenjun7J wants to merge 1 commit intoStarRocks:mainfrom
Wenjun7J:iceberg/mv_insert_only_read_cache
Draft

[Enhancement] only read iceberg cache when mv refresh and inesert select stmt#68942
Wenjun7J wants to merge 1 commit intoStarRocks:mainfrom
Wenjun7J:iceberg/mv_insert_only_read_cache

Conversation

@Wenjun7J
Copy link
Contributor

@Wenjun7J Wenjun7J commented Feb 5, 2026

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

Signed-off-by: SevenJ <wenjun7j@gmail.com>
@Wenjun7J Wenjun7J force-pushed the iceberg/mv_insert_only_read_cache branch from 0253fc6 to 59a8e0e Compare February 5, 2026 07:18
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

[FE Incremental Coverage Report]

pass : 6 / 6 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/qe/StmtExecutor.java 4 4 100.00% []
🔵 com/starrocks/qe/ConnectContext.java 2 2 100.00% []

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@alvin-celerdata
Copy link
Contributor

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59a8e0e420

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +527 to +531
if (bypassCache) {
scanContext.setOnlyReadCache(true);
scanContext.setDataFileCache(null);
scanContext.setDeleteFileCache(null);
} else {

Choose a reason for hiding this comment

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

P2 Badge Keep caches attached when only-read mode is set

When onlyReadIcebergCache is true you currently set both caches to null, which makes StarRocksIcebergTableScan.useCache() return false because it checks dataFileCache != null. That means MV refresh / INSERT‑SELECT will bypass existing manifest caches entirely instead of reading from them, and will re-scan manifests every time even if they were already cached. If the intent is “read cache but don’t populate/refresh,” you should keep the caches attached and rely on onlyReadCache (which is already honored in planTaskWithCache) to skip puts; otherwise this change silently disables the cache in exactly the paths it was meant to use.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants