Discussion:
[9fans] Killing venti
(too old to reply)
s***@icebubble.org
2012-01-03 17:21:31 UTC
Permalink
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 <***@icebubble.org> PGP key ID: BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA 3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+
Russ Cox
2012-01-03 17:30:05 UTC
Permalink
run venti/sync.
then kill it.

russ
s***@icebubble.org
2012-01-05 17:37:45 UTC
Permalink
Post by Russ Cox
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 <***@icebubble.org> PGP key ID: BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA 3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+
David du Colombier
2012-01-05 18:24:01 UTC
Permalink
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
s***@icebubble.org
2012-01-06 17:20:48 UTC
Permalink
Post by David du Colombier
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.
Post by David du Colombier
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.
Post by David du Colombier
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 <***@icebubble.org> PGP key ID: BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA 3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+
Russ Cox
2012-01-05 19:12:54 UTC
Permalink
Post by Russ Cox
run venti/sync.
Ah.  Cool.  Gotta love those undocumented commands.  :) While probing
the distal edges of Venti's documented functionality, I also came across
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
Continue reading on narkive:
Loading...