Skip to content

feat(storage): make the per-warehouse catalog cache bounds configurable - #9555

Merged
mengw15 merged 2 commits into
apache:mainfrom
mengw15:feat/8995-catalog-cache-config
Nov 23, 2026
Merged

mengw15 merged 2 commits into
apache:mainfrom
mengw15:feat/8995-catalog-cache-config

Conversation

@mengw15

@mengw15 mengw15 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The JVM services cache Iceberg catalog clients one per warehouse, bounded at 64 entries and a 60-minute idle expiry (#7539). Both bounds were hardcoded; they now come from storage.conf, overridable with STORAGE_ICEBERG_CATALOG_CACHE_MAX_SIZE and STORAGE_ICEBERG_CATALOG_CACHE_IDLE_EXPIRY_MINUTES. The defaults are unchanged, and a value below 1 is refused at startup. The Python worker keeps its own catalogs and does not read these.

A computing unit touches the few warehouses of the executions it runs, but result-service reads every user's results, so its deployment may need a larger bound. Past the bound nothing fails: the least recently used client is dropped and rebuilt on its next use, at the cost of a round trip to Lakekeeper.

Any related issues, documentation, discussions?

Part of #8995. Follows #7539, which bounded the cache.

How was this PR tested?

A new StorageConfigSpec case pins both defaults, so a renamed key or a changed default fails it; raising a default turned it red. Another refuses 0 and -1 with a message naming the variable. IcebergCatalogInstanceSpec passes unchanged, and scalafmt and scalafix pass for Config and WorkflowCore.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-5-5)

The catalog cache's size bound and idle expiry now come from storage.conf
and can be overridden per deployment; the defaults are unchanged.
result-service reads every user's results, so it touches far more
warehouses than a computing unit does.
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @zyratlo
    You can notify them by mentioning @zyratlo in a comment.

@mengw15
mengw15 requested review from kunwp1 and a balanced review from Copilot November 19, 2026 21:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the Iceberg catalog cache configuration change.

No open issues 🎉

What changed in this PR

Makes the per-warehouse Iceberg catalog cache configurable so deployments such as result-service can accommodate more warehouses. The defaults remain 64 entries and a 60-minute idle expiry.

Changes:

  • Adds cache settings in storage.conf, with environment-variable overrides.
  • Wires the configured bounds into IcebergCatalogInstance.
  • Adds a test asserting the defaults when neither environment override is set.
File Description
common/​workflow-core/​src/​main/​scala/​org/​apache/​texera/​amber/​core/​storage/​IcebergCatalogInstance.scala Uses configured cache size and idle expiry instead of hardcoded values.
common/​config/​src/​test/​scala/​org/​apache/​texera/​common/​config/​StorageConfigSpec.scala Adds assertions for the unchanged cache defaults.
common/​config/​src/​main/​scala/​org/​apache/​texera/​common/​config/​StorageConfig.scala Exposes both cache settings as typed configuration values.
common/​config/​src/​main/​resources/​storage.conf Defines defaults and environment overrides, with deployment guidance.

Review effort: Balanced

@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.68%. Comparing base (4db10cf) to head (df9aec4).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9555      +/-   ##
============================================
+ Coverage     91.57%   91.68%   +0.11%     
+ Complexity     5159     5136      -23     
============================================
  Files          1300     1302       +2     
  Lines         58092    58153      +61     
  Branches       7615     7584      -31     
============================================
+ Hits          53198    53318     +120     
+ Misses         2958     2925      -33     
+ Partials       1936     1910      -26     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from 333eafe
amber 85.77% <100.00%> (+0.32%) ⬆️
computing-unit-managing-service 63.83% <ø> (-0.05%) ⬇️
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.45% <ø> (ø) Carriedforward from 333eafe
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.38% <ø> (ø) Carriedforward from 333eafe
result-service 85.71% <ø> (ø)
workflow-compiling-service 78.30% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 4 worse · ⚪ 9 noise (<±5%) · 0 without baseline

Compared against main 4db10cf benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 580 0.354 16,700/23,188/23,188 us 🟢 -10.1% / 🔴 +69.3%
🔴 bs=100 sw=10 sl=64 1,233 0.752 77,851/125,949/125,949 us 🔴 +33.6% / 🔴 +45.3%
🔴 bs=1000 sw=10 sl=64 1,438 0.878 692,927/804,998/804,998 us 🔴 +7.0% / 🟢 -10.8%
Baseline details

Latest main 4db10cf from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 580 tuples/sec 576 tuples/sec 1,018 tuples/sec +0.7% -43.1%
bs=10 sw=10 sl=64 MB/s 0.354 MB/s 0.352 MB/s 0.622 MB/s +0.6% -43.1%
bs=10 sw=10 sl=64 p50 16,700 us 16,295 us 10,127 us +2.5% +64.9%
bs=10 sw=10 sl=64 p95 23,188 us 25,795 us 13,693 us -10.1% +69.3%
bs=10 sw=10 sl=64 p99 23,188 us 25,795 us 16,105 us -10.1% +44.0%
bs=100 sw=10 sl=64 throughput 1,233 tuples/sec 1,275 tuples/sec 1,364 tuples/sec -3.3% -9.6%
bs=100 sw=10 sl=64 MB/s 0.752 MB/s 0.778 MB/s 0.832 MB/s -3.3% -9.7%
bs=100 sw=10 sl=64 p50 77,851 us 77,466 us 79,321 us +0.5% -1.9%
bs=100 sw=10 sl=64 p95 125,949 us 94,247 us 86,661 us +33.6% +45.3%
bs=100 sw=10 sl=64 p99 125,949 us 94,247 us 98,907 us +33.6% +27.3%
bs=1000 sw=10 sl=64 throughput 1,438 tuples/sec 1,450 tuples/sec 1,406 tuples/sec -0.8% +2.3%
bs=1000 sw=10 sl=64 MB/s 0.878 MB/s 0.885 MB/s 0.858 MB/s -0.8% +2.3%
bs=1000 sw=10 sl=64 p50 692,927 us 687,348 us 776,724 us +0.8% -10.8%
bs=1000 sw=10 sl=64 p95 804,998 us 752,415 us 814,345 us +7.0% -1.1%
bs=1000 sw=10 sl=64 p99 804,998 us 752,415 us 862,305 us +7.0% -6.6%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,344.80,200,128000,580,0.354,16700.31,23188.11,23188.11
1,100,10,64,20,1622.62,2000,1280000,1233,0.752,77850.87,125948.50,125948.50
2,1000,10,64,20,13909.77,20000,12800000,1438,0.878,692927.31,804997.80,804997.80

@kunwp1 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

0 would leak a catalog on every call and a negative value would fail
only at the first catalog access, so both settings must be at least 1
and fail at load time naming the variable. The storage.conf comment now
says they bound the JVM services' cache only.
@mengw15
mengw15 added this pull request to the merge queue Nov 23, 2026
Merged via the queue into apache:main with commit a038371 Nov 23, 2026
39 checks passed
@mengw15
mengw15 deleted the feat/8995-catalog-cache-config branch November 23, 2026 20:28
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.

4 participants