Bug 901531

Summary: Deleting one gluster volume from gluster cli triggers deletion of all volumes in engine
Product: [Retired] oVirt Reporter: Shireesh <shireesh>
Component: ovirt-engine-coreAssignee: Shubhendu Tripathi <shtripat>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: unspecifiedCC: acathrow, iheim, jkt, shtripat
Target Milestone: ---   
Target Release: 3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: gluster
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 903084 (view as bug list) Environment:
Last Closed: 2013-07-25 20:47:55 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: 881006, 901465, 903084    

Description Shireesh 2013-01-18 12:09:22 UTC
Root cause:

Patch http://gerrit.ovirt.org/9825 changed the definition of the SP fnSplitterUuid in such a way that the older call to this SP, that looked like:

select ID from fnSplitterUuid(v_ids)

no longer works, and now needs to be changed to something like:

select * from fnSplitterUuid(v_ids)

While this change was done in most of the *_sp.sql scripts, it was missed out in gluster_volumes_sp.sql

This results in particular severe consequences if you are trying to delete few entries, like it's done in DeleteGlusterVolumesByGuids:

DELETE FROM gluster_volumes 
WHERE id in (select ID from fnSplitterUuid(v_volume_ids));

One may think that this query should fail, but it actually results in deleting all the records from the table!!

Solution:

Modify all calls to fnSplitterUuid present in gluster_volumes_sp.sql to use "*" instead of "ID"