CRZbulabula commented on code in PR #18603:
URL: https://github.com/apache/iotdb/pull/18603#discussion_r3996741455
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java:
##########
@@ -165,6 +165,11 @@ public ConfigPhysicalPlanType getType() {
return this.type;
}
+ /**
+ * Serializes this plan, including its type discriminator and
implementation-specific payload.
Review Comment:
This contract is not true for every implementation.
ConfigPhysicalReadPlan.serializeImpl() is deliberately a no-op, so
serializeToByteBuffer() returns an empty buffer with neither a type
discriminator nor a payload for read plans. Please qualify the Javadoc to say
that it serializes whatever the concrete implementation emits, or explicitly
document the read-plan exception.
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java:
##########
@@ -156,10 +156,17 @@ protected void remove(Set<Integer> nodeIds) throws
IoTDBException {
ConfigNodeMessages.THE_REMOVE_CONFIGNODE_SCRIPT_HAS_BEEN_DEPRECATED_PLEASE_CONNECT_TO,
-1);
}
+ /**
+ * Starts the ConfigNode services in dependency order.
+ *
+ * <p>The method must preserve the distinction between seed and non-seed
ConfigNodes and must
+ * start the RPC service only after the local services required to handle
requests are ready.
Review Comment:
This is not true for the initial non-seed path. That path intentionally
calls setUpRPCService() before sendRegisterConfigNodeRequest() and before the
node has joined a consensus group so that the leader can schedule expansion.
Please document this exception instead of stating that RPC always starts only
after the required local services are ready.
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java:
##########
@@ -503,6 +510,12 @@ public void deactivate() throws IOException {
LOGGER.info(ConfigNodeMessages.IS_DEACTIVATED,
ConfigNodeConstant.GLOBAL_NAME);
}
+ /**
+ * Stops ConfigNode services and releases their resources in reverse
dependency order.
+ *
+ * <p>The operation should be safe to invoke during partial startup and
should not leave
+ * background scheduling, RPC, or consensus resources running.
Review Comment:
This cleanup contract is stronger than the implementation. deactivate()
deregisters services and ConfigManager.close() shuts down the region
maintainer, procedure executor, and consensus, but consensus shutdown does not
guarantee that ConfigRegionStateMachine.stopLeaderServices() runs;
ConfigRegionStateMachine.stop() itself only notifies the pipe runtime. The
shutdown is also not implemented as reverse dependency order. Please narrow
this Javadoc to the actual best-effort deactivation followed by process exit,
or implement the promised cleanup.
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterManager.java:
##########
@@ -109,7 +116,12 @@ private void generateClusterId() {
}
}
- // TODO: Parallel test ConfigNode and DataNode
+ /**
+ * Tests connectivity from this ConfigNode to all registered ConfigNodes and
DataNodes and
Review Comment:
The probes do not all originate from this ConfigNode. This method sends the
complete node list to every registered ConfigNode and DataNode, each recipient
performs doConnectionTest(nodeLocations), and the leader aggregates those
per-node results. Please describe this as a cluster-wide or all-to-all
connectivity test coordinated by this ConfigNode.
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java:
##########
@@ -189,6 +194,13 @@ public int getSerializedSize() throws IOException {
public static class Factory {
+ /**
+ * Deserializes a plan from the buffer using the encoded type
discriminator.
+ *
+ * @param buffer the buffer containing one serialized plan
+ * @return the deserialized plan
+ * @throws IOException if the encoded plan type or payload cannot be read
Review Comment:
A truncated buffer is not covered by this documented exception:
buffer.getShort() throws the unchecked BufferUnderflowException when fewer than
two bytes remain. Please either validate/wrap buffer underflow as IOException
or document the unchecked failure instead of promising IOException whenever the
encoded type or payload cannot be read.
--
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]