Upgrade Notes
Warning
Please read this section carefully in case any of it is relevant to your Stroom instance.Java Version
Stroom v7.5 requires Java 21. This is the same java version as Stroom v7.3. Ensure the Stroom and Stroom-Proxy hosts are running the latest patch release of Java v21.
Database Migrations
When Stroom boots for the first time with a new version it will run any required database migrations to bring the database schema up to the correct version.
Warning
It is highly recommended to ensure you have a database backup in place before booting stroom with a new version. This is to mitigate against any problems with the migration. It is also recommended to test the migration against a copy of your database to ensure that there are no problems when you do it for real.On boot, Stroom will ensure that the migrations are only run by a single node in the cluster. This will be the node that reaches that point in the boot process first. All other nodes will wait until that is complete before proceeding with the boot process.
It is recommended however to use a single node to execute the migration.
To avoid Stroom starting up and beginning processing you can use the migrage
command to just migrate the database and not fully boot Stroom.
See migrage
command for more details.
Migration Filename Change
If you are deploying onto a v7.4-beta.1 instance you will need to modify the database table used to log migration history.
If the job_schema_history
table contains version 07.03.00.001
then you will need to run the following SQL against the database to prevent Stroom from failing the migration on boot.
Migration Scripts
For information purposes only, the following are the database migrations that will be run when upgrading to 7.4.0 from the previous minor version.
Note, the legacy
module will run first (if present) then the other module will run in no particular order.
Module stroom-analytics
Script V07_04_00_001__execution_schedule.sql
Path: stroom-analytics/stroom-analytics-impl-db/src/main/resources/stroom/analytics/impl/db/migration/V07_04_00_001__execution_schedule.sql
-- ------------------------------------------------------------------------
-- Copyright 2020 Crown Copyright
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- ------------------------------------------------------------------------
-- Stop NOTE level warnings about objects (not)? existing
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;
-- --------------------------------------------------
--
-- Create the table
--
CREATE TABLE IF NOT EXISTS execution_schedule (
id int NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
enabled tinyint NOT NULL DEFAULT '0',
node_name varchar(255) NOT NULL,
schedule_type varchar(255) NOT NULL,
expression varchar(255) NOT NULL,
contiguous tinyint NOT NULL DEFAULT '0',
start_time_ms bigint DEFAULT NULL,
end_time_ms bigint DEFAULT NULL,
doc_type varchar(255) NOT NULL,
doc_uuid varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
CREATE INDEX execution_schedule_doc_idx ON execution_schedule (doc_type, doc_uuid);
CREATE INDEX execution_schedule_enabled_idx ON execution_schedule (doc_type, doc_uuid, enabled, node_name);
CREATE TABLE IF NOT EXISTS execution_history (
id bigint(20) NOT NULL AUTO_INCREMENT,
fk_execution_schedule_id int NOT NULL,
execution_time_ms bigint NOT NULL,
effective_execution_time_ms bigint NOT NULL,
status varchar(255) NOT NULL,
message longtext,
PRIMARY KEY (id),
CONSTRAINT execution_history_execution_schedule_id FOREIGN KEY (fk_execution_schedule_id) REFERENCES execution_schedule (id)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
CREATE TABLE IF NOT EXISTS execution_tracker (
fk_execution_schedule_id int NOT NULL,
actual_execution_time_ms bigint NOT NULL,
last_effective_execution_time_ms bigint DEFAULT NULL,
next_effective_execution_time_ms bigint NOT NULL,
PRIMARY KEY (fk_execution_schedule_id),
CONSTRAINT execution_tracker_execution_schedule_id FOREIGN KEY (fk_execution_schedule_id) REFERENCES execution_schedule (id)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
-- --------------------------------------------------
SET SQL_NOTES=@OLD_SQL_NOTES;
-- vim: set shiftwidth=2 tabstop=2 expandtab:
Module stroom-job
Script V07_04_00_005__job_node.sql
Path: stroom-job/stroom-job-impl-db/src/main/resources/stroom/job/impl/db/migration/V07_04_00_005__job_node.sql
-- ------------------------------------------------------------------------
-- Copyright 2020 Crown Copyright
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- ------------------------------------------------------------------------
-- Stop NOTE level warnings about objects (not)? existing
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;
update job_node set schedule = concat('0 ', schedule, ' * ?') where job_type = 1 and regexp_like(schedule, '^[^ ]+ [^ ]+ [^ ]+$');
SET SQL_NOTES=@OLD_SQL_NOTES;
-- vim: set tabstop=4 shiftwidth=4 expandtab: