Skip to content

table level warmup dev#62501

Draft
bobhan1 wants to merge 14 commits intoapache:masterfrom
bobhan1:passive-warmup-table-dev
Draft

table level warmup dev#62501
bobhan1 wants to merge 14 commits intoapache:masterfrom
bobhan1:passive-warmup-table-dev

Conversation

@bobhan1
Copy link
Copy Markdown
Contributor

@bobhan1 bobhan1 commented Apr 15, 2026

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
Copy Markdown
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?

bobhan1 and others added 14 commits April 15, 2026 12:16
Add support for table-level filtering in event-driven warmup jobs via
ON TABLES (INCLUDE/EXCLUDE 'glob_pattern') SQL syntax. This allows
users to selectively warm up only specific tables matching glob patterns
instead of warming up all tables in a cluster.

Changes:
- FE: Add OnTablesFilter class with glob-to-regex compilation,
  INCLUDE/EXCLUDE semantics, and shouldWarmUp() method
- FE: Extend ANTLR grammar with onTablesClause and INCLUDE token
- FE: Extend CloudWarmUpJob with table filter persistence, canonical
  JSON representation, and dynamic table ID resolution
- FE: Extend CacheHotspotManager with table filter dedup (JobKey),
  resolveTableIds(), and periodic refreshAllTableFilters()
- FE: Add TableFilter and MatchedTables columns to ShowWarmUpCommand
- BE: Add EventDrivenJobFilter type alias with per-job table_id
  filtering in get_replica_info()
- BE: Pass table_id from tablet level through commit_rowset() to
  warm_up_rowset() instead of extracting from rs_meta
- Thrift: Add optional table_ids field to TWarmUpTabletsRequest
- Tests: Add FE tests (OnTablesFilterTest, CloudWarmUpJobTableFilterTest)
  and BE tests (CloudWarmUpManagerFilterTest)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ble_ids handling

- FE: Move refreshAllTableFilters() from JobDaemon into a new
  TableFilterRefreshDaemon with its own configurable interval
  (cloud_warm_up_table_filter_refresh_interval_ms, default 60s)
- FE: Always send table_ids when hasTableFilter() is true, even if empty
- BE: When table_ids is non-null but empty, set empty filter set (warm up
  nothing) instead of nullopt (warm up everything). This correctly handles
  the scenario where all matched tables have been deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrite OnTablesFilterTest: remove redundancy, consolidate into 10
  focused tests covering glob wildcards, INCLUDE/EXCLUDE semantics,
  regex metachar escaping, complex multi-db scenarios
- Rewrite CloudWarmUpJobTableFilterTest: 12 tests covering canonicalize(),
  rebuildOnTablesFilter(), hasTableFilter(), getJobInfo(), Builder validation
- Add WarmUpClusterOnTablesParseTest: 10 tests verifying ON TABLES grammar
  parsing (single/multiple rules, FORCE, COMPUTE GROUP), syntax errors
  (empty parens, missing parens, missing pattern), and parsed field values
- Use Mockito (not JMockit) for ConnectContext mocking

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrite CloudWarmUpJobTableFilterTest (13 tests): add SHOW WARM UP JOB
  column verification (all 15 columns), matched tables string output,
  dynamic table ID tracking (create/drop/rename scenarios)
- Create CacheHotspotManagerTableFilterTest (13 tests): test resolveTableIds
  with mocked Env/InternalCatalog, dynamic table changes (new table, drop,
  rename), refreshAllTableFilters with running jobs, cluster-level job skip
- Fix unused import in OnTablesFilterTest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…atchedTables

- Make tableFilterExpr transient (not persisted), computed from
  tableFilterRules via canonicalize() as single source of truth
- Add computeTableFilterExpr() helper, called in constructor and
  rebuildOnTablesFilter()
- Remove setTableFilterExpr() from Builder
- Change currentTableIds from Set<Long> to Map<Long, String> mapping
  table ID to 'db.table' qualified name
- Update getMatchedTablesString() to show sorted db.table names
  (e.g., 'ods.orders, ods.products') instead of numeric IDs
- Update resolveTableIds() in CacheHotspotManager to return
  Map<Long, String> and update all callers
- Add 3 new tests, update all existing tests for new API

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bobhan1 bobhan1 force-pushed the passive-warmup-table-dev branch from df24c66 to 431bbcd Compare April 15, 2026 04:17
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