FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-14-2009, 04:45 AM
Allan McRae
 
Default libalpm: sync changes to disc when appropriate

Dan McGee wrote:

On Fri, Mar 13, 2009 at 9:55 PM, Allan McRae <allan@archlinux.org> wrote:


Dan McGee wrote:


We don't make calls to fsync() or fdatasync() when we are attempting to do
something transactionally, such as writing out one of our DB entries. Add
a
call to fdatasync() when we write DB entries, and also ensure we sync our
log changes to disc whenever we close it.

Another important thing to ensure is that we commit removals of DB
entries.
The method isn't necessarily pretty, but it works in _alpm_db_remove().



This looks good to me.
Just wonding how much overhead the fsyncing adds? Have you noticed any speed
decrease when running with this patch? Not that there is much choice here...



Little if any, actually, as we are syncing only our DB files and not
all of the files we lay down on disk. For the most part pacman is
already I/O bound, so this doesn't add any noticeable hiccups.



OK, that sounds good. BTW, won't all files will be synced if partitions
are mounted with the "ordered" option? But that is a users choice, so...


Allan



_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://www.archlinux.org/mailman/listinfo/pacman-dev
 
Old 03-14-2009, 12:48 PM
Thomas Bächler
 
Default libalpm: sync changes to disc when appropriate

Dan McGee schrieb:

Anyway, I am not opposed to a new quick maint release, this decision
is up to Dan anyway. I am just saying I don't see a big need for it.
And in any cases, we should try to move forward for a 3.3 release


I never said quick with this stuff at all. Does your system crash all
the time? Or ever? Mine sure doesn't- I'm in little rush to get this
out.


I only wanted this patch to be applied to the maint branch, I never said
we should release it NOW.



Thomas points to one case where his system does, but in that case he
is going to have a lot of broken stuff as he says as other apps also
do it wrong as well.


This case is actually a VERY common case. You experiment with new
applications:

1) Install new package
2) Try it
3) It crashes your machine (because you are running experimental
software with experimental kernel interfaces)
4) You just installed the package 10 seconds before the crash, so now
your pacman db is corrupted


My point is, running pacman directly before a system crash might be more
common than you might think. Or the other way around: System crashes are
more likely to happen directly after a pacman action than at any other time.



My main point here is just to do it right- I'm
not trying to address a specific problem, just the general concern
that is "if I write a file and my app exits, can I be sure it actually
got written?".


Yes, of course we should ensure that our db is in a consistent state
when pacman exits, I am glad this has been done so fast.



Thomas- I believe you are right, we should sync the db directory when
we write to it as well.


Okay.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://www.archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 08:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org