Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-13795

Prevents SQL Server deadlock on concurrent nx_update_read_acls

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.9.2
    • Fix Version/s: 5.8.0-HF11, 5.9.3
    • Component/s: Core VCS

      Description

      When aclOptimizations is configured with concurrentUpdate enable on MS SQL Server, deadlocks can happen during concurrent deletion on the aclr_modified table.

      2014-02-14 10:51:39.67 spid6s      Deadlock encountered .... Printing deadlock information
      2014-02-14 10:51:39.67 spid6s      Wait-for graph
      2014-02-14 10:51:39.67 spid6s      
      2014-02-14 10:51:39.67 spid6s      Node:1
      
      2014-02-14 10:51:39.67 spid6s      KEY: 5:72057594099990528 (9c44a8a7004b) CleanCnt:2 Mode:X Flags: 0x1
      2014-02-14 10:51:39.67 spid6s       Grant List 1:
      2014-02-14 10:51:39.67 spid6s         Owner:0x00000001152BA840 Mode: X        Flg:0x40 Ref:0 Life:02000000 SPID:60 ECID:0 XactLockInfo: 0x00000000DBC9B990
      2014-02-14 10:51:39.67 spid6s         SPID: 60 ECID: 0 Statement Type: DELETE Line #: 24
      2014-02-14 10:51:39.67 spid6s         Input Buf: Language Event: EXEC dbo.nx_update_read_acls
      2014-02-14 10:51:39.67 spid6s      Requested by: 
      2014-02-14 10:51:39.67 spid6s        ResType:LockOwner Stype:'OR'Xdes:0x00000000804BAE80 Mode: U SPID:54 BatchID:0 ECID:0 TaskProxy:(0x0000000105CE6540) Value:0x2e1ad80 Cost:(0/1580)
      2014-02-14 10:51:39.67 spid6s      
      2014-02-14 10:51:39.67 spid6s      Node:2
      
      2014-02-14 10:51:39.67 spid6s      KEY: 5:72057594099990528 (08c0f6e67bc8) CleanCnt:2 Mode:X Flags: 0x1
      2014-02-14 10:51:39.67 spid6s       Grant List 1:
      2014-02-14 10:51:39.67 spid6s         Owner:0x00000000FF7FBEC0 Mode: X        Flg:0x40 Ref:0 Life:02000000 SPID:54 ECID:0 XactLockInfo: 0x00000000804BAEC0
      2014-02-14 10:51:39.67 spid6s         SPID: 54 ECID: 0 Statement Type: DELETE Line #: 19
      2014-02-14 10:51:39.67 spid6s         Input Buf: Language Event: EXEC dbo.nx_update_read_acls
      2014-02-14 10:51:39.67 spid6s      Requested by: 
      2014-02-14 10:51:39.68 spid6s        ResType:LockOwner Stype:'OR'Xdes:0x00000000DBC9B950 Mode: U SPID:60 BatchID:0 ECID:0 TaskProxy:(0x00000000B40B2540) Value:0xff2261c0 Cost:(0/210580)
      2014-02-14 10:51:39.68 spid6s      
      2014-02-14 10:51:39.68 spid6s      Victim Resource Owner:
      2014-02-14 10:51:39.68 spid6s       ResType:LockOwner Stype:'OR'Xdes:0x00000000804BAE80 Mode: U SPID:54 BatchID:0 ECID:0 TaskProxy:(0x0000000105CE6540) Value:0x2e1ad80 Cost:(0/1580)
      2014-02-14 10:51:39.68 spid13s     deadlock-list
      2014-02-14 10:51:39.68 spid13s      deadlock victim=process804b9948
      2014-02-14 10:51:39.68 spid13s       process-list
      2014-02-14 10:51:39.68 spid13s        process id=process804b9948 taskpriority=0 logused=1580 waitresource=KEY: 5:72057594099990528 (9c44a8a7004b) waittime=3044 ownerId=76225836 transactionname=implicit_transaction lasttranstarted=2014-02-14T10:51:36.357 XDES=0x804bae80 lockMode=U schedulerid=2 kpid=3936 status=suspended spid=54 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-02-14T10:51:36.373 lastbatchcompleted=2014-02-14T10:51:36.370 clientapp=jTDS hostname=WIPR157A hostpid=123 loginname=NUXEO_DBO isolationlevel=read committed (2) xactid=76225836 currentdb=5 lockTimeout=4294967295 clientoption1=673185824 clientoption2=128058
      2014-02-14 10:51:39.68 spid13s         executionStack
      2014-02-14 10:51:39.68 spid13s          frame procname=NUXEO.dbo.nx_update_read_acls line=19 stmtstart=1144 stmtend=1368 sqlhandle=0x0300050056c753570a4d5300d2a200000100000000000000
      2014-02-14 10:51:39.68 spid13s     DELETE FROM aclr_modified WHERE is_new = 1;
        --
        -- 2/ Handles new ACLs, marking read acl with a NULL marker     
      2014-02-14 10:51:39.68 spid13s          frame procname=adhoc line=1 sqlhandle=0x01000500f8384203706185b2000000000000000000000000
      2014-02-14 10:51:39.68 spid13s     EXEC dbo.nx_update_read_acls     
      2014-02-14 10:51:39.68 spid13s         inputbuf
      2014-02-14 10:51:39.68 spid13s     EXEC dbo.nx_update_read_acls    
      2014-02-14 10:51:39.68 spid13s        process id=process804b8bc8 taskpriority=0 logused=210580 waitresource=KEY: 5:72057594099990528 (08c0f6e67bc8) waittime=2243 ownerId=76225758 transactionname=implicit_transaction lasttranstarted=2014-02-14T10:51:35.800 XDES=0xdbc9b950 lockMode=U schedulerid=2 kpid=2436 status=suspended spid=60 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-02-14T10:51:37.107 lastbatchcompleted=2014-02-14T10:51:37.107 clientapp=jTDS hostname=WIPR157A hostpid=123 loginname=NUXEO isolationlevel=read committed (2) xactid=76225758 currentdb=5 lockTimeout=4294967295 clientoption1=673185824 clientoption2=128058
      2014-02-14 10:51:39.68 spid13s         executionStack
      2014-02-14 10:51:39.68 spid13s          frame procname=NUXEO.dbo.nx_update_read_acls line=24 stmtstart=1666 stmtend=1860 sqlhandle=0x0300050056c753570a4d5300d2a200000100000000000000
      2014-02-14 10:51:39.68 spid13s     DELETE FROM aclr_modified WHERE is_new = 0;
        --
        -- 3/ Mark all children with the NULL marker     
      2014-02-14 10:51:39.68 spid13s          frame procname=adhoc line=1 sqlhandle=0x01000500f8384203706185b2000000000000000000000000
      2014-02-14 10:51:39.68 spid13s     EXEC dbo.nx_update_read_acls     
      2014-02-14 10:51:39.68 spid13s         inputbuf
      2014-02-14 10:51:39.68 spid13s     EXEC dbo.nx_update_read_acls    
      2014-02-14 10:51:39.68 spid13s       resource-list
      2014-02-14 10:51:39.68 spid13s        keylock hobtid=72057594099990528 dbid=5 objectname=NUXEO.dbo.aclr_modified indexname=aclr_modified_is_new_idx id=lock12318fe80 mode=X associatedObjectId=72057594099990528
      2014-02-14 10:51:39.68 spid13s         owner-list
      2014-02-14 10:51:39.68 spid13s          owner id=process804b8bc8 mode=X
      2014-02-14 10:51:39.68 spid13s         waiter-list
      2014-02-14 10:51:39.68 spid13s          waiter id=process804b9948 mode=U requestType=wait
      2014-02-14 10:51:39.68 spid13s        keylock hobtid=72057594099990528 dbid=5 objectname=NUXEO.dbo.aclr_modified indexname=aclr_modified_is_new_idx id=lock128d68500 mode=X associatedObjectId=72057594099990528
      2014-02-14 10:51:39.68 spid13s         owner-list
      2014-02-14 10:51:39.68 spid13s          owner id=process804b9948 mode=X
      2014-02-14 10:51:39.68 spid13s         waiter-list
      2014-02-14 10:51:39.68 spid13s          waiter id=process804b8bc8 mode=U requestType=wait
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: