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.
Currently the FHIRBUCKET schema is deployed using a separate invocation of the fhir-bucket CLI. This was designed to make it easy to run once. It's currently not possible to "create the schema if needed" as part of a normal fhir-bucket run. Doing so would simplify deployment configuration.
Describe the solution you'd like
Allow the FHIRBUCKET schema to be created if needed (bootstrapped) when the fhir-bucket CLI starts. Use the CONTROL table lease mechanism developed for the main FHIRDATA schema to ensure that the schema processing is serialized if multiple instances of fhir-bucket are started at the same time.
Describe alternatives you've considered
Use (complex) deployment configurations to achieve the same behavior.
Acceptance Criteria
GIVEN an empty database
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN the schema will be deployed before the main fhir-bucket processing starts
GIVEN a deployed fhir-bucket schema
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN the schema updates will be applied before the main fhir-bucket processing starts
GIVEN a deployed fhir-bucket schema
AND another instance of the fhir-bucket is started at the same time
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN one instance will wait for the other instance to complete its schema processing before starting
Additional context
Consider also using the WHOLE_SCHEMA_VERSION which allows the schema processing to be skipped entirely if it is at the latest version - although the fhir-bucket schema is very small, so the benefit is small.
The text was updated successfully, but these errors were encountered:
This required moving the schema lease manager and whole-schema-version code to fhir-database-utils, and a corresponding change to the API to use ints for the schema version instead of FhirSchemaVersion, making it more generic. FhirSchemaVersion is now used in fhir-persistence-schema, and a new enum FhirBucketSchemaVersion is used in the fhir-bucket project, which is a nice separation.
using the --bootstrap-schema option auto creates the fhirbucket schema if it is not there. also if the db is there it is update or skipped as needed.
INFO: The schema 'FHIRBUCKET' is created or already exists
Jan 10, 2022 12:40:48 PM com.ibm.fhir.database.utils.schema.LeaseManager waitForLease
INFO: Requesting update lease for schema 'FHIRBUCKET' [attempt 1]
Jan 10, 2022 12:40:48 PM com.ibm.fhir.bucket.app.Main bootstrapDb
INFO: Already at latest version; skipping update for: 'FHIRBUCKET'
Jan 10, 2022 12:40:48 PM com.ibm.fhir.database.utils.schema.LeaseManager cancelLease
INFO: Canceling lease for schema 'FHIRBUCKET'
Is your feature request related to a problem? Please describe.
Currently the FHIRBUCKET schema is deployed using a separate invocation of the fhir-bucket CLI. This was designed to make it easy to run once. It's currently not possible to "create the schema if needed" as part of a normal fhir-bucket run. Doing so would simplify deployment configuration.
Describe the solution you'd like
Allow the FHIRBUCKET schema to be created if needed (bootstrapped) when the fhir-bucket CLI starts. Use the CONTROL table lease mechanism developed for the main FHIRDATA schema to ensure that the schema processing is serialized if multiple instances of fhir-bucket are started at the same time.
Describe alternatives you've considered
Use (complex) deployment configurations to achieve the same behavior.
Acceptance Criteria
GIVEN an empty database
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN the schema will be deployed before the main fhir-bucket processing starts
GIVEN a deployed fhir-bucket schema
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN the schema updates will be applied before the main fhir-bucket processing starts
GIVEN a deployed fhir-bucket schema
AND another instance of the fhir-bucket is started at the same time
WHEN fhir-bucket is run
AND the bootstrap-schema option is provided
THEN one instance will wait for the other instance to complete its schema processing before starting
Additional context
Consider also using the WHOLE_SCHEMA_VERSION which allows the schema processing to be skipped entirely if it is at the latest version - although the fhir-bucket schema is very small, so the benefit is small.
The text was updated successfully, but these errors were encountered: