9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Plan 9 wiping itself?
Date: Wed, 28 Nov 2007 09:35:25 -0500	[thread overview]
Message-ID: <20071128143526.D3AE21E8C22@holo.morphisms.net> (raw)
In-Reply-To: <140e7ec30711272343x6f017db3v90053f21cb161884@mail.gmail.com>

>  The changes sound great, and eliminate my above doomsday scenario...
> unless something goes really wrong with the replica log. Is it
> replica/updatededb that is the culprit or just the way it is run in
> replica/scan? It strikes me that if it is forced to abort for some
> reason it should avoid updating the log at all.

Actually the problem was that updatedb *wasn't* aborting.
The network connection got lost halfway, so a lot of files "disappeared"
so updatedb thought they had been deleted.  And then it found
them the next time it ran.  I just submitted a fix so that it will
notice network errors and stop before inferring file deletions.
This won't happen again (and if it does, pull is smarter anyway).

>  By they way, any idea why the replica/pull -n output is so confusing
> in this situation? It lists a lot of "a"s for files which already
> exist (eg 386/9pc 386/auth/factotum sys/src/9/boot/boot.h) (in
> alphabetic order?), then a lot of "d"s (in reverse alphabetical
> order?), and then I have some legitimate c/a/ds (sys/src/games/mp3enc)
> on account of I haven't pulled in awhile. But the initial
> additions/deletions are disjoint sets as far as I can tell - why don't
> I see deletions followed by additions for the same files?

The log occasionally gets compressed (really, canonicalized)
to remove redundant events.  When that happens, the canonical
replacement form is an "a" event for every file on the system 
followed by a "d" for every file that existed in the past and got deleted.
Putting the "d" events in reverse alphabetical order deletes files
before their parent directories.  The two sets are disjoint because
redundant event sequences have been collapsed into a single "a" or "d".

Geoff compressed the log yesterday so that the big
"delete /sys/src and then recreate it" sequence would go away.
And then after compressing the log a few more entries got added.

There's not a lot of difference between "a" and "c".  If the log says "a"
but the file already exists (and was created by replica) then it's
treated as a "c".  The "a" events you saw were really the "c" events
that had happened before the log got compressed and that you
hadn't yet pulled.  Probably "c" should go away.

Russ


  reply	other threads:[~2007-11-28 14:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23 23:29 Pietro Gagliardi
2007-11-24 17:44 ` Antonin Vecera
2007-11-24 17:46   ` Pietro Gagliardi
2007-11-24 18:43     ` Uriel
2007-11-28  4:21       ` Russ Cox
2007-11-28  7:43         ` sqweek
2007-11-28 14:35           ` Russ Cox [this message]
2007-11-28 16:29             ` Douglas A. Gwyn
2007-11-30  4:58               ` sqweek
2007-11-24 20:59     ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071128143526.D3AE21E8C22@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).