Skip to content

[lake] Tolerate Paimon lake table existent with different insignificant options#1995

Merged
luoyuxia merged 1 commit into
apache:mainfrom
LiebingYu:lake-paimon-options
Nov 19, 2025
Merged

[lake] Tolerate Paimon lake table existent with different insignificant options#1995
luoyuxia merged 1 commit into
apache:mainfrom
LiebingYu:lake-paimon-options

Conversation

@LiebingYu
Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #1994

Brief change log

Tests

API and Format

Documentation

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements tolerance for Paimon lake tables that exist with different insignificant options, addressing issue #1994. The main goal is to allow Fluss to work with existing Paimon tables that have additional options set, as long as those options don't conflict with Fluss-managed settings.

Key Changes

  • Introduced new validation logic that distinguishes between "changeable" (insignificant) and "unchangeable" options when comparing existing Paimon tables with new Fluss table schemas
  • Added authorization checks to internal-only TabletService methods to ensure they can only be called by the Coordinator
  • Refactored schema validation code from PaimonLakeCatalog into a new dedicated utility class PaimonTableValidation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
fluss-server/src/main/java/org/apache/fluss/server/tablet/TabletService.java Added authorization checks to 6 internal-only RPC methods (notifyLeaderAndIsr, updateMetadata, stopReplica, notifyRemoteLogOffsets, notifyKvSnapshotOffset, notifyLakeTableOffset) to prevent external invocation
fluss-lake/fluss-lake-paimon/src/main/java/org/apache/fluss/lake/paimon/utils/PaimonTableValidation.java New utility class for validating Paimon schema compatibility; extracts Paimon config options via reflection and implements logic to filter out changeable options when comparing schemas
fluss-lake/fluss-lake-paimon/src/main/java/org/apache/fluss/lake/paimon/PaimonLakeCatalog.java Refactored to delegate schema validation to PaimonTableValidation; removed inline validation methods and unnecessary imports
fluss-lake/fluss-lake-paimon/src/test/java/org/apache/fluss/lake/paimon/LakeEnabledTableCreateITCase.java Added comprehensive test cases to verify the new option tolerance behavior, including tests for insignificant options, Fluss options, and Paimon options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@LiebingYu Thanks for your pr. Left minor comment. PTAL

Comment thread fluss-server/src/main/java/org/apache/fluss/server/tablet/TabletService.java Outdated
removeChangeableOptions(newOptions);

// ignore the existing options that are not in new options
existingOptions.entrySet().removeIf(entry -> !newOptions.containsKey(entry.getKey()));
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.

why need this line code? Could you please give me an example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For example, the data lake manager may add a default value for snapshot.num-retained.min.

  1. user create a Fluss table with lake enable, say t1, Fluss will call Paimon catalog to create a Paimon table with snapshot.num-retained.min = 2;
  2. user drop Fluss table t1, the Paimon table should still exist;
  3. user create t1 with same DDL again (no paimon.snapshot.num-retained.min option), we can ignore snapshot.num-retained.min here, let it keep the default value filled by the first creation.

SchemaChange schemaChange3 = SchemaChange.setOption("fluss.k1", "v1");
paimonCatalog.alterTable(paimonTablePath, Collections.singletonList(schemaChange3), false);

// add a new Paimon option (not specified in the Fluss table) to Paimon table will be ok
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.

shouldn't modify a Paimon option also throw exception? Imagine you modify the partition bucket key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These lines only change the fluss.k1 back to v1. Otherwise the following code cannot work.

@luoyuxia luoyuxia merged commit 3f8797c into apache:main Nov 19, 2025
5 checks passed
Ugbot pushed a commit to Ugbot/fluss that referenced this pull request Apr 26, 2026
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.

[lake] Paimon tables support compatibility when non-critical options are different

3 participants