Applying Hot Fixes with the Patcher

This article describes how to apply new patches and view the applied patches using the Patcher. An example of applying a patch for MI Simple Installation in the web container is provided at the end of the article.

The Patcher is a utility that automatically checks for required patches any time the container is started, moves the files to the correct location, and proceeds with normal operation. Any time the container is restarted, the same checks occur.

Table of contents:

Apply a Patch

  1. Access a Container
  2. Access the Patch Directory
  3. Download the Patch File
  4. Wait 1 Minute for Patch to Be Applied
  5. View the Applied Patches
  6. Example of Applying a Patch for Simple Installation in Web Container
    1. Access Web Container
    2. Check the File that Will Be Patched
    3. Access the Patch Directory
    4. Download the Patch File
    5. Wait 1 Minute for Patch to Be Applied
    6. Check the Patched File
    7. View Patcher Logs

NOTE: For details on rolling back a patch, see Removing a Patch.

The hot fixes are baked into the Docker images of future releases (for example, 6.2.5) and this process is no longer necessary until the next set of new patches needs to be applied, which will later be baked into the next release (6.2.6).

Beginning v6.4.5 the Patcher is globally available as mi-patcher.

Apply a Patch

The procedure of applying patches is the same for Simple Installations and Orchestrated Environments.

1. Access a Container

Access the web container:

  • Simple Installation and Docker Swarm:  docker exec -it <container name> bash
  • Kubernetes (access the web master container): kubectl exec -n <namespace> -it <pod> -- bash
  • OpenShift:
    • Single-container pod: oc exec -it <pod> bash
    • Multi-container pod: oc exec -it <pod> -с <container> bash

2. Access the Patch Directory

Beginning v6.2.5a, the Patcher has been removed from the seed node.

Access a directory depending on version of your MI application:

3. Download the Patch File

From the directory opened in the previous step, execute:

  • Prior to 6.4.2   wget <patch URL>
  • v6.4.2+   curl --output /opt/mi/patch/<file_name> <patch URL>

NOTE: The downloaded patch file should not be unpacked.

4. Wait 1 Minute for Patch to Be Applied

Beginning in v6.4.5, any older patches will not be applied if a newer patch has already been applied. The patches are processed by their creation time.

5. View the Applied Patches

Check the Log File

cat /opt/mi/log/patcher.log

The list of the applied patches is displayed in the following format:

[ <Datetime of applying> ] Patcher [ <Log level> ] [ <Hostname> ] [ <Component> ] [ <MI Version> ] [ <Patch id>] [ <JIRA Task> ] [ <Description> ]

Example of the Patcher's log: 2021-01-13 15:18:01 [Patcher] [INFO] web web 101.1.1119.staging_6 202101130e01 OPS-1737 "The patch was applied successfully. Description: MI Patch test."

Beginning v6.4.5 the following parameters are available to check the applied patches and affected files:

  • mi-patcher show --applied - Displays the list of applied patches for the current component.
  • mi-patcher show --applied --details - Displays the list of applied patches for the current component with details on each patch.
  • mi-patcher show --all - Displays all patches, both applied and not applied.
  • mi-patcher show --dependency-tree, mi-patcher show --dependency-list - Displays a graphical representation of applied patches' hierarchy in form of a dependency tree or a list.
  • mi-patcher show --files - Displays files that were modified through the patches in the current component.