Bug 762409 (GLUSTER-677) - stripe : after truncate file show increased size
Summary: stripe : after truncate file show increased size
Keywords:
Status: CLOSED NOTABUG
Alias: GLUSTER-677
Product: GlusterFS
Classification: Community
Component: stripe
Version: mainline
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Amar Tumballi
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-24 07:46 UTC by Lakshmipathi G
Modified: 2013-12-19 00:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTNR
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Lakshmipathi G 2010-02-24 07:46:37 UTC
Created 80MB file with chunk size 100MB.

stripe_mntpt# stat 80MB.txt 
  File: `80MB.txt'
  Size: 81920000  	Blocks: 160032     IO Block: 131072 regular file
Device: 15h/21d	Inode: 2884543     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:40.000000000 +0530
Modify: 2010-02-24 12:55:43.000000000 +0530
Change: 2010-02-24 12:55:43.000000000 +0530


Check it's size in backend 

export1]$ stat 80MB.txt 
  File: `80MB.txt'
  Size: 81920000  	Blocks: 160008     IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 2884543     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:40.000114794 +0530
Modify: 2010-02-24 12:55:43.665112524 +0530
Change: 2010-02-24 12:55:43.665112524 +0530

export2]$ stat 80MB.txt 
  File: `80MB.txt'
  Size: 0         	Blocks: 8          IO Block: 4096   regular empty file
Device: fd00h/64768d	Inode: 2884541     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:39.999117041 +0530
Modify: 2010-02-24 12:55:39.999117041 +0530
Change: 2010-02-24 12:55:40.056115350 +0530

export3]$ stat 80MB.txt 
  File: `80MB.txt'
  Size: 0         	Blocks: 8          IO Block: 4096   regular empty file
Device: fd00h/64768d	Inode: 2884542     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:39.999117041 +0530
Modify: 2010-02-24 12:55:39.999117041 +0530
Change: 2010-02-24 12:55:40.055118365 +0530


Now decrease the file size by half.

stripe_mntpt# truncate -s 40MB 80MB.txt

Then check backend dirs.

export1]$ stat 80MB.txt 
  File: `80MB.txt'
  Size: 40000000  	Blocks: 78136      IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 2884543     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:40.000114794 +0530
Modify: 2010-02-24 12:57:10.195369416 +0530
Change: 2010-02-24 12:57:10.195369416 +0530

export1 is okay.

export2$stat 80MB.txt 
  File: `80MB.txt'
  Size: 40000000  	Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 2884541     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:39.999117041 +0530
Modify: 2010-02-24 12:57:10.195369416 +0530
Change: 2010-02-24 12:57:10.195369416 +0530



 export3$ stat 80MB.txt 
  File: `80MB.txt'
  Size: 40000000  	Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 2884542     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-02-24 12:55:39.999117041 +0530
Modify: 2010-02-24 12:57:10.198361347 +0530
Change: 2010-02-24 12:57:10.198361347 +0530




export2 , export3 file size has increased.

Comment 1 Amar Tumballi 2010-03-01 04:30:39 UTC
This behavior is expected. 

Please notice the 'blocks' field in the stat info you have provided, and it clearly shows that even though sizeof the file is increased, it will be not consuming any more space in backend disk. 

Also this behavior doesn't effect any operations over stripe translator. Also, user need not bother about the backend layout of the file while using GlusterFS.

As this is not a bug, but is a valid behavior of stripe, marking it as Invalid.

Regards,
Amar


Note You need to log in before you can comment on or make changes to this bug.