From e569a28fe3f235674829b18978c8598dd347c4dc Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Wed, 20 Nov 2024 15:24:06 -0500 Subject: [PATCH] Change the migrator to avoid table locks when adding an index. (#6489) --- .../7_6_0/6489-change-index-add-concurrency-default.yaml | 4 ++++ .../main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6489-change-index-add-concurrency-default.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6489-change-index-add-concurrency-default.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6489-change-index-add-concurrency-default.yaml new file mode 100644 index 000000000000..86a4c3d7a59f --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6489-change-index-add-concurrency-default.yaml @@ -0,0 +1,4 @@ +--- +type: perf +issue: 6489 +title: "Change the migrator to avoid table locks when adding an index. This allows systems to continue running during upgrade." diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java index 88269f41756e..c3489d3f6312 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java @@ -397,7 +397,7 @@ public class BuilderAddIndexUnique { private final String myVersion; private final boolean myUnique; private String[] myIncludeColumns; - private boolean myOnline; + private boolean myOnline = true; public BuilderAddIndexUnique(String theVersion, boolean theUnique) { myVersion = theVersion;