I made another interesting discovery this weekend while playing around with the gluster volume deletion option. Prior to creating a volume with a new layout, I went through the documented process to remove my volume:
$ gluster volume stop glustervol01
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
Stopping volume glustervol01 has been successful
$ gluster volume delete glustervol01
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
Deleting volume glustervol01 has been successful
I then re-created it using the documented process:
$ gluster volume create glustervol01 replica 2 transport tcp
Creation of volume glustervol01 has been successful. Please start the volume to access data.
$ gluster volume start glustervol01
Starting volume glustervol01 has been successful
Once the new volume was created and started I mounted in on my clients. When I went to access the volume I was quite intrigued to find that the data that was written to the previous gluster volume was still present:
$ ls -l
total 24 drwxr-xr-x 126 root root 12288 Nov 26 2011 etc drwxr-xr-x 126 root root 4096 Nov 26 13:07 etc2 drwxr-xr-x 126 root root 4096 Nov 26 13:07 etc3 drwx------ 2 root root 4096 Nov 26 2011 lost+found
Ey? Since ‘gluster delete volume’ spit out the message “Deleting volume will erase all information about the volume”, I figured the contents of the volume would be nuked (never assume, always confirm!). That doesn’t appear to be the case here. When you delete a volume the metadata that describes the volume is the only thing that is removed. It would be helpful if the developers noted this in the output above. I can see this causing headaches for folks down the road.