Repository navigation
Description
As a part of the migration process, we need to manage the full and subset version of the COLIN extract up to the day of the migration.
Ideally, we would only need to use the subset COLIN extract to save time but for the time being we need to keep the full COLIN extract up to date as well for a number of reasons. If these constraints ever go away, we can just work with the subset which would be more efficient and save time. Some of the reasons include the following:
- Ongoing legacy outputs migration jobs need the full extract and as recent as possible data
- some selection criteria like
emailed_used_countrequires full extract.
This preparation work will require the developer managing the COLIN extracts(full and subset) to grab deltas on a cadence deemed appropriate.
We will provide guidelines in this ticket for an approach that has been used. Again, the dev who owns the COLIN extract prep work for a given migration can decide what approach they use for keeping the COLIN extracts up to date until migration day.
Steps for maintaining full COLIN extract:
- Pull full extract when new batch has been decided.
- Create migration table entries for new batch.
- Grab full delta daily for corps. ==Note that although you don’t need to do this daily necessarily, you will need to do a delta for sure on the day of email verification and pre-migration email days.== Also note that for the full deltas, if the delta grows larger than 5k, it usually makes sense to grab a full extract as the delta may take longer than the full extract.
- Grab full delta using subset transfer script
- Do full refresh of views
- Prune dropped corps and do limited refresh of views to save time. Note that pruning daily is optional. We only need to prune when we upload the full colin extract to GCP for legacy output jobs purposes.
- Dump and upload full extract to GCP. Doing this daily is optional too.
- Pre-migration email is sent
- Give Doug latest qualifying business identifiers after pre-migration email is sent
- Day before migration arrives
- Grab full delta + full view refresh in the morning
- Prune corps for batch and minimal view refresh
- Upload full extract to GCP
- Migration day arrives
- Run COLIN freeze flow for batch
- Grab full delta + unfreeze relevant corps in extract + full view refresh. Note: make sure to exclude condition checking for already migrated corps. this is specific to migration day as we freeze the corps
AND NOT (
EXISTS (
SELECT 1
FROM corporation c2
WHERE c2.corp_num = e.corp_num
AND c2.corp_frozen_typ_cd = 'C'
)
AND EXISTS (
SELECT 1
FROM corp_early_adopters cea
WHERE cea.corp_num = e.corp_num
)
)
- Prune batch as required
- Upload tracking tables to GCP
Steps for maintaining subset COLIN extract:
Note that after the initial subset is created, devs can just keep using it for dry running and testing even if it is a bit stale. The important thing is to just have the latest subset on migration day.
- Load subset for batch
- Import latest tracking tables from full extract which should include batch of interest
- Full refresh of views
- Grab batch delta daily for corps. May be able to just do this on migration day as volume will be much less than full delta. For larger batches, may need to do a delta at least every few days depending on what we see for delta volume.
- Day before migration arrives
- Grab batch delta + full view refresh
- Migration day arrives
- Apply full extract tracking tables to subset. Assuming that COLIN freeze and full extract work is already done.
- Upload subset extract to GCP
Tasks
- Manage full COLIN extract up to migration day
- Manage subset COLIN extract up to migration day
Activity
[-]Copy of SAF 1.6 - COLIN extract prep[/-][+]SAF 1.7 - COLIN extract prep[/+]