Skip to content

[lake/paimon] Prevent concurrent local lookup false misses - #4158

Merged
luoyuxia merged 2 commits into
apache:mainfrom
luoyuxia:fix-paimon-concurrent-local-lookups
Sep 1, 2026
Merged

[lake/paimon] Prevent concurrent local lookup false misses#4158
luoyuxia merged 2 commits into
apache:mainfrom
luoyuxia:fix-paimon-concurrent-local-lookups

Conversation

@luoyuxia

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: apache/paimon#9483

Paimon 2.0 allows lookups for different partition-buckets to run concurrently, but their local lookup-store readers share a comparator with mutable reader state. Concurrent lookups against different files can therefore return null for existing keys.

This PR adds a Fluss-side correctness workaround while the problem is addressed upstream. Calls to one LocalTableQuery are serialized, including the retry after refreshing stale files. Consequently, a cache hit waits while another lookup on the same table is downloading a local lookup file.

Brief change log

  • Serialize calls to LocalTableQuery.lookup with a dedicated per-lookuper lock.
  • Add a regression test that submits cold-cache lookups for two different partitions concurrently.
  • Update the compaction and snapshot-expiration test so it no longer assumes that a cache hit bypasses an in-progress lookup-file download.

Tests

  • ./mvnw -pl fluss-lake/fluss-lake-paimon -Dtest=PaimonLakeTableLookuperTest test
    • 11 tests passed.
    • Checkstyle reported 0 violations.
    • Spotless check passed.
  • ./mvnw install -DskipTests -pl fluss-lake/fluss-lake-paimon -am

API and Format

No API or storage format changes.

Documentation

No documentation changes. This is a correctness workaround for an upstream concurrency issue.

Serialize access to Paimon 2.0 LocalTableQuery because lookup store readers share mutable comparator state across files. Add a concurrent cold-cache regression test for distinct partitions.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-5
AI-Contributed/Feature: 21/21
AI-Contributed/UT: 126/126
@luoyuxia
luoyuxia marked this pull request as ready for review August 31, 2026 12:25
Link the upstream Paimon concurrency bug and record the Fluss-side LocalTableQuery fallback for restoring concurrent lookups.

Co-Authored-By: Codex <noreply@openai.com>

AI-Model: gpt-5
AI-Contributed/Feature: 4/4
AI-Contributed/UT: 0/0

@zuston zuston left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @luoyuxia

LGTM. Let’s prioritize correctness first, then address the upstream issue in follow-up PRs.

@luoyuxia
luoyuxia merged commit f1c04b6 into apache:main Sep 1, 2026
9 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