Deadlock between MMAP V1 journal lock and oplog collection lock

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      It is possible to construct sequence of concurrent operations on multiple database in MMAP V1, which would result in deadlock, which is unresolvable by our current deadlock handling code.

      The deadlock cycle is below and the thread stacks are attached.

      Locker 4 (Thread 5) waits for resource {4611686018427387906: MMAPV1Journal, 2} held by [17337, 17340, ]
      	* {4611686018427387906: MMAPV1Journal, 2} held in S
      
      Locker 17337 (Thread 17343)  waits for resource {10558654665682534615: Collection, 1335282628827758807} held by [17328, ]
      	{2305843009213693953: Global, 1} held in IX
      	{4611686018427387906: MMAPV1Journal, 2} held in IX
      	{8810581537292689075: Database, 1893052509651607219} held in IX
      	{9643129350232766918: Collection, 419757313377991110} held in X
      	{8576409733318454219: Database, 1658880705677372363} held in IX
      	* {10558654665682534615: Collection, 1335282628827758807} held in X
      
      Locker 17340 (Thread 17346)  waits for resource {10558654665682534615: Collection, 1335282628827758807} held by [17328, 17337, ]
      	{2305843009213693953: Global, 1} held in IX
      	{4611686018427387906: MMAPV1Journal, 2} held in IX
      	{9033119116019004327: Database, 2115590088377922471} held in X
      	{13644805134446392231: Metadata, 2115590088377922471} held in X
      	{8576409733318454219: Database, 1658880705677372363} held in IX
      	* {10558654665682534615: Collection, 1335282628827758807} held in X
      
      Locker 17328 (Thread 17334)  waits for resource {4611686018427387906: MMAPV1Journal, 2} held by [4, ]
      	{2305843009213693953: Global, 1} held in IX
      	* {4611686018427387906: MMAPV1Journal, 2} held in IX
      	{8576409733318454219: Database, 1658880705677372363} held in IX
      	{10558654665682534615: Collection, 1335282628827758807} held in X
      

            Assignee:
            Kaloian Manassiev
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: