[server] Support altering auto partition num-precreate option#3434
Merged
luoyuxia merged 1 commit intoJun 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-precreateas an alterable Fluss table option. - Refresh
AutoPartitionManagerwhen eithernum-retentionornum-precreatechanges 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.
Contributor
Author
|
please help review, thanks! @luoyuxia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: #3351
This PR allows
table.auto-partition.num-precreateto be altered dynamically after table creation.Before this change, auto partition retention could be updated by
ALTER TABLE, buttable.auto-partition.num-precreatewas 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
table.auto-partition.num-precreateto alterable Fluss table options.AutoPartitionManagerwhen eithernum-retentionornum-precreatechanges.num-precreateis increased, missing future partitions are created after the table property change is observed.num-precreateis decreased, existing pre-created partitions are kept, and future auto partition runs stop over-creating partitions.num-precreate.ALTER TABLE SET/RESET ('table.auto-partition.num-precreate' ...).Tests
AutoPartitionManagerTest#testUpdateAutoPartitionNumPrecreateFlink120CatalogITCase#testAlterAutoPartitionNumPrecreategit diff --checkAPI 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-precreateto be changed throughALTER TABLE SETand reset throughALTER TABLE RESET.Documentation
Updated documentation:
website/docs/engine-flink/ddl.mdwebsite/docs/engine-flink/options.mdwebsite/docs/table-design/data-distribution/partitioning.md