bugfindutils - Bugs: bug #22057, updatedb "atomic rename"...

 
 

bug #22057: updatedb "atomic rename" is not atomic

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sat 19 Jan 2008 07:04:43 PM UTC  
 
Category: updatedbSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Justin PryzbyOpen/Closed: Closed
Release: 4.3.12Fixed Release: 4.3.13

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 09 Feb 2008 10:17:20 AM UTC, comment #2:

Fixed in 4.3.x.

James Youngman <jay>
Project AdministratorIn charge of this item.
Fri 25 Jan 2008 09:46:22 PM UTC, comment #1:

Running instances of locate will not notice, due to the semantics of Unix filesystems.

The resut may not be portable to Cygwin, but I think that's a matter best dealt with - if necessary - by patches in the Cygwin port.

James Youngman <jay>
Project AdministratorIn charge of this item.
Sat 19 Jan 2008 07:04:43 PM UTC, original submission:

This is http://bugs.debian.org/461585

8X-----------------------------------
An atomic rename involves a "mv" without an "rm", with the chmod on
the .n file beforehand.

|# To reduce the chances of breaking locate while this script is running,
|# put the results in a temp file, then rename it atomically.
|if test -s $LOCATE_DB.n; then
| rm -f $LOCATE_DB
| mv $LOCATE_DB.n $LOCATE_DB
| chmod 644 $LOCATE_DB
|else
8X-----------------------------------

I am forwarding this, since I am undecided whether this is actually a bug. Replacing

rm ; mv ; chmod

with

chmod 644 $LOCATE_DB.n
mv $LOCATE_DB.n $LOCATE_DB

has the bonus that $LOCATE_DB is present all the time. The downside is that an already running locate process might act strangely if its input data is changing.

cu andreas

Andreas Metzler <ametzler>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by ametzler
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Feb 2008 11:10:20 AM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.13
    Sat 09 Feb 2008 10:17:20 AM UTCjayStatusIn Progress=>Fixed
    Fri 25 Jan 2008 09:46:22 PM UTCjayStatusNone=>In Progress
      Assigned toNone=>jay
      ReleaseNone=>4.3.12
    Sat 19 Jan 2008 07:05:02 PM UTCametzlerCarbon-CopyRemoved 20807=>-
    Sat 19 Jan 2008 07:04:43 PM UTCametzlerCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1