Thanks for the patch. Though I did it slightly differently, I have implemented the concept in the current development trunk and in the 2.2.9 beta release.
Thanks. Kern PS: If you get a chance, I would appreciate it if you would try the 2.2.9-b3 and make sure the problem does not exist any more. On Tuesday 26 February 2008 18:01:36 Peter Much wrote: > Abstract: > --------- > Migration jobs may update table media.storage attribute of source > volume with value of target volume. > > > Impact: > ------- > Any subsequent restore from that source volume may fail due to media > mismatch. > The reason why this went undetected seems to be that usually > migration is used to empty the source volume, so there will be no > more restores from it. > > > Comment: > -------- > I am not very happy with that fix. It lacks transparency and does > not follow an object-oriented approach. > I have also not checked the various implications and relations of > the involved variables under any configuration beyond the one I am > using. In short: it just fixes my problem. > > > Patch: > ------ > --- src/dird/catreq.c.orig Fri Oct 26 19:19:39 2007 > +++ src/dird/catreq.c Sun Feb 10 04:28:54 2008 > @@ -271,6 +271,13 @@ > if (mr.VolBlocks != sdmr.VolBlocks) { > mr.LastWritten = sdmr.LastWritten; > } > + if (jcr->wstore && jcr->wstore->StorageId) { > + /* On migrate check if volume has been written, otherwise > + * the read volume would also (wrongly) updated */ > + if (jcr->JobType != JT_MIGRATE || mr.VolBlocks != sdmr.VolBlocks) > { + mr.StorageId = jcr->wstore->StorageId; > + } > + } > /* Copy updated values to original media record */ > mr.VolJobs = sdmr.VolJobs; > mr.VolFiles = sdmr.VolFiles; > @@ -285,9 +292,6 @@ > mr.VolWriteTime = sdmr.VolWriteTime; > mr.VolParts = sdmr.VolParts; > bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus)); > - if (jcr->wstore && jcr->wstore->StorageId) { > - mr.StorageId = jcr->wstore->StorageId; > - } > > Dmsg2(400, "db_update_media_record. Stat=%s Vol=%s\n", mr.VolStatus, > mr.VolumeName); /* > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Bacula-devel mailing list > Bacula-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-devel ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Bacula-devel mailing list Bacula-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-devel