JisoLya commented on code in PR #2919:
URL:
https://github.com/apache/incubator-hugegraph/pull/2919#discussion_r2618242362
##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftRpcClient.java:
##########
@@ -60,7 +60,7 @@ public synchronized boolean init(final RpcOptions rpcOptions)
{
private <V> void internalCallAsyncWithRpc(final Endpoint endpoint,
final
RaftRpcProcessor.BaseRequest request,
final FutureClosureAdapter<V>
closure) {
- final InvokeContext invokeCtx = null;
+ final InvokeContext invokeCtx = new InvokeContext();
final InvokeCallback invokeCallback = new InvokeCallback() {
Review Comment:
The current implementation throws a NullPointerException (NPE) when
performing cluster tests on a 3-node PD setup (see image).
Follower side:
<img width="1424" height="456" alt="image"
src="https://github.com/user-attachments/assets/ad0ffec5-6723-4531-a513-f2ee8e06ae91"
/>
Leader side (which has no any dbCompaction log):
<img width="1750" height="256" alt="image"
src="https://github.com/user-attachments/assets/7b782990-24ec-439a-94d8-e990d79b8f04"
/>
The issue is reproducible with this test code:
```
@Test
public void TestSimplePd() throws PDException {
// 8686: leader, 8688 and 8687 are followers
String addr = "127.0.0.1:8687";
PDConfig pdConfig = PDConfig.of(addr);
PDClient client = PDClient.create(pdConfig);
client.dbCompaction();
}
```
Send dbCompaction to followers after changes:
Follower side log:
<img width="1433" height="159" alt="image"
src="https://github.com/user-attachments/assets/75d431b7-dfa7-4576-abd8-c1183e98eb46"
/>
Leader side log which is expected:
<img width="1740" height="461" alt="image"
src="https://github.com/user-attachments/assets/52bab549-f108-4ae3-8f6e-1407f37f9b9e"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]