Skip to content

[common] Load index factories across classloader boundaries - #10991

Merged
JingsongLi merged 1 commit into
apache:masterfrom
sundapeng:fix/file-index-factory-classloader
Nov 6, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
sundapeng:fix/file-index-factory-classloader

Conversation

@sundapeng

@sundapeng sundapeng commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Purpose

Index factory registries can be initialized on a Flink JobMaster RPC thread whose context classloader cannot see Paimon's service files. Since #10850 deferred file-store validation until runtime initialization, this can prevent indexed tables from starting.

Discover factories with the interfaces' own classloader, then use the current context classloader on lookup misses so optional index providers in job JARs remain discoverable. Context-loaded providers are not cached globally, preserving job classloader isolation. Apply the same discovery behavior to load, file-index isRegistered, and global-index selectFiles.

The CSV dynamic-option test also needs to trigger a read before asserting deferred validation, following #10989.

Tests

  • Six classloader tests pass on JDK 8 and 11, covering blind initialization, child-only provider classes and SPI resources, late discovery, sibling-loader isolation, null context loaders, registration, and file selection.
  • Negative control against the previous PR head: both original blind-context tests pass; all four new child-provider tests fail without the fallback.
  • The classloader, file-index compatibility, and multivalue bitmap suites pass together on JDK 11 (12 tests), including Checkstyle and Spotless checks.
  • CsvSkipEmptyLinesTableTest passes on JDK 8 (4 tests).

@sundapeng sundapeng closed this Nov 5, 2026
@sundapeng sundapeng reopened this Nov 5, 2026
@sundapeng

sundapeng commented Nov 5, 2026 •

Copy link
Copy Markdown
Member Author

No description provided.

@sundapeng

sundapeng commented Nov 5, 2026 •

Copy link
Copy Markdown
Member Author

No description provided.

@sundapeng
sundapeng marked this pull request as draft November 5, 2026 07:55
@sundapeng

sundapeng commented Nov 5, 2026 •

Copy link
Copy Markdown
Member Author

No description provided.

Discover built-in index factories with the interface classloader so a
blind JobMaster context classloader cannot initialize an empty registry.
On a lookup miss, discover optional providers with the current context
classloader without retaining them in the static registry.

Cover child-only provider discovery after blind initialization, sibling
classloader isolation, registration checks, and global file selection.
Align the CSV dynamic-option test with deferred runtime validation;
the test-contract adjustment follows apache#10989.
@sundapeng
sundapeng force-pushed the fix/file-index-factory-classloader branch from fcd665d to 68eee8c Compare November 5, 2026 09:01
@sundapeng sundapeng changed the title [common] Load index factories with their own classloader [common] Load index factories across classloader boundaries Nov 5, 2026
@sundapeng
sundapeng marked this pull request as ready for review November 5, 2026 09:43

@JingsongLi JingsongLi 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.

+1

@JingsongLi
JingsongLi merged commit d7b521d into apache:master Nov 6, 2026
18 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.

2 participants