Bacula-users

Re: [Bacula-users] atoi and volume name/media name ambiguity (Was: Re: Bug / RFE)

2009-02-05 03:42:02
Subject: Re: [Bacula-users] atoi and volume name/media name ambiguity (Was: Re: Bug / RFE)
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 05 Feb 2009 09:39:20 +0100
Hi,

04.02.2009 21:43, mark.bergman AT uphs.upenn DOT edu wrote:
> 
> In the message dated: Wed, 04 Feb 2009 21:24:41 +0100,
> The pithy ruminations from Arno Lehmann on 
> <Re: [Bacula-users] Bug / RFE> were:
> => Hi,
> => 
> => 04.02.2009 19:13, Dupree, Craig wrote:
> => > This is starting to get annoying....
> => > =
> => 
> => > Can the parts of bacula that ask for volume names not arbitrarily
> => > use atoi on them?
> => 
> => Not easily, no...
> => 
> => > Here is a good example where I want to purge a volume name, since I
> => > know now the list of volumes that I want to purge and reuse for
> => > this month's backup set:
> => > =
> => 
> => > Enter MediaId or Volume name: 000029 sql_get.c:1002 Media record
> => > MediaId=3D29 not found.
> => > =
> => 
> => > In this case, it's only a hassle because MediaId 29 doesn't exist.
> => > A worse problem occurs when the leading zeros are stripped off of a
> => > volume name, and the resulting number is a valid MediaId.
> 
> 
> Yes, I've been bitten by this several times....annoying and a bit confusing.
> 
> => 
> => The problem is that the requests accepts both MediaId or a Volume =
> => 
> => name. MediaId is always numeric, a volume name is not.
> => 
> => As long as volume names can be numeric, and there is no way to =
> => 
> => distinguish if a MediaId or a volume name is entered, I see no simle =
> => 
> => solution to the problem.
> => 
> => Actually, as most volume names today are non-numeric, I don't think =
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> What's the data behind that statement?

:-) I tried to avoid that question intentionally ;-)

It's what I see, both in my office and at customer sites.

Without barcodes, I label tapes with a format of e.g. "DLT-[0-9]{4}" 
and disk folumes with the pool name prepended, i.e. "Full-0001".

LTO tape labels by convention have an appended "L1" to "L4", telling 
you if it's LTO-1, -4 etc.

Others use a numbering scheme starting with a letter for the series 
and digits following it, like "A000345" for example.

At least among my customers, I don't see plain numerical tape labels 
at all, any more.

> By "most" do you mean "most customer 
> sites use non-numeric volume names" or "most pieces of media have volume 
> names 
> that are non-numeric". Though there's no data, I might agree with the first
> case. However, when I look at the ~200 bar-coded tapes on the shelf behind 
> me, 
> that's a lot of data that supports the idea that most volume names are 
> actually 
> numeric.

I admit you've got some valid data there, countering my argument. Even 
though, at customer sites, I would find some more volumes with 
non-numerical names.

> 
> Here's another way of looking at it...
> 
>       The distinction between 000029 and 29 is highly relevent for
>       computers, and much less obvious or understood for the human
>       beings who use computers.
> 
> I see it is a very bad design principle to make human beings think like 
> computers, forcing people to accomodate their work processes to satisfy a
> piece of software, rather than the other way around.

True, but look at bconsole as it is: It is really not a very 
human-centric, user-friendly tool. And it's unlikely we'll have that 
changed any time soon... a major rework towards more userfriendliness 
would probably look a lot like BAT, and fortunately, that already 
exists :-)


> => 
> => this affects enough users to make a fix an urgent thing.
> => 
> => You can, of course, post a proper feature request - preferrably along =
> => 
> => with a potential solution. A solution would have to be compatible to =
> => 
> => todays behaviour, though, as that interface is probably used by =
> => 
> => scripts; thus, requiring qoutes or any other special way to =
> => 
> => distinguish between media id and volume name when entered is probably =
> => 
> => not the best way.
> 
> 
> Yes, backward compatibilty is important, and every bug report or RFE would 
> ideally come with a proposed solution, a working patch, etc., etc.. However,
> users often identify bugs (or, in this case, a dubious design choice that 
> works 
> correctly, but should be enhanced) but cannot provide a solution.

I understand that... just my situation :-)

Still I try to make it clear how a feature request is more likely to 
be accepted and even implemented soon... I don't do this to annoy 
anyone :-)

> 
> => 
> => I could imagine some post-input checks, i.e., after the value is =
> => 
> => entered, and it's numerical only, and has leading zeros, see if a =
> => 
> => volume with that MediaId exists. If there isn't one, use the input as =
> => 
> => a volume name.
> 
> 
> That sounds like a good first description for a way to fix this.

I thought so... but Kevin brought up some other ideas. Optional quotes 
seem, to me, like the best way to go for now.

I believe a patch could be rather simple... anybody with reasonable 
C/C++ skills volunteering? In the svn tree, it's 
trunk/bacula/src/dird/ua_select.c you want to look at, and then search 
for "Enter MediaId or Volume name: " and you see where to start working.

Arno

> Mark
> 
> => 
> => I'm sure other solutions could be found...
> => 
> => Arno
> => 
> => > Craig
> => > =
> 
> 
> 
> The information contained in this e-mail message is intended only for the 
> personal and confidential use of the recipient(s) named above. If the reader 
> of this message is not the intended recipient or an agent responsible for 
> delivering it to the intended recipient, you are hereby notified that you 
> have received this document in error and that any review, dissemination, 
> distribution, or copying of this message is strictly prohibited. If you have 
> received this communication in error, please notify us immediately by e-mail, 
> and delete the original message.
> 
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users