Bug 809481 - fence_scsi_test will reset error counter after creating reservation
fence_scsi_test will reset error counter after creating reservation
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman (Show other bugs)
5.8
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ryan O'Hara
Cluster QE
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-03 09:31 EDT by Ryan O'Hara
Modified: 2013-01-07 22:37 EST (History)
4 users (show)

See Also:
Fixed In Version: cman-2.0.115-98.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 22:37:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Increment error count when reservation fails. (913 bytes, patch)
2012-04-03 10:24 EDT, Ryan O'Hara
no flags Details | Diff

  None (edit)
Description Ryan O'Hara 2012-04-03 09:31:24 EDT
If fence_scsi_test attempts to create a reservation and fails, the error counter is set to zero. This is clearly a bug.

The easiest was to see this bug is to use fence_scsi_test on a device that clearly does no support SCSI-PR. Use the "on" action, any key, and be sure to use the verbose flag:

# fence_scsi_test -o on -k 123 -d /dev/sda -v
  main::do_key_write (key=123)
  main::get_devices
  main::print_devices
    /dev/sda
  main::get_devices_name (dev=/dev/sda)
    name=/dev/sda
  main::get_devices_path (dev=/dev/sda)
    path=[ /dev/sda ]
  main::do_action_on (dev=/dev/sda node_key=123)
  main::do_reset (dev=/dev/sda)
    cmd=sg_turs /dev/sda
    err=0
  main::do_register_ignore (dev=/dev/sda sark=123)
    cmd=sg_persist -n -o -I -S 123 -d /dev/sda
    err=9
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::do_reserve (dev=/dev/sda rk=123)
    cmd=sg_persist -n -o -R -T 5 -K 123 -d /dev/sda
    err=9
  main::do_verify_on (dev=/dev/sda node_key=123)
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::print_results (dev=/dev/sda)
    results=[ action=0 verify=2 ]

We can see that do_register_ignore and do_reserve both failed with err=9. This should be reflected in the results printed at the end of the script. In this case, we see the results are "[ action=0 verify=2 ]". This means there were no errors during registration/reservation creation. We should see "[ action=2 verify=2 ]".
Comment 1 Ryan O'Hara 2012-04-03 10:24:00 EDT
Created attachment 574879 [details]
Increment error count when reservation fails.

Don't reset the error count to zero if do_reserve fails. Instead, increment the error count. This fix will correctly report errors during the "action" portion of the test.
Comment 2 RHEL Product and Program Management 2012-04-03 10:37:02 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 3 Ryan O'Hara 2012-04-03 10:42:17 EDT
Here is the same test with the patch:

# fence_scsi_test.pl -o on -k 123 -d /dev/sda -v
  main::do_key_write (key=123)
  main::get_devices
  main::print_devices
    /dev/sda
  main::get_devices_name (dev=/dev/sda)
    name=/dev/sda
  main::get_devices_path (dev=/dev/sda)
    path=[ /dev/sda ]
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::do_action_on (dev=/dev/sda node_key=123)
  main::do_reset (dev=/dev/sda)
    cmd=sg_turs /dev/sda
    err=0
  main::do_register_ignore (dev=/dev/sda sark=123)
    cmd=sg_persist -n -o -I -S 123 -d /dev/sda
    err=9
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::do_reserve (dev=/dev/sda rk=123)
    cmd=sg_persist -n -o -R -T 5 -K 123 -d /dev/sda
    err=9
  main::do_verify_on (dev=/dev/sda node_key=123)
  main::get_keys_register (dev=/dev/sda)
    cmd=sg_persist -n -i -k -d /dev/sda
    err=9
    keys=[  ]
  main::get_keys_reserve (dev=/dev/sda)
    cmd=sg_persist -n -i -r -d /dev/sda
    err=9
    keys=[  ]
  main::print_results (dev=/dev/sda)
    results=[ action=2 verify=2 ]

This test attempts to create a registration and reservation on /dev/sda, which does not support SCSI-PR. Both do_register_ignore and do_reserve fail as expected. Note that the results are now correct.
Comment 7 errata-xmlrpc 2013-01-07 22:37:18 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0076.html

Note You need to log in before you can comment on or make changes to this bug.