You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In Alvearie/alvearie-helm#27 we were hoping to move from helm hooks (once and only once execution) to init containers (runs for each pod) so that we can add a PostgreSQL subchart.
I have two main concerns with that:
multiple pods start at the same time and i'm not super confident that we can safely execute the schema tool in parallel in all cases (and its hard to test for)
it makes pod startup slower
Describe the solution you'd like
create a new table in the FHIR_ADMIN schema for tracking schema upgrades
when a schema action begins (anything other than "create-schema" I think), write a single row to this table to represent its "lease"
include an expiration timestamp in the row and update the schema tool to move that timestamp forward while its running (it should never expire while upgrade is still running)
before executing a schema-update (and other actions?) ensure that there is no lease row; or if there is one, ensure that the lease is expired. otherwise, exit with a successful status.
Describe alternatives you've considered
At first I was thinking we could use a simple table lock on the FHIR_ADMIN.VERSION_HISTORY table, but because we use multiple transactions for some schema updates, we don't think this is quite sufficient.
Acceptance Criteria
GIVEN [a precondition]
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
The described solution addresses my first concern, which is the most important one.
However, it would also be great if we could cover my second concern with is the slow pod startup.
Therefor, it would be great if we could add the overall schema version to this table. Then we could do logic like this:
once the schema-update is successful, mark this "lease" row as "completed"
when doing an upgrade, if there is a completed lease row for this version of the schema (or higher), skip the update
The text was updated successfully, but these errors were encountered:
Verified that issuing multiple change schemas at the same time, they will not interfere with each other, 1 will do the work while the other will time out and you can try again.
Is your feature request related to a problem? Please describe.
In Alvearie/alvearie-helm#27 we were hoping to move from helm hooks (once and only once execution) to init containers (runs for each pod) so that we can add a PostgreSQL subchart.
I have two main concerns with that:
Describe the solution you'd like
Describe alternatives you've considered
At first I was thinking we could use a simple table lock on the FHIR_ADMIN.VERSION_HISTORY table, but because we use multiple transactions for some schema updates, we don't think this is quite sufficient.
Acceptance Criteria
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
The described solution addresses my first concern, which is the most important one.
However, it would also be great if we could cover my second concern with is the slow pod startup.
Therefor, it would be great if we could add the overall schema version to this table. Then we could do logic like this:
The text was updated successfully, but these errors were encountered: