[
https://issues.apache.org/jira/browse/IGNITE-25652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17987137#comment-17987137
]
Sergey Chugunov commented on IGNITE-25652:
------------------------------------------
[~phillippko], [~ibessonov],
Do I understand correctly that there is a data race between codeblocks [1] and
[2]? [1] looks the most suspicious to me as in general it merely increments
`needReplaceInner` flag one state further.
[1]
{code:java}
// Try to find inner key on inner level.
if (needReplaceInner == TRUE) {
// Since we setup needReplaceInner in leaf page write
lock and do not release it,
// we should not be able to miss the inner key. Even if
concurrent merge
// happened the inner key must still exist.
if (!isInnerKeyInTail())
return NOT_FOUND; // Lock the whole branch up to
the inner key.
needReplaceInner = READY;
}
{code}
[2]
{code:java}
if (needReplaceInner == READY) {
replaceInner(); // Replace inner key with new max key
for the left subtree.
needReplaceInner = DONE;
}
{code}
I guess with the proposed change we eliminate unnecessary state change, and
that helps to close the race.
The whole patch looks reasonable for me, but I feel uncomfortable to approve it
as I don't have a solid understanding of what's going on, only gut feeling.
Side-note for [~ibessonov] - what the patch does in general is reducing state
space of a variable. It looks to me like a mathematical problem. Are you aware
of any algorithm that would allow to prove that the initial state space of the
variable was indeed too broad and could be reduced? All I can think about is
optimization algorithm for a state machine but I'm not sure how to formalize
this particular situation to a state machine optimization problem. I wonder if
there is a static analizer tool to find more places like this with possible
data races.
> Fix BPlusTree corruption during concurrent removes (AI2)
> --------------------------------------------------------
>
> Key: IGNITE-25652
> URL: https://issues.apache.org/jira/browse/IGNITE-25652
> Project: Ignite
> Issue Type: Improvement
> Reporter: Philipp Shergalis
> Assignee: Philipp Shergalis
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Port fix from AI3 https://issues.apache.org/jira/browse/IGNITE-23588
--
This message was sent by Atlassian Jira
(v8.20.10#820010)