9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Killing venti
@ 2012-01-03 17:21 smiley
  2012-01-03 17:30 ` Russ Cox
  0 siblings, 1 reply; 6+ messages in thread
From: smiley @ 2012-01-03 17:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Yeah, I know, pull out a sharp knife, and jab real hard...

No, really.  What's the prescribed way to kill a venti server, safely,
without losing data?  The approach I've been using on p9p has been:

  (1) Wait for venti to stop writing to disk.
  (2) Send venti SIGTERM.

The venti process dies, sure enough, but I later get errors that some
blocks haven't been stored.  (Whether they weren't stored, or were
stored and just failed to get indexed or Bloomed, I don't know.)

So, what's the proper way to do this?  Is there something like "echo
pleasedieimaskingnicely > /tmp/ns.smiley:1/venti.ctl" I can use?

--
+---------------------------------------------------------------+
|Smiley       <smiley@icebubble.org>    PGP key ID:    BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA  3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Killing venti
  2012-01-03 17:21 [9fans] Killing venti smiley
@ 2012-01-03 17:30 ` Russ Cox
  2012-01-05 17:35   ` smiley
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2012-01-03 17:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

run venti/sync.
then kill it.

russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Killing venti
  2012-01-03 17:30 ` Russ Cox
@ 2012-01-05 17:35   ` smiley
  2012-01-05 18:21     ` David du Colombier
  2012-01-05 19:12     ` Russ Cox
  0 siblings, 2 replies; 6+ messages in thread
From: smiley @ 2012-01-05 17:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Russ Cox <rsc@swtch.com> writes:

> run venti/sync.

Ah.  Cool.  Gotta love those undocumented commands.  :) While probing
the distal edges of Venti's documented functionality, I also came across
the following, which have similar (but not identical) effect:

hget http://$vthost:$vtwebport/flushicache
hget http://$vthost:$vtwebport/flushdcache

These HTTP requests initiate flushes of the index and arena block
caches, respectively, and don't return a response until the respective
flush is complete.

--
+---------------------------------------------------------------+
|Smiley       <smiley@icebubble.org>    PGP key ID:    BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA  3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Killing venti
  2012-01-05 17:35   ` smiley
@ 2012-01-05 18:21     ` David du Colombier
  2012-01-06 17:20       ` smiley
  2012-01-05 19:12     ` Russ Cox
  1 sibling, 1 reply; 6+ messages in thread
From: David du Colombier @ 2012-01-05 18:21 UTC (permalink / raw)
  To: 9fans

venti/sync calls vtsync which is documented in venti-client(2).

Hopefully, you don't have to flush the dcache or icache before
shutting down Venti. Especially since flushing the icache will
likely take a very long time.

--
David du Colombier



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Killing venti
  2012-01-05 17:35   ` smiley
  2012-01-05 18:21     ` David du Colombier
@ 2012-01-05 19:12     ` Russ Cox
  1 sibling, 0 replies; 6+ messages in thread
From: Russ Cox @ 2012-01-05 19:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thu, Jan 5, 2012 at 12:35 PM,  <smiley@icebubble.org> wrote:
>> run venti/sync.
>
> Ah.  Cool.  Gotta love those undocumented commands.  :) While probing
> the distal edges of Venti's documented functionality, I also came across
> the following, which have similar (but not identical) effect:
>
> hget http://$vthost:$vtwebport/flushicache
> hget http://$vthost:$vtwebport/flushdcache
>
> These HTTP requests initiate flushes of the index and arena block
> caches, respectively, and don't return a response until the respective
> flush is complete.

Honestly, you don't even have to run venti/sync.
Every command that writes to venti ends by doing
a sync.

You probably don't want to use those hget commands.
They are safe, of course, but it is equally safe not to
run them.  The icache in particular can take a long time to
flush, and venti will recover the entries (in less time than
the flush would have taken) the next time it starts.

Russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Killing venti
  2012-01-05 18:21     ` David du Colombier
@ 2012-01-06 17:20       ` smiley
  0 siblings, 0 replies; 6+ messages in thread
From: smiley @ 2012-01-06 17:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

David du Colombier <0intro@gmail.com> writes:

> venti/sync calls vtsync which is documented in venti-client(2).

Yeah, the Venti request is documented.  The utility venti/sync isn't.
Neither are venti/mirrorarenas, venti/dump, etc.  For those, you have to
read^H^H^H^H decipher the source.

Russ Cox <rsc@swtch.com> writes:

> Honestly, you don't even have to run venti/sync.
> Every command that writes to venti ends by doing
> a sync.

It would be nice if that worked.  However, it has not been my
experience.  As noted earlier in the thread, when I killall -TERM venti
without venti/sinc, I lost data.  Keep in mind this is p9p.

> run them.  The icache in particular can take a long time to
> flush, and venti will recover the entries (in less time than
> the flush would have taken) the next time it starts.

Recover them?  I thought the index was supposed to index all clumps in
the arenas.  How would venti know, on startup, if its index is
incomplete?  Posed differently, how could venti know which index entries
are missing, without rebuilding the entire index?

It could very well be that my data was actually written to the arena,
but just not indexed (or not yet "recovered" by the time I asked for
it).

--
+---------------------------------------------------------------+
|Smiley       <smiley@icebubble.org>    PGP key ID:    BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA  3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-06 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 17:21 [9fans] Killing venti smiley
2012-01-03 17:30 ` Russ Cox
2012-01-05 17:35   ` smiley
2012-01-05 18:21     ` David du Colombier
2012-01-06 17:20       ` smiley
2012-01-05 19:12     ` Russ Cox

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).