Repository navigation
Description
We would like to do some investigation and experimentation around supporting larger migration batches. There is a good chance that we will need to migrate 10K+ businesses soon.
Up to this point, we have migrated at most 3K businesses in a given batch using one instance of the tombstone migration pipeline. We could probably continue doing this and brute force migrations of around the same size(3K - 5K). Anything beyond 5K+ will require a solution that provides more throughput.
Previously, when the plan was still a big bang migration, we had dry-runned all active businesses(auth data excluded) with multiple instances of the tombstone flow into a test copy of the business database in GCP in just over 24 hours. Reference #26058 for details. Note that performance will vary based on machine running the migration.
As a part of this ticket, we will want to revisit running multiple tombstone flows using prefect work pools and workers. Use the work done in #26058 as a base and determine if that setup still makes sense. We should look into a setup that can work for all developers if they need to do prod migrations of larger than 5K.
Tasks
- Review setup used in production dry run of all active corps(Tombstone dry run with target DB in GCP (1st run) #26058)
- Test out deploying and running multiple prefect flows against current tombstone pipeline using workpools + workers. Test locally first then against Dev or Test. Test migrating at least 10K businesses using the USE_MIGRATION_FILTER option. Note: we’ll assume we don’t need to migrate auth data for this ticket.
- The prefect flow deployment that supported multiple tombstone flows in Tombstone dry run with target DB in GCP (1st run) #26058 was achieved using the following code in corps_tombstone_flow.py. Can we continue using this? Do we still want to create the workpool via the prefect CLI?
- Detail findings after investigation work done to test out running multiple prefect tombstone flows migration at least 10K corps to Dev or Test.
- Cut tickets as required to operationalize running tombstone pipeline with multiple flows
Activity
argush3 commentedon Feb 5, 2026
Hey team! Please add your planning poker estimate with Zenhub @ketaki-deodhar @Rajandeep98
Rajandeep98 commentedon Feb 12, 2026
Prefect Setup:
3000
1 work pool created
10s apart - 3 flows
2936 corps - dev -
Local Setup
TOMBSTONE_BATCH_SIZE=20
TOMBSTONE_BATCHES=50
Initially reserved 1000 / so many workers started kept at 0 no activity for an hour stopped at 1048
1000 in 19 mins
Intervened and deleted from corp processing all the pending ones and it started fine but uneven on the workers arrangement. Some were running empty
32 PROCESSING at same time
Problem keeping all workers busy
Next Setup
3000
Max workers = 50
Max reserve batch size 50
Concurrency 10
TOMBSTONE_BATCHES=5
TOMBSTONE_BATCH_SIZE=100
Made some changes ran 10 concurrent flows reservation limit set to 3 times the batch size so that all workers stay busy
Completed in 7 mins
Next Setup
5000
Prefect Setup:
Max workers = 50
Max reserve batch size 50
Concurrency 10
TOMBSTONE_BATCHES=5
TOMBSTONE_BATCH_SIZE=100
Issue
Tabs 5 started crashed with 503
Migrated successfully but still in loop for scheduling the tasks
8 mins
Next Setup
Running with Auth
Max workers = 50
Max reserve batch size 50
Concurrency 10
TOMBSTONE_BATCHES=5
TOMBSTONE_BATCH_SIZE=100
7 mins
Issue: timeout flows
Updated
DATABASE_POOL_PRE_PING=True
DATABASE_POOL_SIZE=30
DATABASE_MAX_OVERFLOW=20
DATABASE_POOL_RECYCLE=3600
5k with auth processed in 14 mins
Next setup
10000
initial setup reservation taking 5-7 mins could be query bottlenecks: created Ticket: https://app.zenhub.com/workspaces/entities---data-migration-65af11a89e89f5043c2911f6/issues/gh/bcgov/entity/32427
Made schedule updates to 2 mins
Made schedule updates to 15 mins
3 hours run not uniform flows couldnt use more than 3 flows reservations took 15 mins for each flow with set between 10-1500