You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2024. It is now read-only.
As we all know, a namespace bundle may contain lots of partitions belonging to different topics.
The throughput of these topics may vary greatly. Some topics may with very high rate/throughput while other topics have a very low rate/throughput.
These partitions with high rate/throughput can cause broker overload and bundle unloading.
At this point, if we split bundle manually with range_equally_divide or topic_count_equally_divide split algorithm, there may need many times split before these high rate/through partitions assigned to different new bundles.
For convenience, we call these high throughput topics outstanding topic and their partitions outstanding partition in this PIP.
Goal
Our goal is to make it easier to split outstanding partition into new bundles.
There are two alternative ways to achieve this. Either of them will add a new algorithm for bundle split. The difference is how the new bundle split algorithm is implemented.
One algorithm is to split bundle by outstanding topic which will split the bundle into two new bundles and each new bundle contains an equally outstanding partition once a time.
E.g, a bundle contains lots of topic partitions, and only one outstanding topic(T) with 2 outstanding partition (T-partition-n, Tpartition-n+1). This algorithm split this bundle at the middle point of these two partition's hashcode. This algorithm has a disadvantage, it can only deal with one outstanding topic.
So we raised up another algorithm.
The other algorithm is to split the bundle at the hashcode point of the outstanding partition which will split the bundle into three bundles once a time. The middle one contains the only point the hashcode of the outstanding partition, the left one is less than the hashcode, the right one is more than the hashcode. E.g. if we have a bundle 0x00_0x10 contains two outstanding partition` (partition-x and partition-y) whose hashcode is 0x03 and 0x07, this algorithm is going to split bundle the bundle into five new bundles, 0x00_0x03, 0x03_0x04( for parition-x), 0x04_0x07, 0x07_0x08( for partition-y), 0x08_0x10.
API Changes
The Admin CLI bin/pulsar-admin namespaces split-bundle -b ${bundle_range} will add a new parameter "--topic" or "-t" for outstanding topic name.
sijie
changed the title
ISSUE-13761: Support split paritions belonging to specified topic in a bundle
ISSUE-13761: [PIP-143] Support split paritions belonging to specified topics in a bundle
Feb 17, 2022
Original Issue: apache#13761
Motivation
As we all know, a namespace bundle may contain lots of partitions belonging to different topics.
The throughput of these topics may vary greatly. Some topics may with very high rate/throughput while other topics have a very low rate/throughput.
These partitions with high rate/throughput can cause broker overload and bundle unloading.
At this point, if we split bundle manually with
range_equally_divide
ortopic_count_equally_divide
split algorithm, there may need many times split before these high rate/through partitions assigned to different new bundles.For convenience, we call these high throughput topics
outstanding topic
and their partitionsoutstanding partition
in this PIP.Goal
Our goal is to make it easier to split
outstanding partition
into new bundles.There are two alternative ways to achieve this. Either of them will add a new algorithm for bundle split. The difference is how the new bundle split algorithm is implemented.
One algorithm is to split bundle by
outstanding topic
which will split the bundle into two new bundles and each new bundle contains an equallyoutstanding partition
once a time.E.g, a bundle contains lots of topic partitions, and only one
outstanding topic
(T) with 2outstanding partition
(T-partition-n, Tpartition-n+1). This algorithm split this bundle at the middle point of these two partition's hashcode. This algorithm has a disadvantage, it can only deal with oneoutstanding topic
.So we raised up another algorithm.
The other algorithm is to split the bundle at the hashcode point of the
outstanding partition
which will split the bundle into three bundles once a time. The middle one contains the only point the hashcode of theoutstanding partition, the left one is less than the hashcode, the right one is more than the hashcode. E.g. if we have a bundle 0x00_0x10 contains two
outstanding partition` (partition-x and partition-y) whose hashcode is 0x03 and 0x07, this algorithm is going to split bundle the bundle into five new bundles, 0x00_0x03, 0x03_0x04( for parition-x), 0x04_0x07, 0x07_0x08( for partition-y), 0x08_0x10.API Changes
The Admin CLI
bin/pulsar-admin namespaces split-bundle -b ${bundle_range}
will add a new parameter "--topic" or "-t" foroutstanding topic
name.The split interface changed from
to
Implementation
There are changes both from the Admin CLI and the broker side.
First, Admin CLI for split bundle should support to specify the
outstanding topic
,And for the broker side, first encapsulates the parameters for bundle split into a new class
BundleSplitOption
add a new split algorithm
add the new algorithm to
NamespaceBundleSplitAlgorithm
modify the
splitAndOwnBundle
andsplitAndOwnBundleOnceAndRetry
for [NamespaceService.java](https://github.com/apache/pulsar/pull/13796/files#diff-99867fd2e328e0a689daa8f60d174aa96d87dd0d0fd29b9e68fe2e1f377b55a1)Also, we change the REST api and broker.conf
The text was updated successfully, but these errors were encountered: