You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (Jira)" <ji...@apache.org> on 2023/04/07 13:43:00 UTC

[jira] [Updated] (IGNITE-15147) Possible leak in metrics in PageLockTracker

     [ https://issues.apache.org/jira/browse/IGNITE-15147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Plekhanov updated IGNITE-15147:
---------------------------------------
    Fix Version/s: 2.16
                       (was: 2.15)

> Possible leak in metrics in PageLockTracker
> -------------------------------------------
>
>                 Key: IGNITE-15147
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15147
>             Project: Ignite
>          Issue Type: Bug
>          Components: persistence
>    Affects Versions: 2.10
>            Reporter: Sergey Chugunov
>            Priority: Major
>             Fix For: 2.16
>
>
> In one of PageHandler#readPage methods there is the following code:
> {code:java}
> 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);
> }
> {code}
> Here we obtain a read lock on a page by calling {{readLock}} method, its implementation is as following:
> {code:java}
> lsnr.onBeforeReadLock(cacheId, pageId, page);
> long pageAddr = pageMem.readLock(cacheId, pageId, page);
> lsnr.onReadLock(cacheId, pageId, page, pageAddr);
> return pageAddr;
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)