Update gateway to use DB transactions for Plan Import
Opened this issue · 0 comments
dandelany commented
Background
Low-priority follow-up to NASA-AMMOS/aerie-gateway#109 - this PR includes a “faux transaction” ie. our code rolls back DB state if anything goes wrong during import to avoid corruption. This is theoretically almost as safe as a DB transaction, unless gateway dies/errors halfway through.
Description
We'd like to refactor the gateway to use "real" DB transactions for Plan Import (& potentially other similar operations). However this is complicated by two things:
- Hasura's GraphQL API/engine does does not have proper transaction support - though there is an issue + RFC proposal
- this can be worked around by having Gateway connect directly to the Postgres service and using DB transactions directly, except that...
- We need to revisit DB permissions and roles to give Gateway the proper permissions, so #1576 is a blocker for this