Bug 1023120 - Appending data to a file using Vi editor violates quota limits
Appending data to a file using Vi editor violates quota limits
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: quota (Show other bugs)
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Raghavendra G
Depends On: 1182890 1182921
  Show dependency treegraph
Reported: 2013-10-24 12:38 EDT by shylesh
Modified: 2016-09-17 08:40 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Expected behavior of quota: If the rate of I/O is more than the value of hard-timeout and soft-timeout, there is possibility of quota limit being exceeded For example: If the rate of IO is 1GB/sec If hard-timeout is set to 5sec (default value). If soft-timeout is set to 60sec (default value). Then we may exceed quota limit by ~30GB - 60GB In order to attain a strict checking of quota limit, then you need to lower the value of hard-timeout and soft-timeout Command to set timeout: gluster volume quota <volume-name> soft-timeout 0 gluster volume quota <volume-name> hard-timeout 0
Story Points: ---
Clone Of:
Last Closed: 2015-01-16 03:07:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description shylesh 2013-10-24 12:38:29 EDT
Description of problem:

When we have reached the quota limit opening a file in Vi editor and appending the data violates the quota limits and data will be successfully written to the file.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.created a 6x2 distributed replicate volume 

2. create some files on the mount point using dd till we reach the quota limit
(make sure that not even a single byte is left to fill up quota , which makes 
sure that even writing a single character to file violates quota)

3. to make sure that we have reached the quota limit try to append from the shell , say echo "hello" >> file , this should fail in appending data.

4.now open any file in Vi and append some data towards the end of the file 

5. save and quit

Actual results:
data will be successfully written to the file there by violating quota limits

Expected results:

Additional info:
Comment 2 Gowrishankar Rajaiyan 2013-11-09 06:01:19 EST
I see ""shanks.txt" E212: Can't open file for writing" when disk quota is already exceeded in a directory and you try to write a file using vim.

I also happened to see:
[shanks@localhost Music]$ vim shanks.txt
E72: Close error on swap file
[shanks@localhost Music]$

Needs further testing.
Comment 3 Susant Kumar Palai 2014-01-12 13:07:48 EST
[root@vm1 home]# gluster volume quota test1 list 
                  Path                   Hard-limit Soft-limit   Used  Available  Soft-limit exceeded? Hard-limit exceeded?
/                                        100.0KB       80%       1.7MB  0Bytes             Yes                  Yes

I tried similar steps. After quota limit is reached tried to edit and save the file in vim and got the following error message while saving 

"file1" E512: Close failed
WARNING: Original file may be lost or damaged
do not quit the editor until the file is successfully written!
Press ENTER or type command to continue
Comment 4 Vijaikumar Mallikarjuna 2015-01-12 08:36:00 EST
This needs to be documented:

When the quota hard-timeout is set to default value of 30,
the quota limit is checked once in 30 seconds and during
that 30 second time window there is possibility of quota
hard-limit being exceeded. In order to attain a strict
checking of quota limit it is recommended to set the
quota soft-timeout and hard-timeout to lower value so
that quota limit is checked frequently, and possibility of
quota hard-limit being exceeded is reduced.

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