Skip to content

[core] Coalesce concurrent CachingCatalog table loads#7840

Merged
JingsongLi merged 1 commit into
apache:masterfrom
officialasishkumar:optimize-caching-catalog-get-table
May 13, 2026
Merged

[core] Coalesce concurrent CachingCatalog table loads#7840
JingsongLi merged 1 commit into
apache:masterfrom
officialasishkumar:optimize-caching-catalog-get-table

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Purpose

Fixes #7484.

CachingCatalog#getTable now uses Caffeine's atomic cache loading path for regular tables, so concurrent cache misses for the same identifier share one wrapped.getTable call. System tables continue to wrap the cached origin table instead of being cached directly.

Tests

  • mvn -pl paimon-core -Pfast-build -Dtest=CachingCatalogTest#testConcurrentGetTableLoadsTableOnce test
  • mvn -pl paimon-core -Pfast-build -Dtest=CachingCatalogTest test
  • mvn -pl paimon-core spotless:check

Copy link
Copy Markdown
Contributor

@leaves12138 leaves12138 left a comment

Choose a reason for hiding this comment

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

LGTM. The approach looks right: using Caffeine's atomic Cache.get(key, mappingFunction) coalesces concurrent misses per table identifier while preserving the existing system-table behavior (only the origin table is cached). Wrapping/unwrapping TableNotExistException keeps the public API semantics unchanged, and the added concurrent test covers the intended race.

@JingsongLi
Copy link
Copy Markdown
Contributor

+1

@JingsongLi JingsongLi merged commit 8fc7f0d into apache:master May 13, 2026
12 checks passed
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.

[Feature] Optimize CachingCatalog#getTable

3 participants