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 Algorithm improvement for kafka topic partition distribution #272

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

maksaska
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant