apache / apache/ignite

Bug in GridDiscoveryManager.java (2.16.0)) when segmentationResolvers configured with segmentationCheckFrequency = 0

Open
#11,401 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.1k
Forks
1.9k
Avg merge
3d 2h
Merged PRs (30d)
46

Description

I have configured a segmentationResolver, and segmentationCheckFreq set to '0', means check segmentation based on the topology changes. But this scenario is crashing.

In GridDiscoveryManager.java:3130, segmentationcheck is scheduled only when the resolvers configured

'''

case EVT_NODE_LEFT:
{
// Check only if resolvers were configured.
if (hasRslvrs)
**segChkWrk**.scheduleSegmentCheck();

'''

but, the '**segChkWrk**' object is initialized only when segmentatinCheckFreq is set to non-zero. Due to this above code line:3033 crashes.

line:1087

''' **// Start segment check worker only if frequency is greater than 0.

if (hasRslvrs && **segChkFreq** > 0) {
**segChkWrk = new SegmentCheckWorker();**
segChkThread = new IgniteThread(segChkWrk);**
'''

Exception:
2024-06-20 16:06:51,030 UTC+0530 ERROR [disco-event-worker-#45%as%] org.apache.ignite.internal.managers.discovery.GridDiscoveryManager -- Exception in discovery event worker thread. **java.lang.NullPointerException:** Cannot invoke "org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$SegmentCheckWorker.scheduleSegmentCheck()" because the return value of "org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.access$11600(org.apache.ignite.internal.managers.discovery.GridDiscoveryManager)" is null at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$DiscoveryWorker.body0(GridDiscoveryManager.java:3133) ~[ignite-core-2.16.0.jar:2.16.0] at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$DiscoveryWorker.body(GridDiscoveryManager.java:3060) ~[ignite-core-2.16.0.jar:2.16.0] at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:125) ~[ignite-core-2.16.0.jar:2.16.0] at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Contributor guide

Open the contributing guide

Research direction

Inspect GridDiscoveryManager.java around line 1087, where SegmentCheckWorker is initialized, and the discovery event handling around line 3130. Reproduce the configuration with a segmentation resolver and segmentationCheckFrequency set to 0, then verify topology changes trigger segmentation checks without a NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.