Bug 830736

Summary: sanlock: race beween add_lockspace and rem_lockspace
Product: Red Hat Enterprise Linux 6 Reporter: Federico Simoncelli <fsimonce>
Component: sanlockAssignee: David Teigland <teigland>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3CC: ajia, cluster-maint, cpelland, teigland
Target Milestone: rcKeywords: Reopened, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sanlock-2.5-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:52:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 841994, 906027    

Description Federico Simoncelli 2012-06-11 10:18:34 UTC
Description of problem:
Sanlock cannot add lockspaces after restarting wdmd.

Version-Release number of selected component (if applicable):
sanlock-2.3-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
# touch /tmp/test.slk && sanlock direct init -s test:0:/tmp/test.slk:0

# sanlock client add_lockspace -s test:1:/tmp/test.slk:0
add_lockspace
add_lockspace done 0

# sanlock client rem_lockspace -s test:1:/tmp/test.slk:0
rem_lockspace
rem_lockspace done 0

# service wdmd restart
Stopping wdmd:                                             [  OK  ]
Starting wdmd:                                             [  OK  ]

# sanlock client add_lockspace -s test:1:/tmp/test.slk:0
add_lockspace
add_lockspace done -201

2012-06-11 10:13:44+0000 9822 [2023]: s2 lockspace test:1:/tmp/test.slk:0
2012-06-11 10:13:44+0000 9822 [3329]: s2 delta_acquire 1 begin
2012-06-11 10:13:44+0000 9822 [3329]: s2 delta_acquire 1 write 1 2 9822 8f65da42-fc87-423a-ba52-379ddcd995fa.vm-rhev2.i
2012-06-11 10:13:44+0000 9822 [3329]: s2 delta_acquire 1 delta_short_delay 2
2012-06-11 10:13:46+0000 9824 [3329]: s2 wdmd connect failed -111
2012-06-11 10:13:46+0000 9824 [3329]: s2 create_watchdog failed -1
2012-06-11 10:13:46+0000 9824 [3329]: s2 delta_release 1 begin
2012-06-11 10:13:47+0000 9825 [2023]: cmd_add_lockspace 1,9 done -201
  
Actual results:
You cannot add lockspaces.

Expected results:
You should be able to add lockspaces.

Comment 2 David Teigland 2012-06-11 16:16:04 UTC
I tried the same steps and it worked for me.  I also took a quick look at the code and there's no obvious reason why it should fail.

Comment 3 David Teigland 2012-07-09 21:53:51 UTC

*** This bug has been marked as a duplicate of bug 838654 ***

Comment 4 David Teigland 2012-07-13 15:26:29 UTC
deconsolidating

Comment 5 David Teigland 2012-07-13 15:46:15 UTC
*** Bug 840065 has been marked as a duplicate of this bug. ***

Comment 7 David Teigland 2012-07-16 14:54:08 UTC
Sorry about the confusion here; the original example of the problem wasn't accurate, but it came from some real problems in vdsm when adding lockspaces from multiple threads.  Dealing with that required some sanlock enhancements for adding/querying/waiting for lockspaces:

f179f84 daemon: don't put struct space on stack
85de31c daemon: fix add_lockspace that has been removed
fee5d9c sanlock: WAIT flag for sanlock_inq_lockspace

Comment 9 David Teigland 2012-07-17 14:50:30 UTC
Federico, what tests were causing the problems that led to these add/inq lockspace changes?

Comment 13 Leonid Natapov 2012-12-18 16:39:40 UTC
sanlock-2.6-2.el6.x86_64. SPM start works well.

Comment 15 errata-xmlrpc 2013-02-21 08:52:40 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-0530.html