[pacman-dev] delay writes a fsync
shiningxc at gmail.com
Thu Mar 12 06:18:25 EDT 2009
On Thu, Mar 12, 2009 at 9:19 AM, Allan McRae <allan at archlinux.org> wrote:
> You have probably heard about this:
> Here is the link to the bug report that describes the cause of the problem:
> A key part of the bug report comment...
> Applications are expected to use fsync() or fdatasync(), and if that impacts
> their performance too much, to use a single berkdb or other binary database
> file, and not do something stupid with hundreds of tiny text files that only
> hold a few bytes of data in each text file.
> Hmmm... something sound familiar there?
> So what should we do? Maybe, add some sort of syncing after a db write. But
> then after each file or just at the end of the transaction?
If I remember correctly, the code does this :
pkg1 : extract files ; write db entry
pkg2 : extract files ; write db entry
So yeah, it could make sense to sync after each db write to have a
consistent database after each package install.
Otherwise, go go sqlite :)
More information about the pacman-dev