From: Bastian F. <bas...@co...> - 2012-02-06 16:23:50
|
Hello Kern, Am Freitag, 3. Februar 2012, 23:04:30 schrieb Kern Sibbald: > I don't understand the purpose of this patch. Why do you consider > it important to "reprobe the tape is in the drive", whatever that means? > > You say that without this patch you have problems, but you didn't > say exactly what it corrects. > > Could you be more precise? It's been a year since I created the patch (even more for the initial version). I'm not prepared to give a full analysis of the problems I had without it. As said, the patch was/is only required when using a "vchanger" setup (http://sourceforge.net/projects/vchanger/) or something similar (altought I can imagine one can reproduce the problems with a physical autochanger by loading/unloading volumes bypassing the sd). bacula-sd stores the currently loaded slot in its dcr->dev structure. This information is neither updated during an "update slots" call nor before a mount request (of course, afterwards, but that is too late). Scenario: Imagine the sd having stored "no volume in tape" internally. You then attach a disk ("pseudo magazine", in vchanger terms) which says that a volume is currently in the drive. While the catalog is updated correctly (during an "update slots" call), the sd will refuse to unload the currently loaded tape, as its internal data tell it there is no volume in the drive. AFAIR, the scenario the other way around (sd thinks there is a volume in the drive, whereas the vchanger says there isn't) resulted in similar problems. I was unable to solve these kinds of problems without restarting the sd. What does the patch do? It invalidates the knowledge about the currently loaded drive during an "update slots" call. When the sd no longer has sufficient information about the loaded tape(s), it asks the configured autochanger commands (such as vchanger or mtx-changer) about the real-world facts. Based on now correct data, it will then correctly handle subsequent mount calls by loading/unloading as necessary. > On 05/19/2011 10:42 AM, Bastian Friedrich wrote: > > Hi, > > > > the "update slots" command does not reprobe the tape which is in the > > drive. > > This is not really harmful in case of "real" tape changers, as they tend > > not to be abel to swap magazines with a tape in drive. > > > > When using "vchanger" style virtual tape changers, this has resulted in > > problems for me, however. The attached patch fixes the problem for me. It > > re- probes the tape in drive when "update slots" is executed. Best regards Bastian -- Collax GmbH . Basler Str. 115a . 79115 Freiburg . Germany p: +49 (0) 89-990 157-28 www.collax.com Geschäftsführer: Bernd Bönte, Boris Nalbach AG München HRB 173695. Ust.-IdNr: DE270819312 |