9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] How to sync venti
@ 2002-09-03 12:07 arisawa
  2002-09-03 20:41 ` Dharani Vilwanathan
  0 siblings, 1 reply; 6+ messages in thread
From: arisawa @ 2002-09-03 12:07 UTC (permalink / raw)
  To: 9fans

Hello,

How can I sync venti to terminate safely?

Kenji Arisawa


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

* Re: [9fans] How to sync venti
  2002-09-03 12:07 [9fans] How to sync venti arisawa
@ 2002-09-03 20:41 ` Dharani Vilwanathan
  2002-09-03 20:47   ` Sean Quinlan
  0 siblings, 1 reply; 6+ messages in thread
From: Dharani Vilwanathan @ 2002-09-03 20:41 UTC (permalink / raw)
  To: 9fans


> How can I sync venti to terminate safely?

this is my concern too. i generally make sure there is no activity (no vac
or vacfs runs) and then kill the process. upon venti restart, things seem to
be fine. but still i am not sure if i can do that, venti being a disaster
recovery mechanism.





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

* Re: [9fans] How to sync venti
  2002-09-03 20:41 ` Dharani Vilwanathan
@ 2002-09-03 20:47   ` Sean Quinlan
  2002-09-04 12:49     ` arisawa
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Quinlan @ 2002-09-03 20:47 UTC (permalink / raw)
  To: 9fans

At the moment there is no "clean" way to kill the venti server
other than what you describe below.  On the other hand,
the system is designed to be reasonably robust so the
worst thing that can happen is that in flight writes
are lost - in particular, the on disk data structures will
not be corrupted (assuming the implementaion is correct of course).
In particular, when the server starts up, it scans the end region
of the data log and ensures that all the other data structures
reflect the state of the log, including the index, arena header and
arena directory.  In other words, once the data is stored in the
log, it should be ok.  I've been planning to add the ability for
applications to sync with the venti server.  There should also
be a way to ask the server to shut down...

seanq


Dharani Vilwanathan wrote:
>
> > How can I sync venti to terminate safely?
>
> this is my concern too. i generally make sure there is no activity (no vac
> or vacfs runs) and then kill the process. upon venti restart, things seem to
> be fine. but still i am not sure if i can do that, venti being a disaster
> recovery mechanism.


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

* Re: [9fans] How to sync venti
  2002-09-03 20:47   ` Sean Quinlan
@ 2002-09-04 12:49     ` arisawa
  2002-09-04 19:22       ` arisawa
  0 siblings, 1 reply; 6+ messages in thread
From: arisawa @ 2002-09-04 12:49 UTC (permalink / raw)
  To: 9fans

Thanks a lot, Dharani and Sean

I am now using venti and I am uneasy without that.
My feeling about vac is an engine, not a car.
I wrote some interface to vac and vacfs; the usage is:
	term% ve $home/bin/rc
	term% ve
	...
	2002/09/01 12:03 /usr/arisawa/venti/memo
	2002/09/01 12:06 /usr/arisawa/bin
	2002/09/01 13:34 /usr/arisawa/bin/rc
	2002/09/01 13:38 /usr/arisawa/bin/rc
	term%

	term% vefs 2002/09/01 12:06 /usr/a
	term% ls -l /n/vac
	d-rwxrwxr-x M 2516 arisawa arisawa 0 May  3 06:56 /n/vac/bin
	term% vafs nti/memo
	term% ls -l /n/vac
	--rw-rw-r-- M 2518 arisawa arisawa 37 Sep  1 09:12
/n/vac/memo
Thes codes are:
File: ve
	#!/bin/rc -e
	# name: ve
	# usage: ve [file]
	# coded by Kenji Arisawa
	log=$home/venti/log
	switch($#*){
	case 0
		awk '{print $2,$3,$4}' $log
	case 1
		if(! test -e $1){
			echo $1 not exist
			exit
		}
		d=`{date}
		# $d is: Sun Sep  1 17:43:14 JST 2002
		Jan=01;Feb=02;Mar=03;Apr=04;May=05;Jun=06;
		Jul=07;Aug=08;Sep=09;Oct=10;Nov=11;Dec=12
		day=$d(3)
		if(~ $#day 1)
			day=0^$day
		t=`{ifs=':' echo `{echo $d(4)}}
		t=$t(1)^':'^$t(2)
		d=$d(6)^/^$$d(2)^/^$day^' '^$t
		if(~ $1 /*)
			p=$1
		if not
			p=`{pwd}^/$1	# `^' is required
		a=`{grep ' '^$p^'$' $log | tail -1}
		if(~ $#a 4)
			v=`{vac -h pc -qd <{echo vac:$a(1)} $p}
		if not
			v=`{vac -h pc $p}
		if(! ~ $vac vac:*){
			echo '# vac error'
			exit 'vac error'
		}
		ifs=': ' v=`{echo -n $v} echo $v(2) $d $p >> $log
	case *
		echo 'usage: ve [file]'
	}

File: vefs
	#!/bin/rc -e
	# name: vefs
	# usage: vefs patterm
	# coded by Kenji Arisawa
	log=$home/venti/log
	if(~ $#* 0)
		a=`{tail -1 $log}
	if not
		a=`{grep $"* $log | tail -1}
	if(! ~ $#a 4){
		echo '# pattern not exist'
		exit 'pattern not exist'
	}
	unmount /n/vac >[2] /dev/null
	vacfs -h pc <{echo vac:$a(1)}

Of cause you may have more elegant one, but I love these.

Kenji Arisawa


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

* Re: [9fans] How to sync venti
  2002-09-04 12:49     ` arisawa
@ 2002-09-04 19:22       ` arisawa
  0 siblings, 0 replies; 6+ messages in thread
From: arisawa @ 2002-09-04 19:22 UTC (permalink / raw)
  To: 9fans


>#!/bin/rc -e

Sorry change to:
#!/bin/rc

Kenji Arisawa


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

* Re: [9fans] How to sync venti
@ 2002-11-05  4:33 Russ Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2002-11-05  4:33 UTC (permalink / raw)
  To: 9fans

On Tue Sep  3 08:08:15 EDT 2002, arisawa@ar.aichi-u.ac.jp wrote:
> How can I sync venti to terminate safely?

Once all the clients have stopped, you can run
the new command venti/sync (you'll have to pull
to get the one I just installed on sources),
which won't return until the write queues have
emptied.

Of course, they might fill up again after venti/sync
returns, but if you stop all the Venti clients and
then run venti/sync, you can be guaranteed the
queues stay empty afterward.

Vac now syncs before exiting, so if vac is your
only client, you don't have to worry about ever
running venti/sync.  As long as your vacs have
exited, all the data is on the disk.

Russ


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

end of thread, other threads:[~2002-11-05  4:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-03 12:07 [9fans] How to sync venti arisawa
2002-09-03 20:41 ` Dharani Vilwanathan
2002-09-03 20:47   ` Sean Quinlan
2002-09-04 12:49     ` arisawa
2002-09-04 19:22       ` arisawa
2002-11-05  4:33 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).