Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15147

Possible leak in metrics in PageLockTracker

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.10
    • Fix Version/s: 2.12
    • Component/s: persistence
    • Labels:
      None
    • Ignite Flags:
      Release Notes Required

      Description

      In one of PageHandler#readPage methods there is the following code:

      long pageAddr = readLock(pageMem, cacheId, pageId, page, lsnr);
      
      if (pageAddr == 0L)
          return lockFailed;
      try {
          PageIO io = pageIoRslvr.resolve(pageAddr);
          return h.run(cacheId, pageId, page, pageAddr, io, null, arg, intArg, statHolder);
      }
      finally {
          readUnlock(pageMem, cacheId, pageId, page, pageAddr, lsnr);
      }
      

      Here we obtain a read lock on a page by calling readLock method, its implementation is as following:

      lsnr.onBeforeReadLock(cacheId, pageId, page);
      
      long pageAddr = pageMem.readLock(cacheId, pageId, page);
      
      lsnr.onReadLock(cacheId, pageId, page, pageAddr);
      
      return pageAddr;
      

      And here is a problem: in readLock we always call onReadLock for the page but onReadUnlock is called only if lock was acquired successfully.
      Otherwise lock counters end up in incorrect state: onReadLock called although no lock was actually acqured.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sergeychugunov Sergey Chugunov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: