Bug 1796059

Summary: Heketi crashes if the pod is not running on the node during brick remove
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Vaibhav Mahajan <vamahaja>
Component: heketiAssignee: John Mulligan <jmulligan>
Status: CLOSED ERRATA QA Contact: Vaibhav Mahajan <vamahaja>
Severity: high Docs Contact:
Priority: unspecified    
Version: ocs-3.11CC: asakthiv, hchiramm, madam, pprakash, puebele, rhs-bugs, rtalur, storage-qa-internal
Target Milestone: ---Keywords: ZStream
Target Release: OCS 3.11.z Batch Update 5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhgs-volmanager-container-3.11.5-2 Doc Type: Bug Fix
Doc Text:
Previously, Heketi could crash if an attempt was made to delete a brick from a node that was not running and the option to `debug unmount` failures was enabled. Heketi no longer crashes when this condition occurs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-26 20:05:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vaibhav Mahajan 2020-01-29 14:08:45 UTC
Description of problem:
Heketi pod went into "CrashLoopBackOff" state after executing some test cases related to add/remove of devices while performing some IO operations.

Version-Release number of selected component (if applicable):

[root@ocs-3x-cvp-ci-integration-master-0 ~]# oc version
oc v3.11.165
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ocs-3x-cvp-ci-integration-master-0:8443
openshift v3.11.165
kubernetes v1.11.0+d4cacc0

[root@ocs-3x-cvp-ci-integration-master-0 ~]# rpm -qa | grep glusterfs
glusterfs-6.0-21.el7.x86_64
glusterfs-client-xlators-6.0-21.el7.x86_64
glusterfs-fuse-6.0-21.el7.x86_64
glusterfs-libs-6.0-21.el7.x86_64


How reproducible:
Always

Steps to Reproduce:
1. Deploy gluster server with latest openshift ansible & OCS 3.11.5 builds.
2. Execute test cases related to add/remove test cases related heketi node while performing IO operations.
3. After around 10 mins, check heketi-storage pod status

Actual results:
heketi-storage is going into "CrashLoopBackOff" state

[root@ocs-3x-cvp-ci-integration-master-0 ~]# oc get pods
NAME                                          READY     STATUS             RESTARTS   AGE
glusterblock-storage-provisioner-dc-1-l4x58   1/1       Running            1          2h
glusterfs-storage-57hqj                       1/1       Running            0          3h
glusterfs-storage-8mknv                       1/1       Running            1          3h
glusterfs-storage-fnsrf                       1/1       Running            0          3h
glusterfs-storage-jk2p6                       1/1       Running            1          3h
glusterfs-storage-nrmhj                       1/1       Running            1          3h
heketi-storage-1-k4xl6                        0/1       CrashLoopBackOff   9          37m

Expected results:
heketi-storage pod status should be "Running" and should be able to create all type of volumes.

Comment 2 John Mulligan 2020-01-29 14:19:28 UTC
Heketi crashes when a brick is being removed and the pod is not running on the node where the brick is mounted.
This issue is caused by this block:
»»»»»»»»»»»»if s.DebugUmountFailures() {
»»»»»»»»»»»»»»»»// in case unmounting failed, grab the output of 'lsof /path/to/brick'
»»»»»»»»»»»»»»»»commands = []string{
»»»»»»»»»»»»»»»»»»»»fmt.Sprintf("lsof %s", brick.Path),
»»»»»»»»»»»»»»»»}
»»»»»»»»»»»»»»»»res, _ = s.RemoteExecutor.ExecCommands(host, rex.ToCmds(commands), 5)
»»»»»»»»»»»»»»»»logger.Warning("brick path [%s] kept open by:\n%s", brick.Path, res[0].Output)
»»»»»»»»»»»»}
»»»»»»»»}

The res value is empty and the error was set but this code ignores the error and assumes that the command ran and put a value in res. To fix this the warning line should only be run if the error is not set.

Comment 8 Amrita 2020-02-26 06:05:28 UTC
doc text has been modified

Comment 9 Amrita 2020-02-26 12:42:03 UTC
Modified doc text to remove the dot and first sentence

Comment 10 John Mulligan 2020-02-26 13:32:14 UTC
"""Previously, Heketi could crash if an attempt was made to delete a brick from a node that was not running and the option to `debug unmount` failures was enabled. With this update, this option is enabled by default. Hence, Heketi no longer crashes when this condition occurs."""

Is not quite correct. The option was always enabled by default. I put, "By default this option is enabled." into my suggested doc text to clarify that the behavior is optional but is on by default.

Either remove the "With this update" from "With this update, this option is enabled by default" or drop that sentence entirely if you don't think the extra context is needed. Otherwise this doc text is incorrect.

Comment 11 Amrita 2020-02-26 14:06:01 UTC
Have removed the entire sentence to avoid confusion.

Comment 13 errata-xmlrpc 2020-02-26 20:05:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0621