Bug 809481 - fence_scsi_test will reset error counter after creating reservation
Summary: fence_scsi_test will reset error counter after creating reservation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman
Version: 5.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ryan O'Hara
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-03 13:31 UTC by Ryan O'Hara
Modified: 2013-01-08 03:37 UTC (History)
4 users (show)

Fixed In Version: cman-2.0.115-98.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 03:37:18 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0076 0 normal SHIPPED_LIVE cman bug fix and enhancement update 2013-01-08 08:27:31 UTC

Description Ryan O'Hara 2012-04-03 13:31:24 UTC
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 14:24:00 UTC
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 Program Management 2012-04-03 14:37:02 UTC
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 14:42:17 UTC
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-08 03:37:18 UTC
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.