Hello Josh,

Yes, you got it all exactly right.  I am not afraid of
complexity, but always start with the simplest concept
that I can find. That means less code and more robust
code at least in the beginning.

Note, if you are reading, Bacula can and does sometimes
switch drives.  If you are writing, it currently never switches
drives. Switching drives with only a single job is a bit tricky
but straight forward.  Switching drives with say 20 jobs writing
to that drive is considerably more complicated and even
ridiculously complicated with the current Bacula architecture.
To see why, imagine 20 thread each with a pointer to a drive.
Now you want to change the drive (i.e. change the pointer).
There is no clean way to do that other than make each thread
have a pointer to a sort of drive object, which in turn points
to the drive.  Then changing the pointer in the drive object
will redirect everything.  It is, of course, much more complicated
than that, and in addition there are other "better" ways of
doing things -- it just takes lots of code and lots of time
to make sure it works.

Regards,
Kern

On 05/05/2013 03:26 PM, Josh Fisher wrote:
> On 5/3/2013 4:56 PM, Dimitri Maziuk wrote:
>> On 05/03/2013 02:53 PM, Josh Fisher wrote:
>>
>>> ... What you are
>>> considering would require a new device assignment each time a new volume
>>> is needed. While possible, it is way more complex that it appears at
>>> first glance.
>> PS. I think the potentially worse can of worms is when you have multiple
>> devices and some of them are autochangers and some aren't, and while
>> switching to the next "already mounted" device should be cheaper than
>> auto-changing the tape in the current device, if the current autochanger
>> is actually a vchanger over mounted partitions it isn't, and so on and
>> so forth.
> The drives inside of an autochanger are treated like any other device,
> for the most part. An autochanger resource only groups them together so
> that assigning an autochanger resource to a storage resource allows the
> device selection to be limited to ONE of the devices belonging to that
> autochanger. The autochager isn't assigned to a job at startup, but
> rather one particular drive (device resource) belonging to that
> autochanger. That assignment doesn't change for the life of the job.
> Reassigning a job's device at every media change is possible, it is just
> more complicated and increases the likelihood of introducing a race
> condition when more than one job is requesting new media at the same
> time. There are two different operations happening, device assignment
> and media assignment. It would be necessary to make selecting both at
> the same time an atomic operation. So it is just the "normal" complexity
> of multi-threaded programming, which is always much more complex than it
> seems. So I think the Bacula devs have just chosen the safety and
> robustness of keeping it simple, rather than the risk of added
> flexibility. It's just an engineering choice.
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to