Le 2024-12-26 13:23, Simon Richter a écrit :
On SSDs, it does not matter, both because modern media lasts longer
than the rest of the computer now, and because the load balancer will
largely ignore the logical block addresses when deciding where to put
data into the physical medium anyway.
I'm not so sure about that, especially on cheaper and smaller storage.
There are still recent reports of people being able to wear e.g. SD
cards to the point of failure in weeks or months though that's certainly
not with system updates alone. This matters more on embedded devices
where the storage is not always (easily) replaceable, and some of these
devices may have fairly long lifespans.
[transactional FS]
It would be easier to do in Linux than in Windows
... but is sounds very much like we are not anywhere near there yet,
while others had it working and are now running away from it.
Snapshots only work if there is a way to merge them back afterwards.
What the systemd people are doing with immutable images basically goes
in the direction of snapshots -- you'd unpack the files using "unsafe"
I/O, then finally create an image, fsync() that, and then update the OS
metadata which image to load at boot.
For integration with dpkg I think the reverse approach would work
better: the snapshot would only be used to perform a rollback while
rebooting after a system crash. In the nominal case it would just be
deleted automatically at the end of the update procedure, after
confirming that everything is actually written on the medium.
Anyway currently that option is unavailable on most installed systems.
- io_uring
That would be Linux specific, though.
Not an issue IMO. On systems that can't have it or another similar API
dpkg could just fall back to using the good old synchronous API, with
the same performance we have today.
My feeling is that this is becoming less and less relevant though,
because it does not matter with SSDs.
A volunteer it still needed to bench a few runs of large system updates
on ext4/SSD with and without --force-unsafe-io to sort that out ;)
Cheers,
--
Julien Plissonneau Duquène