Skip to content

[server] Optimize auto drop partition perfomance#1047

Merged
luoyuxia merged 1 commit intoapache:mainfrom
LiebingYu:main
Jul 4, 2025
Merged

[server] Optimize auto drop partition perfomance#1047
luoyuxia merged 1 commit intoapache:mainfrom
LiebingYu:main

Conversation

@LiebingYu
Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #864

Brief change log

Tests

API and Format

Documentation

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 9, 2025

CLA assistant check
All committers have signed the CLA.

@wuchong
Copy link
Copy Markdown
Member

wuchong commented Jun 12, 2025

cc @swuferhong , could you help to review this?

Copy link
Copy Markdown
Contributor

@zcoo zcoo left a comment

Choose a reason for hiding this comment

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

LTGM. Only left a suggestion

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 refactors the partition-tracking data structure to improve drop/create performance and add support for tables with multiple partition keys, and updates tests accordingly.

  • Switches partitionsByTable from a TreeSet<String> to a TreeMap<String, Set<String>> to group partitions by their key values.
  • Adds extractAutoPartitionValue and addPartitionToPartitionsByTable helpers and updates doAutoPartition, createPartitions, and dropPartitions to use the new map structure.
  • Extends AutoPartitionManagerTest to cover multi-key partition tables and refactors TestParams/TestParamsBuilder to handle multiple created/dropped partitions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
fluss-server/src/main/java/com/alibaba/fluss/server/coordinator/AutoPartitionManager.java Refactored partitionsByTable structure and related methods (doAutoPartition, createPartitions, dropPartitions) to support multi-key partitions
fluss-server/src/test/java/com/alibaba/fluss/server/coordinator/AutoPartitionManagerTest.java Updated test harness to add multi-key partition scenarios and replaced single-value fields with arrays in TestParams and TestParamsBuilder

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.

@LB-Yu Thanks! LGTM

@luoyuxia luoyuxia merged commit 41cc414 into apache:main Jul 4, 2025
4 checks passed
drr00t pushed a commit to drr00t/fluss that referenced this pull request Jul 5, 2025
polyzos pushed a commit to polyzos/fluss that referenced this pull request Aug 30, 2025
polyzos pushed a commit to Alibaba-HZY/fluss that referenced this pull request Aug 31, 2025
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.

Optimize auto drop partition perfomance

6 participants