On Sat, Jun 13, 2015 at 01:27:38AM -0500, Tony Asleson wrote:
> 3. User have to check multiple bits to make sure
> everything is OK. Every time we add an additional
> bit, user code has to add one more check.
Please elaborate on how adding a new enumerated error type doesn't
require the client to be modified to interpret the value?
Single bit status:
STATUS_OK means everything is OK. Hence user can tell whether
everything is OK using old code when new status added.
Multiple bits status:
STATUS_OK means I/O is OK. Hence user can tell whether I/O
is OK using old code when new status added.
In storaged lsm module, I use single property 'is_OK' to indicate
whether user should check with storage admin.
> For some user, data accessible is not enough to be
OK.
You advocate that adding a bit is more problematic than adding an
enumerated value. To me this isn't an error code where the
operations was successful, else it is in error with the error
reason, it's a status. If we add a new enumerated status code, lets
call it STATUS_CONFRAZZLED, is that bad or good? What does an
existing client do if a newer plug-in returns it? I could see a
client written with a switch statement and this falling into the
default which would likely be report at highest error level.
Make sense. Some state
might does mean good or bad, they could
come with STATUS_OK or STATUS_ERROR simultaneous.
I was thinking that if we used the STATUS_OK or STATUS_ERROR bit and
sub qualified it with other bits, it would at least convey to any
client that things are generally OK or NOT.
Ultimately in this case we can go either way. If others don't see
the benefit of having the multiple bits we can document them as
being unique error values while retaining the existing numerical
values. Current plug-ins aren't using mult-bit. If we do this we
should also change the documentation on all the other status fields
too, to make it consistent.
For lsm.System.status and lsm.Disk.status, they still
need
bitmap status as exiting plugin implemented multiple status,
for example:
Disk.STATUS_SPARE | Disk.STATUS_PREDICTIVE_FAILURE
Disk.STATUS_ERROR | Disk.STATUS_STOPPED
To be consistent, let's keep using the bitmap in pool.
Let me update document and plugins to reflect that.
Regards,
Tony
--
Gris Ge