Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-22403 CDC: Improve Kafka partition ranges assignment for appliers #272

Merged
merged 13 commits into from
Jul 10, 2024

Conversation

maksaska
Copy link
Contributor

@maksaska maksaska commented Jun 6, 2024

Distribution for partitions from kafka topic over requested threads in AbstractKafkaToIgniteCdcStreamer (CDC Kafka to Ignite) is not uniform.

There might be cases with unequal load on threads, that reads data from kafka, which might result in overhead/bottleneck and slow workflow in general for the whole CDC with Kafka process. The improved version takes that into account.

Initially, for uniform distribution to form, the streamer calculated the ratio between the number of partitions and the number of threads.It didn't take into account the modulus of the result, thus leading to underestimated number of partiotions one thread can take. The fixed version of the algorithm uses modulus to round up the underestimated number to pump up the load on the first threads. To make things work, the number of partitions taken by each thread is reevaulated for each thread, which allows to reduce the difference in parity and integral division in general. In other words, threads balance themself out while partitions are being distributed from the first thread to the last one.

Copy link
Contributor

@shishkovilja shishkovilja left a comment

Choose a reason for hiding this comment

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

@maksaska , please, fix code related to my comments.

@maksaska maksaska changed the title IGNITE-22403 Algorithm improvement for kafka topic partition distribution IGNITE-22403 CDC: Improve Kafka partition ranges assignment for appliers Jul 8, 2024
@NSAmelchev NSAmelchev merged commit 5bd39e8 into apache:master Jul 10, 2024
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