Amanda-Users

Re: Backup issues with OpenBSD 4.5 machines

2009-09-04 17:35:08
Subject: Re: Backup issues with OpenBSD 4.5 machines
From: Michael Burk <burkml AT gmail DOT com>
To: "Dustin J. Mitchell" <dustin AT zmanda DOT com>
Date: Fri, 4 Sep 2009 14:57:56 -0600
Hi Dustin,

Thanks again for your help. Here's the output of the test prog:

burkm@selenium$ ./test parent
pipe = r@3 w@4
parent closing
parent sleeping
child closing p[0]
child exec'ing
child duping
child closing B
child writing
child write done
parent reading
parent got 4 bytes
burkm@selenium$


And here's the output after the patch change (again with the 0831 snapshot):

1252076894.258118: sendbackup: pid 23986 ruid 150 euid 150 version 2.6.2alpha: start at Fri Sep  4 09:08:14 2009
1252076894.258292: sendbackup: Version 2.6.2alpha
1252076894.280268: sendbackup: pid 23986 ruid 150 euid 150 version 2.6.2alpha: rename at Fri Sep  4 09:08:14 2009
1252076894.280787: sendbackup:   Parsed request as: program `DUMP'
1252076894.280799: sendbackup:                      disk `/'
1252076894.280808: sendbackup:                      device `/'
1252076894.280818: sendbackup:                      level 0
1252076894.280827: sendbackup:                      since NODATE
1252076894.280836: sendbackup:                      options `'
1252076894.280909: sendbackup: first, fcntl returns 2; O_NONBLOCK=4
1252076894.280933: sendbackup: and then fcntl returns 2; O_NONBLOCK=4
1252076894.281309: sendbackup: start: selenium.___.com:/ lev 0
1252076894.281838: sendbackup: dumping device '/dev/rsd0a' with 'ffs'
1252076894.281943: sendbackup: Spawning "/sbin/dump dump 0usf 1048576 - /dev/rsd0a" in pipeline
1252076894.282765: sendbackup: Started backup
1252076894.286940: sendbackup:  90:  normal(|):   DUMP: Date of this level 0 dump: Fri Sep  4 09:08:14 2009
1252076894.288165: sendbackup:  90:  normal(|):   DUMP: Date of last level 0 dump: the epoch
1252076894.350837: sendbackup:  90:  normal(|):   DUMP: Dumping /dev/rsd0a (/) to standard output
1252076894.352274: sendbackup:  90:  normal(|):   DUMP: mapping (Pass I) [regular files]
1252076895.520191: sendbackup:  90:  normal(|):   DUMP: mapping (Pass II) [directories]
1252076895.520782: sendbackup:  90:  normal(|):   DUMP: estimated 47910 tape blocks.
1252076895.522299: sendbackup:  90:  normal(|):   DUMP: Volume 1 started at: Fri Sep  4 09:08:15 2009
1252076895.522802: sendbackup:  90:  normal(|):   DUMP: dumping (Pass III) [directories]
1252076895.669127: sendbackup:  90:  normal(|):   DUMP: dumping (Pass IV) [regular files]
1252076906.028912: sendbackup:  43:    size(|):   DUMP: 48385 tape blocks
1252076906.029606: sendbackup:  90:  normal(|):   DUMP: Date of this level 0 dump: Fri Sep  4 09:08:14 2009
1252076906.030489: sendbackup:  90:  normal(|):   DUMP: Volume 1 completed at: Fri Sep  4 09:08:26 2009
1252076906.030896: sendbackup:  90:  normal(|):   DUMP: Volume 1 took 0:00:11
1252076906.031250: sendbackup:  90:  normal(|):   DUMP: Volume 1 transfer rate: 4398 KB/s
1252076906.031614: sendbackup:  90:  normal(|):   DUMP: Date this dump completed:  Fri Sep  4 09:08:26 2009
1252076906.031962: sendbackup:  90:  normal(|):   DUMP: Average transfer rate: 4398 KB/s
1252076906.032322: sendbackup:  90:  normal(|):   DUMP: level 0 dump on Fri Sep  4 09:08:14 2009
1252076906.032667: sendbackup:  90:  normal(|):   DUMP: DUMP IS DONE
1252076906.032777: sendbackup: Parsed backup messages
1252076906.032848: sendbackup: pid 23986 finish time Fri Sep  4 09:08:26 2009

Thanks,
Michael


On Fri, Sep 4, 2009 at 11:11 AM, Dustin J. Mitchell <dustin AT zmanda DOT com> wrote:
Attached is a test program I just put together which does about what
Jean-Louis specified above (with the addition of some closed fd's).
This works fine on my mac, which is the closest approximation to
OpenBSD I have access to at the moment.  How does it work on 4.5?

The file-descriptor gymnastics that amandad performs is pretty crazy,
so it's quite possible I've misread the code and it's doing something
stupid, but please let me know what this test program does.

Second, in Jean-Louis' minimal patch, can you change it to read

 g_debug("first, fcntl returns %d; O_NONBLOCK=%d", fcntl(datafd,
F_GETFL, 0), O_NONBLOCK);
 g_debug("and then fcntl returns %d; O_NONBLOCK=%d", fcntl(datafd,
F_GETFL, 0), O_NONBLOCK);

and let me know what the corresponding lines in the debug file say?
It will be interesting to know if the descriptor flags have O_NONBLOCK
set either time.

We'll get to the bottom of this :)

Dustin

--
Open Source Storage Engineer
http://www.zmanda.com