From: <bac...@li...> - 2007-07-29 12:52:39
|
A NOTE has been added to this issue. ====================================================================== http://bugs.bacula.org/view.php?id=906 ====================================================================== Reported By: ebollengier Assigned To: ebollengier ====================================================================== Project: bacula Issue ID: 906 Category: Storage Daemon Reproducibility: always Severity: minor Priority: normal Status: feedback ====================================================================== Date Submitted: 07-27-2007 09:53 EDT Last Modified: 07-29-2007 08:52 EDT ====================================================================== Summary: After a bad restoration, device can stay in read mode (Reader=1) Description: I have 2 storage deamon with 2 different media type. When i use the wrong storage to do my job (because i'm dumb), it fail and keep my device in read mode. In Use Volume status: R30072 on device "S1_L180_LTO1" (/dev/lto1) Reader=1 writers=0 reserved=0 R30085 on device "S1_L180_LTO2" (/dev/lto2) Reader=1 writers=0 reserved=0 ==== Data spooling: 0 active jobs, 0 bytes; 51 total jobs, 50,032,356,656 max bytes/job. Attr spooling: 0 active jobs, 0 bytes; 51 total jobs, 158,664,603 max bytes. I have to restart the storage deamon to be able to use this device again. The problem seems to be in src/stored/acquire.c acquire_device_for_read() * Acquire device for reading. * The drive should have previously been reserved by calling * reserve_device_for_read(). We read the Volume label from the block and * leave the block pointers just after the label. reserve_device_for_read find a device, and use set_read() to "lock" it for reading. acquire_device_for_read() see that the drive type is uncompatible with the media type, and try to use an other drive and leave the first device in read mode if no other drive can be found. I think, we have to add something like detach_dcr_from_dev(); near src/stored/acquire.c:158 to release the drive after the error. /* * If the MediaType requested for this volume is not the * same as the current drive, we attempt to find the same * device that was used to write the orginal volume. If * found, we switch to using that device. */ ... } else { /* error */ Jmsg1(jcr, M_FATAL, 0, _("No suitable device found to read Volume \"%s\"\n"), vol->VolumeName); jcr->dcr = dcr_save; goto get_out; } ====================================================================== ---------------------------------------------------------------------- kern - 07-28-07 06:18 ---------------------------------------------------------------------- Unfortunately, I think it is probably quite a bit more complicated than just adding a detach_dcr_from_dev(); The problem is that this particular code was experimental, and when I rewrote the reservations code, the use of the dcr changed, so this code must be rewritten. It can probably be simplified since the new_dcr() routine now does most of the work that was done here allowing Bacula to switch drives more easily. ---------------------------------------------------------------------- kern - 07-29-07 08:52 ---------------------------------------------------------------------- Please test with the current SVN rev 5263, which hopefully will fix this problem. If it doesn't fix it, we will need to make some sort of regression test for it so that I can duplicate the problem here. Issue History Date Modified Username Field Change ====================================================================== 07-27-07 09:53 ebollengier New Issue 07-27-07 09:53 ebollengier Status new => assigned 07-27-07 09:53 ebollengier Assigned To => ebollengier 07-27-07 09:53 ebollengier File Added: log.sd 07-28-07 06:18 kern Note Added: 0002628 07-28-07 06:18 kern Status assigned => feedback 07-29-07 08:52 kern Note Added: 0002630 ====================================================================== |