[pacman-dev] delay writes a fsync

Xavier 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:
> Hi,
>
> You have probably heard about this:
> http://linux.slashdot.org/article.pl?sid=09/03/11/2031231
>
> Here is the link to the bug report that describes the cause of the problem:
> https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/317781/comments/54
>
> 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
etc ..

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 mailing list