Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #18111: create migration script to remove index on keyvalue #2357

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rudder-webapp/SOURCES/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ install: build initial-promises initial-ncf
install -m 644 $(CORE_RESOURCES)/Migration/dbMigration-5.0.x-5.0.7-tune-autovacuum_on_table_basis.sql $(DESTDIR)/opt/rudder/share/upgrade-tools/
install -m 644 $(CORE_RESOURCES)/Migration/dbMigration-5.0.x-5.0.12-composite-index-on-ruddersysevents.sql $(DESTDIR)/opt/rudder/share/upgrade-tools/
install -m 644 $(CORE_RESOURCES)/Migration/dbMigration-5.0.x-5.0.13-remove-autovacuum-on-ruddersysevents.sql $(DESTDIR)/opt/rudder/share/upgrade-tools/

install -m 644 $(CORE_RESOURCES)/Migration/dbMigration-6.1-6.2-remove-unused-index-on-ruddersysevents.sql $(DESTDIR)/opt/rudder/share/upgrade-tools/

install -m 755 rudder-upgrade $(DESTDIR)/opt/rudder/bin/

install -m 644 rudder-webapp $(DESTDIR)/opt/rudder/etc/server-roles.d/
Expand Down
11 changes: 10 additions & 1 deletion rudder-webapp/SOURCES/rudder-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ trap 'anomaly_handler ${LINENO}' ERR INT TERM
# - 6.0.4 : Ensure that rudder-slapd sockbuf_max_incoming_auth is not lost at upgrade
# - 6.1.0 : Migrate RudderUniqueID to the template format
# - 6.1.0 : Add indexes cn,softwareVersion,directiveId in slapd.conf
# 6.1.1 : Update apache conf if it does not contain technique editor conf (file not updated by packaging
# - 6.1.1 : Update apache conf if it does not contain technique editor conf (file not updated by packaging
# - 6.2.0 : Remove unused index on RudderSysEvents
####################################################################################

# Some paths
Expand Down Expand Up @@ -449,6 +450,14 @@ upgrade_database() {
echo " Done"
fi

# - 6.2: Remove unused index on RudderSysEvents
RES=$(${PSQL} -t -d ${SQL_DATABASE} -c "select count(oid) from pg_class where lower(relname) = 'keyvalue_idx'")
if [ $RES -ne 0 ]; then
echo -n "INFO: Removing unused index on table RudderSysEvents"
${PSQL} -d ${SQL_DATABASE} -f ${RUDDER_UPGRADE_TOOLS}/dbMigration-6.1-6.2-remove-unused-index-on-ruddersysevents.sql > /dev/null
echo " Done"
fi

# Now check the fileFormat in the eventlog
upgrade_eventlog

Expand Down