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

Double the number of partitions #6375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gherceg
Copy link
Contributor

@gherceg gherceg commented Aug 22, 2024

This should help iterate over the backlog of repeat records faster. Rolling this out is a bit tricky since we want to avoid processing a repeat record simultaneously. A lock is held for each partition until the check_repeaters_in_partition task queues all records for that partition, so I think the safest way to do this is to revoke all check_repeaters tasks to prevent check_repeaters_in_partition tasks from being spawned, wait for all check_repeaters_in_partition tasks to finish, and then apply this change.

Environments Affected

Production

This should help iterate over the backlog of repeat records faster
Copy link
Contributor

@millerdev millerdev left a comment

Choose a reason for hiding this comment

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

I think the safest way to do this is to revoke all check_repeaters tasks to prevent check_repeaters_in_partition tasks from being spawned, wait for all check_repeaters_in_partition tasks to finish, and then apply this change.

Is that a straightforward set of steps? Is it possible to list out the commands that will be run to accomplish it?

@gherceg
Copy link
Contributor Author

gherceg commented Aug 22, 2024

Yeah reasonable request. So once the PR is merged, I would run the following:

cchq --control production update-config # updates localsettings
cchq production django-manage revoke_celery_tasks corehq.motech.repeaters.tasks.check_repeaters # revoke check_repeaters tasks to prevent check_repeaters_in_partition tasks from being spawned
cchq --control production service celery restart # settings change to take effect on celery workers
cchq production forward-port flower # monitor for check_repeaters_in_partition tasks
# once I don't see any more of those tasks (there are only 4 ever running at a time), kill the revoke_tasks command

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.

2 participants