FS#41818 - [lvm2] please consider using the default issue_discards = 1

Attached to Project: Arch Linux
Opened by need to rename username but can't, guess I'll create a new one then (m4cz3) - Thursday, 04 September 2014, 11:11 GMT
Last edited by freswa (frederik) - Tuesday, 22 September 2020, 11:37 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Hi.

maybe /etc/lvm.conf could have (by default) issue_discards = 1 seems safe because it says above:
# ... If set
# to 1, discards will only be issued if both the storage and kernel provide support.


Thanks.

Additional info:
* package version(s)
Name : lvm2
Version : 2.02.109-2
Description : Logical Volume Manager 2 utilities
Architecture : x86_64

* config and/or log files etc.

# This section allows you to configure which block devices should
# be used by the LVM system.
devices {
....
# Issue discards to a logical volumes's underlying physical volume(s) when
# the logical volume is no longer using the physical volumes' space (e.g.
# lvremove, lvreduce, etc). Discards inform the storage that a region is
# no longer in use. Storage that supports discards advertise the protocol
# specific way discards should be issued by the kernel (TRIM, UNMAP, or
# WRITE SAME with UNMAP bit set). Not all storage will support or benefit
# from discards but SSDs and thinly provisioned LUNs generally do. If set
# to 1, discards will only be issued if both the storage and kernel provide
# support.
# 1 enables; 0 disables.
issue_discards = 0
}


Steps to reproduce:
pacman -S lvm2
This task depends upon

Closed by  freswa (frederik)
Tuesday, 22 September 2020, 11:37 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Upstream says no.
Comment by Thomas Bächler (brain0) - Thursday, 04 September 2014, 16:14 GMT
So, IIRC the history is that issue_discards used to be experimental and broken, resulting in data loss, since it deleted the wrong parts of the hard drive. We should ask upstream why it is disabled by default.
Comment by Konstantin Gizdov (kgizdov) - Friday, 01 April 2016, 11:54 GMT
Just noticed this. I would like to voice my opinion against this being implemented. Discards by default are bad for encrypted volumes. Also, it is generally a better option to use a scheduled systemd service to trim the drive, as on-the-go LVM discards can be bad for data recovery for example.
Comment by nl6720 (nl6720) - Friday, 03 April 2020, 17:10 GMT
  • Field changed: Percent Complete (100% → 0%)
This is still an issue.
issue_discards = 1 is useful on thin provisioned logical volumes (regardless of the underlying disk hardware).
Comment by loqs (loqs) - Saturday, 19 September 2020, 22:04 GMT
@nl6720 have you asked upstream if they are willing to change the default?
Comment by nl6720 (nl6720) - Tuesday, 22 September 2020, 09:36 GMT
Here's my attempt at asking the question on the linux-lvm mailing list while trying to not make too much of a fool of myself: https://www.redhat.com/archives/linux-lvm/2020-September/msg00095.html .
I've also dug up (after the fact, of course) a related Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717313 .

Anyway, for this issue, the resolution is "No distribution should be setting issue_discards to '1' by default - it should be always changed by admin so he is aware of consequences." ( https://www.redhat.com/archives/linux-lvm/2020-September/msg00099.html )
I'm still trying to get some things clarified/stated explicitly so that I can update the wiki.

Loading...