Bug 1023120

Summary: Appending data to a file using Vi editor violates quota limits
Product: Red Hat Gluster Storage Reporter: shylesh <shmohan>
Component: quotaAssignee: Raghavendra G <rgowdapp>
Status: CLOSED WONTFIX QA Contact: storage-qa-internal <storage-qa-internal>
Severity: high Docs Contact:
Priority: low    
Version: 2.1CC: grajaiya, rhs-bugs, spalai, storage-qa-internal, vagarwal, vbellur, vmallika
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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: Environment:
Last Closed: 2015-01-16 08:07:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1182890, 1182921    
Bug Blocks:    

Description shylesh 2013-10-24 16:38:29 UTC
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):
3.4.0.36rhs-1.el6rhs.x86_64

How reproducible:
always

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 11:01:19 UTC
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 18:07:48 UTC
[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 13:36:00 UTC
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.