Skip to content

Index update, Phase 1: Add large_user_postcode flag and index#610

Merged
KludgeKML merged 1 commit into
mainfrom
phase-1-postcode-side-index
Apr 24, 2025
Merged

Index update, Phase 1: Add large_user_postcode flag and index#610
KludgeKML merged 1 commit into
mainfrom
phase-1-postcode-side-index

Conversation

@KludgeKML
Copy link
Copy Markdown
Contributor

@KludgeKML KludgeKML commented Apr 23, 2025

Related to: #572

...because the migration times out due to data fixup, releasing as 2 phases - this phase will add the index and fix up the data, the next phase will bring in the code once all data is fixed up correctly.

  • relevant index used by postcode collection worker will be checking for active and small postcodes (ie retired and large_user_postcode = false), and ordered by updated_at.
  • Default to large_user_postcode: false, set to true in a rake task from the existing ONSPD data. Only ONSPD records will ever be large_user_postcode: true, so we only need to check them, but they must be set before the code to use them is added, and since this will timeout a migration, we have to do it as a 2-phase deploy (1: migrate, update data, 2: update code.)

https://trello.com/c/Pf89f3wr/350-improve-worker-cpu-usage-on-locations-api, Jira issue PNP-6398

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

⚠️ Coverage note: test suite is set to fail if coverage drops below 100%. If you need to merge in an emergency, you will have to temporarily change branch protection rules. ⚠️

Follow these steps if you are doing a Rails upgrade.

@KludgeKML KludgeKML force-pushed the phase-1-postcode-side-index branch from c04a9ee to a5beca3 Compare April 23, 2025 15:46
@KludgeKML KludgeKML requested a review from sihugh April 23, 2025 15:49
- relevant index used by postcode collection worker will be checking for active and small
  postcodes (ie retired and large_user_postcode = false), and ordered by updated_at.
- Default to large_user_postcode: false, set to true in a rake task from the existing ONSPD
  data. Only ONSPD records will ever be large_user_postcode: true, so we only need to
  check them, but they must be set before the code to use them is added, and since this
  will timeout a migration, we have to do it as a 2-phase deploy (1: migrate, update data,
  2:  update code.)
@KludgeKML KludgeKML force-pushed the phase-1-postcode-side-index branch from a5beca3 to 12b2953 Compare April 24, 2025 09:05
@KludgeKML KludgeKML merged commit 002da52 into main Apr 24, 2025
9 checks passed
@KludgeKML KludgeKML deleted the phase-1-postcode-side-index branch April 24, 2025 10:50
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