Bug 1000604

Summary: allow user to switch thin-pool to read-only mode at a configurable low space threshold
Product: Red Hat Enterprise Linux 7 Reporter: Mike Snitzer <msnitzer>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, thornber, zkabelac
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1000611 (view as bug list) Environment:
Last Closed: 2020-08-19 21:16:16 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:
Embargoed:
Bug Depends On: 1000611, 1049591    
Bug Blocks: 1119323    

Description Mike Snitzer 2013-08-23 19:58:30 UTC
Description of problem:
When a DM thin-pool runs out of space it will automatically start queuing all outstanding IO destined to a thin device backed by that thin-pool.  This is similar to the dm-multipath "queue_if_no_path" option.

However, many times it is not desirable for the system to start queuing IO (potentially) indefinitely.  We do suggest the admin always have configured 1) a sane low water mark 2) enough free space in the VG that should the low water mark be hit, lvm2 will resize the volume.

BUT admins may _never_ want to queue IO if it comes to the fact that the thin-pool has actually ran out of space.

I discussed having the kernel manage transitioning a thin-pool from read-write access to read-only based on a low space threshold (likely one that is below the low water mark).  But Joe pointed out that there is no reason for this policy to be in the kernel.

Proposal is for lvm2 to:
   expose something like "read_only_if_low_space_threshold" in lvm.conf
   - if 100, then read_only transition is disabled.
   - if < 100, then once the free space reaches this percentage, switch to read-only


Additional info:

The existing kernel mechanism for controlling read_only vs read_write access is to use the "read_only" feature flag on thin-pool table load.

SO lvm2 could selectively reload the thin-pool table either with or without the "read_only" feature based on the lvm.conf "read_only_if_low_space_threshold".

BUT.. there is a dm-thin kernel bug/limitation that disallows transitioning a thin-pool table from RO back to RW via table reload.  This would obviously need to be fixed.

Comment 2 RHEL Program Management 2014-03-22 06:40:54 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Mike Snitzer 2014-07-18 21:02:02 UTC
Even though kernel bug#1049591 that this bug depended on is fixed, I'm left wondering if this feature is desirable.

We now have the 'error_if_no_space' feature too...

So I'm open to whatever others think is best.  But no sense creating make work for ourselves (with this "read_only_if_low_space_threshold" feature) if no customers are asking for that functionality.