Skip to content

[server] Support altering auto partition enabled option - #3453

Merged
luoyuxia merged 5 commits into
apache:mainfrom
fhan688:Support-altering-auto-partition-enabled
Jun 12, 2026
Merged

luoyuxia merged 5 commits into
apache:mainfrom
fhan688:Support-altering-auto-partition-enabled

Conversation

@fhan688

@fhan688 fhan688 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: #3353

Currently, table.auto-partition.enabled cannot be altered after table creation, while related auto-partition options such as table.auto-partition.num-retention already support dynamic updates.

This PR supports altering table.auto-partition.enabled so users can enable or disable auto partitioning for an existing partitioned table without recreating the table.

Brief change log

  • Add table.auto-partition.enabled to alterable table options.
  • Add value-based comparison for AutoPartitionStrategy so coordinator can detect full auto-partition strategy changes.
  • Update coordinator table-change handling to react to auto-partition strategy changes, instead of only checking retention changes.
  • Add AutoPartitionManager#handleAutoPartitionStrategyChange to handle:
    • disabled -> enabled: register the table and trigger immediate partition creation.
    • enabled -> disabled: remove the table from the auto-partition scheduler.
    • enabled -> enabled with strategy changes: refresh auto-partition table metadata.
  • Skip stale scheduled auto-partition tasks when the table has already been removed from the scheduler.
  • Add server and Flink SQL tests for altering table.auto-partition.enabled.

Tests

  • AutoPartitionManagerTest#testUpdateAutoPartitionEnabled
  • Flink120CatalogITCase#testAlterAutoPartitionEnabled
  • Flink120CatalogITCase#testAlterAutoPartitionRetention
  • Flink120CatalogITCase#testAlterTableConfig
  • git diff --check
  • spotless:apply

API and Format

No storage format or RPC format changes.

This changes user-visible table option behavior by making the existing table.auto-partition.enabled option alterable. No new Java public API is introduced.

Documentation

No new table option is introduced. This PR only makes the existing table.auto-partition.enabled option dynamically alterable.

Copilot AI 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.

Pull request overview

This PR enables dynamic alteration of table.auto-partition.enabled for existing partitioned tables, updating coordinator/auto-partition scheduling behavior to correctly react to full auto-partition strategy changes.

Changes:

  • Adds table.auto-partition.enabled to the set of alterable table options.
  • Implements value-based equals/hashCode for AutoPartitionStrategy and updates coordinator handling to react to any strategy change (enable/disable/strategy refresh).
  • Adds server-side and Flink SQL integration tests covering alter-enabled behavior and scheduler correctness.

Reviewed changes

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

Show a summary per file
File Description
fluss-server/src/test/java/org/apache/fluss/server/coordinator/AutoPartitionManagerTest.java Adds a unit test verifying disable→enable transitions stop/resume partition creation as expected.
fluss-server/src/main/java/org/apache/fluss/server/coordinator/CoordinatorEventProcessor.java Detects full auto-partition strategy changes and delegates to the new strategy-change handler.
fluss-server/src/main/java/org/apache/fluss/server/coordinator/AutoPartitionManager.java Introduces handleAutoPartitionStrategyChange and skips stale scheduled tasks for removed tables.
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/catalog/FlinkCatalogITCase.java Adds IT coverage for altering table.auto-partition.enabled and updates unsupported-alter expectations.
fluss-common/src/main/java/org/apache/fluss/utils/AutoPartitionStrategy.java Adds equals/hashCode/toString to enable value-based change detection and clearer logging.
fluss-common/src/main/java/org/apache/fluss/config/FlussConfigUtils.java Marks table.auto-partition.enabled as an alterable table option.

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

@fhan688

fhan688 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

please help review, thanks! @luoyuxia

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

@fhan688 Thanks. LGTM.

@luoyuxia
luoyuxia merged commit b6717fe into apache:main Jun 12, 2026
7 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.

3 participants