9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@9fans.net
Subject: Re: [9fans] venti: mem=sealed vs disk=sealed
Date: Fri,  4 Jul 2008 11:44:23 -0400	[thread overview]
Message-ID: <20080704154219.1AC3E1E8C26@holo.morphisms.net> (raw)
In-Reply-To: <68ac7f3d0807040249g53f2575ekb64f158eedb96db8@mail.gmail.com>

> When asking for the "/index" URL to venti server, some arenas appear
> having the "disk=sealed" flag in addition to the "mem=sealed" flag,
> and some other don't.  I fail to see any mention of it in the
> documentation, and a quick review of the source code makes me think
> that it is related to "icachedirty", which I guess means that some of
> the clumps in that arena have not yet gone into the index.  Am I
> right?

mem=sealed means that the arena has filled
and venti has stopped adding blocks to it,
moving on to the next arena.

disk=sealed means that venti has computed
the sha1 of the entire arena (the "seal") and
recorded it at the end of the arena.

for not very good technical reasons, venti won't
bother computing the seal until the arena blocks
are fully indexed, but logically these are independent.

also, and for good reason, venti doesn't bother
computing the seal if there is useful disk i/o that it
could be doing instead.  it only runs the sealing
process in the background, in idle moments.

venti had a bug wherein it would not ever try to
seal arenas in certain cases.  i checked in an old
fix to this last night.  that fix also marks arenas
in the index listing that are in the "waiting to seal" queue.

> Well, the fact is that sometimes venti appears to be doing a hard work
> sealing arenas (I mean, indexing clumps), and sometimes it doesn't.
> Right now, in my venti server, I have 6 arenas with "mem=sealed but
> without "disk=sealed".  In addition to that, doing:

venti may be doing hard work indexing clumps
or it may be doing hard work sealing arenas.
probably the former, since sealing arenas isn't
very hard (streaming data off disk into sha1)
and doesn't last very long.

the real thing to check is whether the "written:" and
"indexed:" statistics match.  presumably in your
case they do not, but it is not a big deal.  the data
is committed once it shows up in the "written:" statistics.
if venti were to crash right now, it would add any clumps
between "indexed:" and "written:" back to its index cache
for future indexing when it restarted.

> hget 'http://127.1:8080/graph?arg=icachedirty&text=1' | tail -1
>
> gives always the same values: the "icachedirty" values doesn't change.
>
> Is this normal?  Is there any way to force venti to index clumps?

this is normal.  since indexing isn't critical to data integrity,
venti only bothers to flush the index cache when there are
enough dirty entries to be worthwhile or when the system
seems to be otherwise idle.

if this bothers you, you can hget http://venti/kickicache
to kick off a new indexing round.  hget flushicache will
not complete until the index cache is completely flushed
out to the index.

again, it doesn't matter for data integrity.

russ



      reply	other threads:[~2008-07-04 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04  9:49 Juan Céspedes
2008-07-04 15:44 ` Russ Cox [this message]

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=20080704154219.1AC3E1E8C26@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    /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).