The following issue has been CLOSED
======================================================================
http://bugs.bacula.org/view.php?id=1607
======================================================================
Reported By: craigmiskell
Assigned To:
======================================================================
Project: bacula
Issue ID: 1607
Category: Director
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: open
Fixed in Version:
======================================================================
Date Submitted: 2010-07-13 05:02 BST
Last Modified: 2010-10-09 13:41 BST
======================================================================
Summary: status slots code assumes slots are reported in
order; mtx-changer doesn't guarantee this
Description:
In dird/ua_label.c, in the status_slots function is a comment:
" /* Hope that slots are ordered */"
mtx-changer doesn't guarantee that, in that it always prints out the
Storage Element slots first, then any tapes that are in the Drives (with
their original slot numbers), so the slot numbers as reported are almost
never in correct order (unless the tape in the drive is from the highest
numbered slot)
In certain circumstances then, status slots will miss tapes. The easiest
to reproduce scenario is where there's tapes in slot 1 and 3, and the tape
from slot 2 is loaded into a drive. mtx-changer will report something
like:
1:000001L4
3:000002L4
2:000001LU
but "status slots" will show only the tapes in slot 2 and 3, claiming
nothing is in slot 1.
update slots isn't affected as it seems to have completely different
logic.
======================================================================
----------------------------------------------------------------------
(0005521) craigmiskell (reporter) - 2010-07-25 20:43
http://bugs.bacula.org/view.php?id=1607#c5521
----------------------------------------------------------------------
I've uploaded a new version of mtx-changer that actually does it right and
doesn't assume < 10 slots.
Still bash-like
----------------------------------------------------------------------
(0005590) ebollengier (administrator) - 2010-09-07 16:38
http://bugs.bacula.org/view.php?id=1607#c5590
----------------------------------------------------------------------
Don't you think that a simple sort -u can do the work? I would like to
understand exactly what your shell code is supposed to do.
----------------------------------------------------------------------
(0005593) craigmiskell (reporter) - 2010-09-07 22:15
http://bugs.bacula.org/view.php?id=1607#c5593
----------------------------------------------------------------------
Yeah, but that would be simple, readable and maintainable. Where would I
get my kicks from?
:)
<sigh> An excellent point. I was blinded by the two parts of the list
function (first displaying Storage Elements, then displaying Transfer
Elements) and found an unnecessarily complicated way to combine them
I'll upload a much simpler veresion shortly; it needs another temporary
file so I've had to add a param to make_temp_file to ID the second file
properly (in the case mktemp isn't there or isn't working properly)
----------------------------------------------------------------------
(0005630) ebollengier (administrator) - 2010-10-09 13:41
http://bugs.bacula.org/view.php?id=1607#c5630
----------------------------------------------------------------------
This issue is very specific to your hardware, I think that a couple of
"sort -u" should be enough to get you out of this problem.
This script can't handle every autochanger of the market, but users can
tweak it easily with some shell knowlege.
Issue History
Date Modified Username Field Change
======================================================================
2010-07-13 05:02 craigmiskell New Issue
2010-07-13 05:02 craigmiskell File Added: mtx-changer-order.patch
2010-07-13 15:22 mnalis Issue Monitored: mnalis
2010-07-25 20:42 craigmiskell File Added: mtx-changer
2010-07-25 20:43 craigmiskell Note Added: 0005521
2010-08-08 16:18 kern Status new => acknowledged
2010-09-07 16:38 ebollengier Note Added: 0005590
2010-09-07 16:38 ebollengier Status acknowledged =>
feedback
2010-09-07 22:15 craigmiskell Note Added: 0005593
2010-09-07 22:17 craigmiskell File Added: mtx-changer-attempt2
2010-10-09 13:41 ebollengier Note Added: 0005630
2010-10-09 13:41 ebollengier Status feedback => closed
======================================================================
|