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

Possible leak in metrics in PageLockTracker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.10
    • None
    • persistence
    • None
    • 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

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

            Dates

              Created:
              Updated: