Applying Hot Fixes with the Patcher (6.2.4+)

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.

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).

Apply a Patch

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

1. Access a Container

Access any container, except MySQL:

  • Simple Installation and Docker Swarm:  docker exec -it <container name> bash
  • Kubernetes: 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 Service Folder

cd /opt/mi/patch/<service>

Available services:

  • web
  • seed
  • dataprocessor
  • monitoring
  • data-analyzer

3. Download the Patch File

From the service folder, execute:
wget <patch URL>

Note that the downloaded patch file should not be unpacked.

4. Wait 1 Minute for Patch to Be Applied

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."

Example of Applying a Patch for Simple Installation in Web Container

1. Access Web Container

Execute mi-console.

2. Check the File that Will Be Patched

The hot fix will patch the file datadeps_check.sh located in the /opt/mi/iv/data/bin/ directory.

  1. Access the file's directory: cd /opt/mi/iv/data/bin/
  2. List file in a long format: ls -l datadeps_check.sh
  3. Note the date and time when the initial file was changed (Feb 25 15:25)

3. Access the Patch Directory

Execute cd /opt/mi/patch/web/.

4. Download the Patch File

From the /patch/web/ directory, execute: wget <patch URL>.

5. Wait 1 Minute for Patch to Be Applied

6. Check the Patched File

We can check whether the file has been changed by viewing the date of its' last change:

  1. Access the file's directory: cd /opt/mi/iv/data/bin/
  2. Display file info in a long format: ls -l datadeps_check.sh
  3. Note that the date and time have changed (from Feb 25 15:25 to Mar 11 11:50), which means that the file has been successfully patched

7. View Patcher Logs

  1. Access patcher log directory: cd /opt/mi/log/
  2. View the patcher.log file: cat patcher.log
  3. 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> ]