Repository navigation
feat(storage): make the per-warehouse catalog cache bounds configurable - #9555
Conversation
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.
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
🟢 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 Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| 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.800 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.
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 withSTORAGE_ICEBERG_CATALOG_CACHE_MAX_SIZEandSTORAGE_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
StorageConfigSpeccase 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.IcebergCatalogInstanceSpecpasses 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)