Fix possible dead locks when running the propagator caused by two
requests updating the same amount rows in transactions.
- Lock rows always in the same deterministic order by sorting the
path_hash first
- On all database outside of sqlite, also do first a SELECT FOR UPDATE
to lock all the rows used in batch UPDATE calls, afterward to decrease
the risk of two requests trying to lock the same rows
Signed-off-by: Carl Schwan <carlschwan@kde.org>
normally this shouldn't be a problem, but cache/storage desync might cause this
so this adds some failsafe to ensure we dont corrupt the cache further
the minimum value is set to -1 instead of 0 in order to triger a background scan
on the folder and figure out the size properly
Signed-off-by: Robin Appelman <robin@icewind.nl>