Bug 1354342

Summary: heketi db messed up when using volume expand option
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Neha <nerawat>
Component: heketiAssignee: Luis Pabón <lpabon>
Status: CLOSED ERRATA QA Contact: Anoop <annair>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: hchiramm, madam, mliyazud, pprakash, sashinde, ssaha
Target Milestone: ---Keywords: ZStream
Target Release: RHGS Container Converged 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-04 04:52:10 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:
Bug Depends On:    
Bug Blocks: 1332128    

Description Neha 2016-07-11 07:24:27 UTC
Description of problem:
Try to expand heketi volume 

heketi-cli volume expand --volume=aa9528067826f36e63ff32d0a4eb016d --expand-size=10
Error: 

heketi logs:

Result: 
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x65d3e1]

goroutine 125070 [running]:
panic(0x1654ca0, 0xc820010090)
	/usr/lib/golang/src/runtime/panic.go:481 +0x3e6
github.com/heketi/heketi/executors/sshexec.(*SshExecutor).VolumeExpand(0xc8203fe800, 0xc82089bb60, 0x20, 0xc8202043c0, 0x0, 0x0, 0x0)
	/builddir/build/BUILD/heketi-3b3bdef/src/github.com/heketi/heketi/executors/sshexec/volume.go:119 +0x161
github.com/heketi/heketi/apps/glusterfs.(*VolumeEntry).Expand(0xc820455960, 0xc820282540, 0x7f2ac802ede8, 0xc8203fe800, 0x7f2ac802ef88, 0xc820464860, 0xa, 0x0, 0x0)
	/builddir/build/BUILD/heketi-3b3bdef/src/github.com/heketi/heketi/apps/glusterfs/volume_entry.go:525 +0x348
github.com/heketi/heketi/apps/glusterfs.(*App).VolumeExpand.func2(0x0, 0x0, 0x0, 0x0)
	/builddir/build/BUILD/heketi-3b3bdef/src/github.com/heketi/heketi/apps/glusterfs/app_volume.go:307 +0x1b1
github.com/heketi/rest.(*AsyncHttpManager).AsyncHttpRedirectFunc.func1(0xc82025cd00, 0xc8201460e0)
	/builddir/build/BUILD/heketi-3b3bdef/src/github.com/heketi/rest/asynchttp.go:128 +0x141
created by github.com/heketi/rest.(*AsyncHttpManager).AsyncHttpRedirectFunc
	/builddir/build/BUILD/heketi-3b3bdef/src/github.com/heketi/rest/asynchttp.go:138 +0x56

After that topology info/ node info is not working

# heketi-cli node info bbc7e8607f186b93e4feb202c2e49bc5
Error: Id not found

# heketi-cli topology info
Error: Id not found


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


How reproducible:
Always

Steps to Reproduce:
Try to expand a volume

Actual results:
volume expansion failed after that not able to list topology/node 

Expected results:
should not mess the database


Additional info:
AFAIK volume expand option is not supported for this release but this is available in heketi-cli.

Not sure how to address this issue for this release but it someone is trying "expand" option it will mess up the database.

Comment 3 Luis Pabón 2016-07-13 12:59:52 UTC
I see the failure here: https://github.com/heketi/heketi/blob/master/executors/sshexec/volume.go#L119

This is an easy fix.  Thanks for finding.

Comment 4 Luis Pabón 2016-07-13 13:33:59 UTC
https://github.com/heketi/heketi/issues/426

Comment 8 Neha 2016-07-21 12:05:01 UTC
Don't see this issue with latest build. Volume expansion is working fine.

heketi-cli volume expand --volume=588e3b7af2e30f22785110cc7233437b --expand-size=10
Name: vol_588e3b7af2e30f22785110cc7233437b
Size: 70
Volume Id: 588e3b7af2e30f22785110cc7233437b
Cluster Id: 246aed0ea383ab7c1dca4c6a58700095
Mount: 10.70.42.167:vol_588e3b7af2e30f22785110cc7233437b
Mount Options: backup-volfile-servers=10.70.42.216,10.70.43.19
Durability Type: replicate
Distributed+Replica: 3

Comment 10 errata-xmlrpc 2016-08-04 04:52:10 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://rhn.redhat.com/errata/RHBA-2016-1498.html