Skip to content

Tombstone dry run with target DB in GCP (1st run) #26058

Closed

Description

@argush3

A preliminary prod dry run was done in #26013 but that was done with local source & target databases. The target database was also empty.

We would like to test the prod dry run with something closer to the actual migration.

This dry run will differ from the preliminary dry run in #26013 as follows:

  • Target LEAR DB will be hosted in GCP
  • Target LEAR DB will be created from latest prod LEAR db dump
  • Some tweaks and fixes applied based on findings from preliminary dry run

Tasks

Activity

  1. added
    Entities - Data Migration
    on Feb 20, 2025
  2. changed the title [-]Tombstone dry run with target DB in GCP[/-] [+]Tombstone dry run with target DB in GCP (1st run)[/+] on Mar 10, 2025
  3. self-assigned this
    on Mar 10, 2025
  4. argush3 commented on Mar 10, 2025

    @argush3
    ContributorAuthor

    FYI @vysakh-menon-aot @chenhongjing @leodube-aot @vishnup0422

    Summary

    A dry run of the production dataset was done with a setup similar to what the final migration looks like. The run took just over 24 hours and successfully migrated 634911 corps. Note that this run excluded TEDs as there were issues with these in the preliminary run and I just excluded them until some further investigation takes place.

    In general, I think we can increase the throughput more with some tweaks but this first run gives us an initial baseline.

    Tombstone pipeline setup

    • Locally hosted components
      • Source database(CPRD postgres extract)
      • Prefect server
    • Temp GCP target database(pre-populated from LEAR prod dump). Direct connection was used

    Specific Tombstone Run configs

    The configuration below is roughly what was used. During the runs, note that at various points, time between deployment intervals, max_worker sizes, pool size(# of concurrent flows allowed), batch sizes and etc were changed.

    Config when loading TINGs

    • Used ConcurrentTaskRunner with max_worker = 300
    • BATCH config in .env
      • TOMBSTONE_BATCHES=20
      • TOMBSTONE_BATCH_SIZE=25
    • worker pool set to allow 18 concurrent jobs/flows

    Config when loading all other corps

    • Used ConcurrentTaskRunner with max_worker = 100 & 300
    • BATCH config in .env
      • TOMBSTONE_BATCHES=20
      • TOMBSTONE_BATCH_SIZE=25
    • worker pool set to allow 10-12 concurrent jobs/flows

    Findings

    • The preliminary run is almost 2x faster which is somewhat expected due to the target db being in GCP. There are optimizations that I think can make that difference smaller.
    • There were failures and pending corp processing records that were a result of concurrency issues likely. Can delete these records and re-run it seems
    • There were failures in the corp processing table indicating that there is a duplicate in the target db. After some analysis, there were a few businesses that were probably concurrency related. In these cases, the businesses can be deleted from target db and reloaded just in case. But the bulk of the failed migration is due to the business really already existing in the LEAR target db before the migration happened. This is because the extract currently does not filter out new businesses that were originally created in LEAR and synced over to the COLIN db via the update colin filings job. There are also businesses that altered to BEN. We will address these in Tombstone pipeline - update extract script to exclude corps created in LEAR #26424 and Tombstone pipeline/investigate - Alteration from/to BEN Scenarios #26017.
    • The corps loaded in second half start decreasing in load times as less filings. As the second hafl was running overnight, there was a window where throughput was not maximized as there weren’t enough parallel flows running. There may be a more optimal batch config that can work well across different corps.
    • The target GCP db was actually able to handle the load quite well and most of the time wasn’t taxed much after reviewing the cloud sql performance metrics. Potentially can tweak the pipeline to put more load on the target db.
    • Load on GCP was mostly light except for when really hit it with a lot of workers during TINGs processing
    • ConcurrentTaskRunner configured with too many workers will result in connection issues with GCP target db if too many flows are running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities - Data Migration

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions