Hide Forgot
When creating and deleting a sparse file, the available space is not allocated and released consistently. 1. Create a replicated volume (gluster volume create test1 replica 2 server1:/var/spool/gluster/disk1 server2:/var/spool/gluster/disk1) 2. mount the replicated volume (mount -t glusterfs server1:test1 /mnt/test1) 2. df # note the available space (in my test it is 2498816) 3. dd if=/dev/zero of=/mnt/test1/testfile1 bs=1 count=1 seek=1M # create a sparse file 4. df # the available space has decreased by 1M (2498688) 5. rm /mnt/test1/testfile1 6. df # the available space has not increased (2498688) This behavior is not reproducible in 3.0.7.
(In reply to comment #0) > When creating and deleting a sparse file, the available space is not allocated > and released consistently. > > 1. Create a replicated volume (gluster volume create test1 replica 2 > server1:/var/spool/gluster/disk1 server2:/var/spool/gluster/disk1) > 2. mount the replicated volume (mount -t glusterfs server1:test1 /mnt/test1) > 2. df # note the available space (in my test it is 2498816) > 3. dd if=/dev/zero of=/mnt/test1/testfile1 bs=1 count=1 seek=1M # create a > sparse file > 4. df # the available space has decreased by 1M (2498688) > 5. rm /mnt/test1/testfile1 > 6. df # the available space has not increased (2498688) > > This behavior is not reproducible in 3.0.7. This is working fine for me with the *master* branch. pranith @ /mnt/client 11:18:17 :) $ df /mnt/client Filesystem 1K-blocks Used Available Use% Mounted on pranith-laptop:/vol 96178944 5011456 86281856 6% /mnt/client pranith @ /mnt/client 11:18:28 :) $ sudo dd if=/dev/zero of=testfile1 bs=1 count=1 seek=1M 1+0 records in 1+0 records out 1 byte (1 B) copied, 0.00327276 s, 0.3 kB/s pranith @ /mnt/client 11:18:51 :) $ df /mnt/client Filesystem 1K-blocks Used Available Use% Mounted on pranith-laptop:/vol 96178944 5011456 86281856 6% /mnt/client pranith @ /mnt/client 11:18:53 :) $ df /mnt/client Filesystem 1K-blocks Used Available Use% Mounted on pranith-laptop:/vol 96178944 5011456 86281728 6% /mnt/client pranith @ /mnt/client 11:20:43 :) $ sudo rm -f testfile1 pranith @ /mnt/client 11:20:50 :) $ df /mnt/client Filesystem 1K-blocks Used Available Use% Mounted on pranith-laptop:/vol 96178944 5011456 86281856 6% /mnt/client pranith @ /mnt/client 11:21:33 :) $ sudo gluster volume info Volume Name: vol Type: Replicate Status: Started Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: pranith-laptop:/tmp/1 Brick2: pranith-laptop:/tmp/2
hi, It is working as expected for me. Please re-open the bug if it is observed again. It is better to use "df -B 1 <mount-path>" instead of just df to avoid rounding to nearest block size. Pranith.