Skip to content

[server] Support altering auto partition num-precreate option#3434

Merged
luoyuxia merged 1 commit into
apache:mainfrom
fhan688:Support-altering-auto-partition-precreate-option
Jun 9, 2026
Merged

[server] Support altering auto partition num-precreate option#3434
luoyuxia merged 1 commit into
apache:mainfrom
fhan688:Support-altering-auto-partition-precreate-option

Conversation

@fhan688

@fhan688 fhan688 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: #3351

This PR allows table.auto-partition.num-precreate to be altered dynamically after table creation.

Before this change, auto partition retention could be updated by ALTER TABLE, but table.auto-partition.num-precreate was rejected by alter table validation. This PR enables users to increase or decrease the number of pre-
created auto partitions without recreating the table.

Brief change log

  • Add table.auto-partition.num-precreate to alterable Fluss table options.
  • Refresh AutoPartitionManager when either num-retention or num-precreate changes.
  • When num-precreate is increased, missing future partitions are created after the table property change is observed.
  • When num-precreate is decreased, existing pre-created partitions are kept, and future auto partition runs stop over-creating partitions.
  • Add server-side coverage for updating num-precreate.
  • Add Flink catalog IT coverage for ALTER TABLE SET/RESET ('table.auto-partition.num-precreate' ...).
  • Update docs for Flink DDL/options and partitioning behavior.

Tests

  • AutoPartitionManagerTest#testUpdateAutoPartitionNumPrecreate
  • Flink120CatalogITCase#testAlterAutoPartitionNumPrecreate
  • git diff --check

API and Format

This change does not modify RPC protocol, storage format, or serialized metadata format.

It expands the supported dynamic table property set by allowing table.auto-partition.num-precreate to be changed through ALTER TABLE SET and reset through ALTER TABLE RESET.

Documentation

Updated documentation:

  • website/docs/engine-flink/ddl.md
  • website/docs/engine-flink/options.md
  • website/docs/table-design/data-distribution/partitioning.md

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.num-precreate after table creation (via ALTER TABLE ... SET/RESET), aligning server behavior, Flink catalog behavior, and documentation around auto-partition configuration updates.

Changes:

  • Allow table.auto-partition.num-precreate as an alterable Fluss table option.
  • Refresh AutoPartitionManager when either num-retention or num-precreate changes after an alter-table event.
  • Add/extend coverage (server unit test + Flink catalog IT) and update Flink/docs pages to document the new alter/reset capability.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/table-design/data-distribution/partitioning.md Documents that num-precreate (and num-retention) can be altered/reset after creation, and clarifies multi-partition-key constraint.
website/docs/engine-flink/options.md Updates connector options docs to note num-precreate/num-retention are modifiable via ALTER TABLE ... SET/RESET.
website/docs/engine-flink/ddl.md Lists num-precreate and num-retention among supported storage options for ALTER TABLE ... SET.
fluss-server/src/test/java/org/apache/fluss/server/coordinator/AutoPartitionManagerTest.java Adds unit test validating behavior when updating num-precreate up/down.
fluss-server/src/main/java/org/apache/fluss/server/coordinator/CoordinatorEventProcessor.java Triggers AutoPartitionManager refresh when num-precreate changes (in addition to num-retention).
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/catalog/FlinkCatalogITCase.java Adds IT coverage for altering and resetting table.auto-partition.num-precreate.
fluss-common/src/main/java/org/apache/fluss/config/FlussConfigUtils.java Adds table.auto-partition.num-precreate to the allowlist of alterable table options.

💡 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.

Thanks. LGTM

@luoyuxia luoyuxia merged commit 3067970 into apache:main Jun 9, 2026
8 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