Harvester DB Migration Rebuild
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Ambito
- databases, devops, infrastructure
Direzione di ricerca
Inizia da app-start.sh alla riga 9, quindi esamina le issue 6147 e 6145 e il lavoro di migrazione OpenSearch a cui si fa riferimento nella PR 842 di datagov-harvester. Il lavoro è considerato completato quando il workflow di migrazione blue/green documentato è implementato e validato, inclusi il rollback in caso di errore, il blocco dei deploy e la ripresa dei job di harvest dopo la verifica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
User Story
In order to release DB migrations intentionally and with purpose, data.gov admins want DB migration split into a separate process and completed when PR has tag (or when PR has migrations in it).
Acceptance Criteria
- GIVEN a DB migration is prepped and ready to be applied to staging/production
WHEN the migration changes are accepted and merged into main
THEN the migration occurs smoothly on release
AND if any failures occur the change is rolled back and issues are created to manage/mitigate
AND deploys are stopped until triage occurs
Background
See https://github.com/GSA/data.gov/issues/6147 and https://github.com/GSA/data.gov/issues/6145. We have schema drift that wasn't being reported and in a bad state.
We want to streamline the process to be better.
We did this for complex OpenSearch changes/migrations, which was more complex because it involved a whole new index and coordinating with the catalog application. See https://github.com/GSA/datagov-harvester/pull/842 and https://github.com/GSA/data.gov/issues/5885
Security Considerations (required)
None
Sketch
Current migration happens as part of startup: https://github.com/GSA/datagov-harvester/blob/main/app-start.sh#L9
This is going to be a blue/green deployment. What that means is we have 2 versions of the application running in parallel in order to service the in-between state of the DB (partial migration has occurred).
The workflow should be something like the following:
- Stop all new harvest jobs, wait/kill current running jobs (wait 10 minutes, then kill; can always be re-run)
- Create new harvest application with new code and deploy, scaled to 0, with 0 harvest runners.
- Start task specifically for DB migration
- Once task is confirmed running, scale new app to 1
- Wait/watch for DB migration task to finish and succeed
- Scale old app to 0, new app to 2, and swap names (datagov-harvest becomes datagov-harvest-old and datagov-harvest-new becomes datagov-harvest)
- Verify everything working and all good
- Resume harvest job runners and remove old app
- If at any point any of the above fails, create ticket and disable deployment action (and possibly other O&M notification, ie slack?)
This is meant to provide the best user experience that if the DB is in an in-between state the new application could serve the request and be successful, and vice-versa. It will be buggy, but the only "sure fire" way to keep everything alive would be to have scheduled down time (turn off the app and run the migration and turn it back on with new code); which is possible but seems unnecessary. We could also consider not turning on the blue/green deployment and letting certain routes/items fail until able to spin up the new application after the migration is complete.
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 207
- Merge medio
- 3g 16h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GSA/data.gov
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Harvester
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
blocked form submission shows home pageForse già presa @FuhuXia l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
idle-in-transaction for harvest record selectionForse già presa @theyottaboy l’ha presa 15 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di GSA/data.gov
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno