Skip to content

Commit

Permalink
Merge pull request #820 from folio-org/release_6.1.8
Browse files Browse the repository at this point in the history
Release 6.1.8
  • Loading branch information
EthanFreestone authored Sep 11, 2024
2 parents 6b68e56 + 03dca10 commit 6884ce0
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.1.8 2024-09-09
* ERM-3321 Description can be too long for index, causing mod-agreements error when updating from 6.0.x to later versions or failure on saving agreements with a long description
* Swap basic GIN indices for GIN indices with trigram operator where they're not already set.

## 6.1.7 2024-08-22
* ERM-3310 Expose concurrent jobs as env var
* ERM-3308 Ingest process slows down dramatically on certain packages
Expand Down
2 changes: 1 addition & 1 deletion service/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gorm.version=7.3.3

# Application
appName=mod-agreements
appVersion=6.1.7
appVersion=6.1.8
dockerTagSuffix=
dockerRepo=folioci

Expand Down
88 changes: 88 additions & 0 deletions service/grails-app/migrations/correct-gin-indices-pre-poppy.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
databaseChangeLog = {
/* GIN Indexes have been added in update-mod-agreements-6-0.groovy
* These can cause issues when the underlying data passes a certain limit
* due to trigram operator not being used and the postgres token size growing
*
* It is a little unorthodox, however these index creations are conditional on
* "CREATE IF NOT EXISTS". We will make use of that to insert indices on those
* fields _before_ they are set up by upgrading/new implementors. For any tenants
* who already managed to upgrade, these new changesets will be ignored, but it
* it _recommended_ that an operational task be undertaken to bring those schemas
* in line with the indices in place on new instances of mod-agreements
*/

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-poppy-1") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'alternate_resource_name', columnNames: 'arn_name')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX arn_name_idx ON ${database.defaultSchemaName}.alternate_resource_name USING gin (arn_name gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-poppy-2") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'erm_resource', columnNames: 'res_description')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX erm_resource_res_description_idx ON ${database.defaultSchemaName}.erm_resource USING gin (res_description gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-poppy-3") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'identifier', columnNames: 'id_value')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX identifier_id_value_idx ON ${database.defaultSchemaName}.identifier USING gin (id_value gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-poppy-4") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'identifier_namespace', columnNames: 'idns_value')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX identifier_namespace_value_idx ON ${database.defaultSchemaName}.identifier_namespace USING gin (idns_value gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-poppy-5") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'refdata_category', columnNames: 'rdc_description')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX refdata_category_rdc_description_idx ON ${database.defaultSchemaName}.refdata_category USING gin (rdc_description gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
databaseChangeLog = {
/*
* See comment in correct-gin-indices-pre-poppy.groovy. Same applies here to
* pre-empt GIN indices set up in quesnalia upgrade file(s)
*/

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-quesnalia-1") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'entitlement', columnNames: 'ent_description')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX entitlement_description_idx ON ${database.defaultSchemaName}.entitlement USING gin (ent_description gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-quesnalia-2") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'entitlement', columnNames: 'ent_note')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX entitlement_note_idx ON ${database.defaultSchemaName}.entitlement USING gin (ent_note gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-quesnalia-3") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'entitlement', columnNames: 'ent_reference')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX entitlement_reference_idx ON ${database.defaultSchemaName}.entitlement USING gin (ent_reference gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-quesnalia-4") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'platform', columnNames: 'pt_name')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX platform_name_idx ON ${database.defaultSchemaName}.platform USING gin (pt_name gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}

changeSet(author: "EFreestone (manual)", id: "2024-09-06-ERM-3321-quesnalia-5") {
preConditions (onFail: 'MARK_RAN', onError: 'WARN') {
not {
indexExists(tableName: 'subscription_agreement', columnNames: 'sa_description')
}
}
// Gin indexes need to be done via scripting.
grailsChange {
change {
def cmd = "CREATE INDEX subscription_agreement_description_idx ON ${database.defaultSchemaName}.subscription_agreement USING gin (sa_description gin_trgm_ops);".toString()
sql.execute(cmd);
}
}
}
}
2 changes: 2 additions & 0 deletions service/grails-app/migrations/module-tenant-changelog.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ databaseChangeLog = {
include file: 'update-mod-agreements-5-3.groovy'
include file: 'wtk/hidden-appsetting.feat.groovy'
include file: 'update-mod-agreements-5-5.groovy'
include file: 'correct-gin-indices-pre-poppy.groovy'
include file: 'update-mod-agreements-6-0.groovy'
include file: 'correct-gin-indices-pre-quesnalia.groovy'
include file: 'add-quesnalia-indices-and-fk-constraints.groovy'
include file: 'update-mod-agreements-6-1.groovy'
}

0 comments on commit 6884ce0

Please sign in to comment.