Skip to content

Support max partition number of a table #687

Closed

Description

@wuchong

Search before asking

  • I searched in the issues and found nothing similar.

Description

The suggested implementation steps:

  1. Introduce a cluster level config: max.partition.num: Limits the maximum number of partitions that can be created for a partitioned table to avoid creating too many partitions. Default 1000?
  2. Add TooManyPartitionsException in com.alibaba.fluss.exception which is an ApiException, and register to com.alibaba.fluss.rpc.protocol.Errors.
  3. Add the method getPartitionNumber(TablePath tablePath) in ZooKeeperClient. The implementation should use zkClient.checkExists().forPath(path) to get numChildren from org.apache.zookeeper.data.Stat, instead of listing all children.
  4. Checks the current partition number of this table is not exceed the configured max number in com.alibaba.fluss.server.coordinator.MetadataManager#createPartition. Otherwise, throws TooManyPartitionsException.
  5. com.alibaba.fluss.server.coordinator.AutoPartitionManager#createPartitions should catch TooManyPartitionsException to log warning.
  6. Add tests in FlussAdminITCase to verify the expected exception when create too many partitions.
  7. Add tests in AutoPartitionManagerTest to verify new partitions will not created if it reaches max number of partitions.

Willingness to contribute

  • I'm willing to submit a PR!

Activity

  1. caozhen1937 commented on Mar 31, 2025

    @caozhen1937
    Contributor

    Hi @wuchong ,I submited a PR #693 , please review it feel free.

  2. added this to the v0.7 milestone on Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions