Bug 1398720

Summary: discard is missing from the / mount options
Product: [oVirt] ovirt-node Reporter: Fabian Deutsch <fdeutsch>
Component: Installation & UpdateAssignee: Yuval Turgeman <yturgema>
Status: CLOSED CURRENTRELEASE QA Contact: Qin Yuan <qiyuan>
Severity: medium Docs Contact:
Priority: high    
Version: 4.0CC: bugs, cshao, ycui
Target Milestone: ovirt-4.0.7Flags: rule-engine: ovirt-4.0.z?
fdeutsch: ovirt-4.1?
fdeutsch: planning_ack?
fdeutsch: devel_ack+
ycui: testing_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 11:38:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Fabian Deutsch 2016-11-25 16:44:55 UTC
Description of problem:
It is important that / is mounted with discard to ensure that freed space is also getting freed in the thin pool.
Otherwise the thin pool will suffer from free space starvation.

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

How reproducible:
?

Steps to Reproduce:
1. Install Node/RHVH
2. Check if discard mount option is used on /
3. Update
4. Check if discard mount option is used on /

Actual results:


Expected results:


Additional info:

Comment 1 Yaniv Kaul 2016-11-26 08:29:24 UTC
There is a systemd timer that runs fstrim periodically. Configure it to run once a day - more efficient than the above.

Comment 2 Fabian Deutsch 2016-11-26 21:23:47 UTC
I actually wonder if the fstrim service is a higher risk.
Because the service is calling fstrim -a which will trim all mounted file-systems which support discard - and the mounted filesystms are pretty unpredictable.

By relying on the discard mount option we ensure that only "our" file-systems will be trimmed.

Another thing to conside ris that a fstrim timer is probably as unpredictable as a garbage collector: It will kick in at some point an might degrade performance - and the runtime depends on the pilled up data to be freed. We've got a spike behavior.

By using the mount option we have a constant - but more predeictive impact, as we don't pile up a mount of data to be freed.

Comment 3 Yaniv Kaul 2016-12-01 13:23:23 UTC
(In reply to Fabian Deutsch from comment #2)
> I actually wonder if the fstrim service is a higher risk.
> Because the service is calling fstrim -a which will trim all mounted
> file-systems which support discard - and the mounted filesystms are pretty
> unpredictable.

It is predictable and safe. People have been doing it (unknowingly) for several Fedora releases.

> 
> By relying on the discard mount option we ensure that only "our"
> file-systems will be trimmed.
> 
> Another thing to conside ris that a fstrim timer is probably as
> unpredictable as a garbage collector: It will kick in at some point an might
> degrade performance - and the runtime depends on the pilled up data to be
> freed. We've got a spike behavior.

It has no performance impact these days. It used to, in the distant past.
> 
> By using the mount option we have a constant - but more predeictive impact,
> as we don't pile up a mount of data to be freed.


Anyway, moving to 4.0.7. Not critical.

Comment 4 Fabian Deutsch 2016-12-01 13:57:31 UTC
If it is as in comment 3 then it should really not make a difference - and the service solution is easier.

Comment 5 Ying Cui 2016-12-13 14:50:15 UTC
Fabian, discard was already set to / from the mount options since RHVH 4.0 GA.. The block device reclaim space freed. 
Let's see the final solution by devel.

Comment 6 Fabian Deutsch 2016-12-20 11:38:47 UTC
Closing this according to comment 5.

The original bug was probably a manual change.