Bug 764579 (GLUSTER-2847)

Summary: volume creation fails if brick path is long
Product: [Community] GlusterFS Reporter: shishir gowda <sgowda>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: amarts, gluster-bugs, kparthas, marypablate, nsathyan, rabhat
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description shishir gowda 2011-04-27 01:55:28 EDT
The brick path though was only 251 chars, the filename exceeded the 255 chars as there were few appends: sng:-tmp-

this was the cause of failure
Comment 1 Amar Tumballi 2011-04-27 01:57:25 EDT
(In reply to comment #1)
> The brick path though was only 251 chars, the filename exceeded the 255 chars
> as there were few appends: sng:-tmp-
> this was the cause of failure

IMO, lets mark it as a known issue, and not try to optimize a lot in shrinking file name size etc. Its surely advised to keep the export directory length lesser, so that inside glusterfs mount, they can have more space for filenames/pathnames.
Comment 2 shishir gowda 2011-04-27 04:10:17 EDT
gluster> volume create new1231 sng:/tmp/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
Failed to store the Volume information

But trying to create the volume again fails:
gluster> volume create new1231 sng:/tmp/_
Volume new1231 already exists

Volume info does not display the volume details

error in log:

[2011-04-27 13:34:06.509006] E [glusterd-store.c:952:glusterd_store_handle_new] 0-glusterd: Failed to open file: /etc/glusterd/vols/new1231/bricks/sng:-tmp-_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789, error: File name too long
[2011-04-27 13:34:06.509064] E [glusterd-store.c:85:glusterd_store_handle_create_on_absence] 0-: Unable to create store handle for path: /etc/glusterd/vols/new1231/bricks/sng:-tmp-_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
[2011-04-27 13:34:06.509173] E [glusterd-op-sm.c:6536:glusterd_op_ac_send_commit_op] 0-: Commit failed

$echo "/etc/glusterd/vols/new1231/bricks/sng:-tmp-_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789" |wc -c
Comment 3 Anand Avati 2011-05-04 05:00:07 EDT
PATCH: http://patches.gluster.com/patch/7123 in master (glusterd: Cleaned up 'store' if vol create fails.)
Comment 4 Anand Avati 2011-05-04 05:00:11 EDT
PATCH: http://patches.gluster.com/patch/7127 in master (glusterd: Checked brick path length in 'staging'.)
Comment 5 krishnan parthasarathi 2011-05-04 05:43:30 EDT
Root cause:
glusterd didn't clean up it's internal store if volume create failed. 
The fix address that and also checks if the 'brick path' supplied is too long and fails the operation immediately with an error message.

Steps to reproduce:

gluster> volume create vol-name really-long-brickpath
gluster> volume add-brick vol-name really-long-brickpath
gluster> volume replace-brick vol-name src-brick really-long-brickpath

For a 'really-long-brickpath', see description of the bug.

For each of the subcommands above, check if:
1) there is a directory with the volume's name under the glusterd's 'working dir'/vols (/etc/glusterd/vols by default).
2) Error message in glusterd log reporting the error.
3) Error message in cli.
Comment 6 Raghavendra Bhat 2011-07-26 05:44:14 EDT
Tried the same command and got the below error.

gluster volume create kkk bigbang:/tmp/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
brick path bigbang:/tmp/_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789 is too long.
Comment 7 marypablate@outlook.com 2014-01-28 10:00:40 EST
Well, you can use Long Path Tool for such problems....