Hi Michael, That sounds like a neat idea. Especially, with the proliferation of more complex filesystems like BTRFS, the penalty of calling fsyc() a lot becomes very visible. I’m not a BTRFS user myself, but I always hear comments and discuss about it.
Removing this workaround can help to remove the myth that apt is slow. Happy new year, Cheers, Hakan > On 24 Dec 2024, at 12:54, Michael Tokarev <m...@tls.msk.ru> wrote: > > Hi! > > The no-unsafe-io workaround in dpkg was needed for 2005-era ext2fs > issues, where a power-cut in the middle of filesystem metadata > operation (which dpkg does a lot) might result in in unconsistent > filesystem state. This workaround slowed down dpkg operations > quite significantly (and has been criticised due to that a lot, > the difference is really significant). > > The workaround is to issue fsync() after almost every filesystem > operation, instead of after each transaction as dpkg did before. > > Once again: dpkg has always been doing "safe io", the workaround > was needed for ext2fs only, - it was the filesystem which was > broken, not dpkg. > > Today, doing an fsync() really hurts, - with SSDs/flash it reduces > the lifetime of the storage, for many modern filesystems it is a > costly operation which bloats the metadata tree significantly, > resulting in all further operations becomes inefficient. > > How about turning this option - force-unsafe-io - to on by default > in 2025? That would be a great present for 2025 New Year! :) > > Thanks, > > /mjt