From 301d6ff616c1728aa40c0a5357e781eb59903c5b Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 27 Mar 2020 09:28:10 -0400 Subject: [PATCH] make the job event bigint migration chunk size configurable --- awx/main/tasks.py | 2 +- awx/settings/defaults.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index cdce0318e2..1f82b8ab92 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -692,7 +692,7 @@ def migrate_legacy_event_data(tblname): with advisory_lock(f'bigint_migration_{tblname}', wait=False) as acquired: if acquired is False: return - chunk = 1000000 + chunk = settings.JOB_EVENT_MIGRATION_CHUNK_SIZE def _remaining(): try: diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 6989090dbc..b254f70dde 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -197,6 +197,9 @@ JOB_EVENT_WORKERS = 4 # The maximum size of the job event worker queue before requests are blocked JOB_EVENT_MAX_QUEUE_SIZE = 10000 +# The number of job events to migrate per-transaction when moving from int -> bigint +JOB_EVENT_MIGRATION_CHUNK_SIZE = 1000000 + # Disallow sending session cookies over insecure connections SESSION_COOKIE_SECURE = True