Ivan Bessonov created IGNITE-22852:
--------------------------------------

             Summary: Remove extra leaf access while modifying data in B+Tree
                 Key: IGNITE-22852
                 URL: https://issues.apache.org/jira/browse/IGNITE-22852
             Project: Ignite
          Issue Type: Improvement
            Reporter: Ivan Bessonov


Currently, put operation does the following, when it finds a leaf node:
 # acquire read lock
 # check triangle invariant
 # find insertion point
 # release read lock
 # acquire write lock
 # check triangle invariant
 # find insertion point
 # insert/replace data
 # maybe release write lock

I'm simplifying it a little bit, but the fact is that steps 4-7 could 
potentially be ignored, if we had an option to convert read lock into write 
lock.

There's already an API for that in offheap lock class 
({{{}upgradeToWriteLock{}}}). We could use it, or make another method with 
"try" semantics, that wouldn't acquire write lock if it couldn't acquire it 
using spin-wait with limited number of iterations.

Same approach is possible for "put" and "remove". "invoke" requires some 
intermediary actions, so I wouldn't modify it for now.

As a result, we can expect slightly improved performance of put/remove 
operations. We will see it in benchmarks, most likely.



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

Reply via email to