Upgrading a Mirror
This section provides instructions for upgrading InterSystems IRIS instances, an application, or both on the members of an InterSystems IRIS mirror.
As noted in the “Mirroring” chapter of the InterSystems IRIS High Availability Guide, all failover and DR async members of a mirror must be of the same InterSystems IRIS version, and can differ only for the duration of an upgrade. Once an upgraded member becomes primary, you cannot make use of the other failover member and any DR async members (and in particular cannot allow them to become the primary) until the upgrade is completed.
Mirroring does not require reporting async members to be of the same InterSystems IRIS version as the failover members, although application functionality may require it; for more information, see InterSystems IRIS Instance Compatibility in the “Mirroring” chapter of High Availability Guide.
There are four mirror upgrade paths to choose from. To determine which procedure you should follow, review the factors in the Choosing Mirror Upgrade Procedure section below. The four procedures are located in the Mirror Upgrade Procedures section below.
Also review the following two sections about upgrading a mirror:
-
Mirror Upgrade Terms, which defines some of the terms used in the mirror upgrade procedures.
-
Adding Mirror Members During an Upgrade, which discusses when you should add members to a mirror.
On Linux systems supporting systemd, although it is possible to use either systemctl commands or the /etc/init.d/ISCAgent script to manage the ISCAgent, you must choose one method and use it exclusively; the ISCAgent should always be stopped using the method with which it was started. For more information, see Starting the ISCAgent on Linux Systems in the “Mirroring” chapter of the InterSystems High Availability Guide.
When you upgrade InterSystems IRIS on such a Linux system, a running ISCAgent is automatically restarted using systemd. If you are using the /etc/init.d/ISCAgent script to manage the ISCAgent, stop the agent before performing the upgrade so that it is not automatically restarted, then restart it using the script after the upgrade.
Choosing Mirror Upgrade Procedure
To upgrade your mirrored environment, you must choose one of four supported upgrade procedures. To determine the best upgrade procedure for your system, follow the flowchart or review the criteria below.
If you are upgrading to a maintenance release and you aren’t making any application changes during the upgrade process, you can use this simplified procedure.
For details, see Procedure 1: Maintenance Release Upgrades with No Application Changes.
This procedure can be used for major version upgrades or upgrades with application changes where downtime is not a concern and simplifies some steps by shutting down all mirror members at the same time.
For details, see Procedure 2: Major Version Upgrades with Planned Downtime.
If you are upgrading to a major version or performing applications changes and you need to minimize downtime you must use Procedure 3 or 4. Procedure 3 allows for the shortest downtime, only the requiring the time necessary to perform a planned failover. Procedure 4 involves downtime while you perform any application upgrades and recompile mirrored classes and routines.
If any of the following conditions apply, your upgrade involves mirrored database changes and you must use Procedure 4: Major Version Upgrade with Mirrored Database Changes.
-
Classes and routines are stored in mirrored databases that also contain application data.
-
An application upgrade you are performing includes changes to data in a mirrored database.
-
Your system uses interoperability productions.
If none of the above conditions apply, you should use Procedure 3: Major Version Upgrade with No Mirrored Database Changes.
Adding Mirror Members During an Upgrade
If you plan to add members to a mirror, you may want to defer this until you plan to perform one of the upgrades described in this section and add members of the new version during the upgrade, so that you do not have to upgrade them later. You can always add members of a newer version to a mirror during an upgrade, provided you immediately continue with and complete the upgrade as described, with one restriction: once a member of the newer version becomes primary, it must remain primary until all other members have been upgraded.
Adding new members during an upgrade can be very helpful when migrating a mirror to new hardware. Rather than upgrading one of the failover members before failing over to it, you can install a new instance of the new version on the target system, add it to the mirror as a DR async member, promote it to backup and then fail over to it, thus migrating the mirror primary to the new system. By repeating this technique you can then migrate the remaining failover member.
Mirror Upgrade Terms
In the procedures in this section, the following terms are used:
Recompile all classes in all application namespaces on the instance. This should be done after an InterSystems IRIS major version upgrade (as described in Post-Upgrade Tasks) and/or application upgrade, which may involve one or more of the following operations, depending on your situation:
-
As noted in the foregoing, when classes exist in any mirrored database that also contains application data, they must be recompiled locally on the functioning primary failover member (regardless of whether they are modified by an application upgrade). It is recommended that any existing routines are recompiled.
-
Classes and routines stored in nonmirrored routines databases that are separate from application data can be recompiled on a mirror member regardless of whether it is the current primary.
-
Classes and routines stored in separate nonmirrored routines database can also be “precompiled” by recompiling a copy of the database on a system that has already been upgraded to the target InterSystems IRIS release, then distributed to each mirror member following the upgrade.
The mirror member that is initially the primary failover member.
The mirror member that is initially the backup failover member.
Use the ^MIRROR routine to set or clear the no failover state so that failover cannot occur; see Avoiding Unwanted Failover During Maintenance of Failover Members for instructions.
Use the iris stop command to shut the instance down cleanly (see Controlling InterSystems IRIS Instances).
Follow the procedure for promoting a DR async mirror member to failover member as described in Promoting a DR Async Member to Failover Member.
Use the Mirror Monitor page in the instance’s Management Portal to review the status of the mirror and its members; see Using the Mirror Monitor.
Mirror Upgrade Procedures
There are four mirror upgrade paths to choose from. To determine which procedure you should follow, review the factors in the Choosing Mirror Upgrade Procedure section. The four procedures are:
-
Procedure 1: Maintenance Release Upgrades with No Application Changes
-
Procedure 3: Major Version Upgrade with No Mirrored Database Changes
-
Procedure 4: Major Version Upgrade with Mirrored Database Changes
Procedure 1: Maintenance Release Upgrades with No Application Changes
If you are upgrading to an InterSystems IRIS maintenance release rather than a new major InterSystems IRIS version and are not making any application changes, use the following procedure, which renders the mirror unavailable only for the time required to execute a planned failover.
-
Access the Mirror Monitor. You should use the Mirror Monitor throughout the upgrade process to confirm that each step is performed correctly. Whenever a step involves shutting down mirror member, failing over, or restarting a mirror member, you should confirm after performing that the Mirror Monitor correctly reflects the change.
-
To prevent failover from occurring until the backup is fully upgraded, set the no failover state.
-
Perform a graceful shutdown of the backup (B).
-
Upgrade the backup (B) with the new version of InterSystems IRIS. System B restarts and returns as backup.
-
Clear the no failover state.
-
Perform a graceful shutdown of the primary (A). The mirror fails over and the backup (B) takes over as primary.
-
Upgrade system A with the new version of InterSystems IRIS. System A restarts and becomes backup.
-
Perform a graceful shutdown of the primary (B). The mirror fails over and the backup (A) becomes the primary. This ensures that all automated upgrade and reactivation steps are performed on both mirror members and that both instances are ready to act as primary.
-
Restart system B so that it returns as backup.
Procedure 2: Major Version Upgrades with Planned Downtime
If you are upgrading to a new major InterSystems IRIS version and/or performing an application upgrade and have a significant planned maintenance window that obviates the need to minimize mirror downtime, you may prefer to use the following procedure, regardless of whether changes to mirrored databases on the primary are required:
-
Disallow all user access to the mirror using established practices at your site. Additionally, you must disable any application jobs that would normally start on instance startup.
-
Access the Mirror Monitor. You should use the Mirror Monitor throughout the upgrade process to confirm that each step is performed correctly. Whenever a step involves shutting down mirror member, failing over, or restarting a mirror member, you should confirm after performing that the Mirror Monitor correctly reflects the change.
-
Perform a graceful shutdown of the backup (B).
-
Perform a graceful shutdown of the primary (A).
-
Upgrade system B with the new version of InterSystems IRIS. System B restarts and becomes primary.
-
Upgrade mirrored classes and routines on system B. If an application upgrade requires further changes to mirrored databases, make these changes.
-
Upgrade nonmirrored classes and routines on system B, if any.
-
Upgrade system A with the new version of InterSystems IRIS. System A restarts and becomes backup. Mirrored classes and routines on system A catch up with those on system B and are automatically upgraded.
-
Upgrade nonmirrored classes and routines on system A, if any.
-
Perform a graceful shutdown of the primary (B). The mirror fails over and the backup (A) takes over as primary. This ensures that all automated upgrade and reactivation steps are performed on all mirror members and that all instances are ready to act as primary.
-
Restart system B so that it returns as backup.
-
Restore user access to the mirror.
Procedure 3: Major Version Upgrade with No Mirrored Database Changes
If you are upgrading to a new major InterSystems IRIS version and/or performing an application upgrade and have determined that changes to mirrored databases are not required (as described in Choosing a Mirror Upgrade Procedure), you may be able to use the following procedure. This procedure only requires downtime for the length of time it takes to execute a planned failover.
This procedure is simplest for static applications where separate nonmirrored routines databases are always maintained. It can, however, be used even if the separate routines databases are normally mirrored by removing these databases from the mirror for the duration of the upgrade. See Temporarily Removing Mirrored Databases From the Mirror for details on this process.
-
Enact a code freeze and application configuration freeze to disallow application changes during the upgrade, using established procedures at your site, to ensure that routines databases are not modified during the upgrade.
-
Access the Mirror Monitor. You should use the Mirror Monitor throughout the upgrade process to confirm that each step is performed correctly. Whenever a step involves shutting down mirror member, failing over, or restarting a mirror member, you should confirm after performing that the Mirror Monitor correctly reflects the change.
-
To prevent failover from occurring until the backup is fully upgraded, set the no failover state.
-
Perform a graceful shutdown of the backup (B).
-
Upgrade the backup (B) with the new version of InterSystems IRIS. System B restarts and returns as backup.
-
Upgrade all classes and routines on system B.
-
Clear the no failover state.
-
Perform a graceful shutdown of the primary (A). The mirror fails over and the backup (B) takes over as primary.
-
To prevent system A from taking over as primary until fully upgraded, set the no failover state.
-
Upgrade system A with the new version of InterSystems IRIS. System A restarts and returns as backup.
-
Upgrade all classes and routines on system A.
-
Clear the no failover state.
-
Perform a graceful shutdown of the primary (B). The mirror fails over and the backup (A) becomes the primary. This ensures that all automated upgrade and reactivation steps are performed on all mirror members and that all instances are ready to act as primary.
-
Restart system B so that it returns as backup.
Temporarily Removing Mirrored Databases from the Mirror
Procedure 3 can be used for systems that mirror routines databases by temporarily removing the databases from the mirror during the upgrade process.
If the routines databases are normally mirrored, ensure that they do not contain any application data before removing them from the mirror.
This procedure cannot be used with normally mirrored routines databases if ECP application servers connect to the mirror.
To use the above procedure with mirrored routines databases:
-
Before starting the upgrade, enact a code freeze and application configuration freeze to disallow application changes during the upgrade, using established procedures at your site, to ensure that routines databases are not modified during the upgrade.
-
Before shutting down system B in Step 4, remove the databases from the mirror.
-
In Step 6, make sure you upgrade the classes and routines in the databases that are temporarily removed from the mirror.
-
In Step 11, only upgrade non-mirrored classes and routines on system A. (Do not upgrade classes and routines from the databases that were removed from the mirror on system B.)
-
After upgrading the non-mirrored classes and routines on system A, remove the mirrored routines databases from system A.
-
Add the databases to the mirror on system B.
-
Back up the databases on system B and restore them on system A using the procedures for adding an existing database to a mirror provided in Adding Databases to a Mirror. Retain these backups, as they represent the first backups of newly-added mirrored databases; older backups made prior to the upgrade cannot be used to restore these databases in the event of disaster.
-
Add the databases to the mirror on system A.
-
Continue with Step 12 and finish the rest of Procedure 3 as normal.
Procedure 4: Major Version Upgrade with Mirrored Database Changes
If you are upgrading to a new major InterSystems IRIS version and/or performing an application upgrade and have determined that changes to mirrored databases are required (as described in Choosing a Mirror Upgrade Procedure), use the following procedure, which renders the mirror unavailable only for the time it takes to execute a planned failover and make the required mirrored database changes:
-
Access the Mirror Monitor. You should use the Mirror Monitor throughout the upgrade process to confirm that each step is performed correctly. Whenever a step involves shutting down mirror member, failing over, or restarting a mirror member, you should confirm after performing that the Mirror Monitor correctly reflects the change.
-
To prevent failover from occurring until the backup is fully upgraded, set the no failover state.
-
Perform a graceful shutdown of the backup (B).
-
Upgrade the backup (B) with the new version of InterSystems IRIS. System B restarts and returns as backup.
-
Upgrade nonmirrored classes and routines on system B, if any.
-
Disallow new user access to the mirror using established practices at your site. Additionally, you must disable any application jobs that would normally start on system B when it becomes primary.
-
Clear the no failover state.
-
Perform a graceful shutdown of the primary (A). The mirror fails over and the backup (B) takes over as primary.
-
Upgrade mirrored classes and routines on the new primary (B). If an application upgrade requires further changes to mirrored databases, make these changes.
-
Restore user access to the mirror.
-
To prevent system A from taking over as primary until fully upgraded, set the no failover state.
-
Upgrade system A with the new version of InterSystems IRIS. System A restarts and returns as backup.
-
Upgrade nonmirrored classes and routines on system A, if any.
-
Clear the no failover state.
-
Perform a graceful shutdown of the primary (B). The mirror fails over and the backup (A) becomes primary. This ensures that all automated upgrade and reactivation steps are performed on all mirror members and that all instances are ready to act as primary.
-
Restart system B so that it returns as backup.