Hi,
I want your comments on my proposition to change specification of the
"initialize backup session" service (S1) and its consequences for the logic
selecting BSM for a given location. I propose to specify S1 like this:
S1 Initialize backup storage session.
[IN] location string
[OUT] backup storage session or information that this location is not
recognized by the module.
Look at the given location string and create a new session for it if
this location is recognized by the module. Otherwise inform that it is
not recognized.
The change might seem irrelevant, but actually it has important consequences
which I have realized after my discussion with Ingo about how services
report errors.
In the original design, the only valid reply from S1 was an initialized
backup storage session for a given location. If location was not recognized
by a module, the only way to signal it was by failing S1. As a consequence,
the logic for selecting backup storage module for a given location L would
have to look as follows:
For each registered backup storage module M:
1. try to initialize storage session for L in M (call S1).
2. if S1 was successful then abort this loop: M is the selected module
and we have a session object for further use.
3. Otherwise (S1 reports error) continue the loop looking for other
storage modules to handle location L.
If no module was found in the above loop, report that location was
not recognized.
With this logic, any errors from S1 are basically ignored - the only
consequence is that we do not consider the module for handling given location.
With the new proposed specification we can distinguish a situation where
module does not recognize given location from a situation where it did
recognize the location but failed to initialize valid storage session. For
example, if L = 'xbsa:...' then XBSA storage module would recognize this
location and try to connect to an XBSA server. If this attempt fails then it
would report error, which is different from saying that location is not
recognized.
Thus the storage module selection logic could be improved. If storage module
reports that it does not recognize location then we continue searching for
other modules as above. If it reports error, then we can report this error
and have an option to either stop here or also continue looking for other
modules which can possibly handle the same type of locations. I'm in favour
of the latter option which would mean the module selection logic looks like
follows:
For each registered backup storage module M:
1. try to initialize storage session for L in M (call S1);
2. if storage session was created then abort this loop: M is the
selected module and we have a session object for further use;
3. if S1 reported error, forward this error to the user (possibly as a
warning);
4. continue the loop looking for other modules which can handle
location L.
If no module recognized L, report to user that L was not recognized as a
valid location.
If no valid session was created for L and some modules signalled errors,
report to user that L could not be initialized.
Rafal