Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance DataNode startup probing logic #11957

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public class DataNode implements DataNodeMBean {
* When joining a cluster or getting configuration this node will retry at most "DEFAULT_RETRY"
* times before returning a failure to the client.
*/
private static final int DEFAULT_RETRY = 10;
private static final int DEFAULT_RETRY = 50;

private static final long DEFAULT_RETRY_INTERVAL_IN_MS = config.getJoinClusterRetryIntervalMs();

Expand Down Expand Up @@ -280,9 +280,11 @@ private void pullAndCheckSystemConfigurations() throws StartupException {
|| configurationResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
// All tries failed
logger.error(
"Cannot pull system configurations from ConfigNode-leader after {} retries",
"Cannot pull system configurations from ConfigNode-leader after {} retries.",
DEFAULT_RETRY);
throw new StartupException("Cannot pull system configurations from ConfigNode-leader");
throw new StartupException(
"Cannot pull system configurations from ConfigNode-leader. "
+ "Please check whether the dn_seed_config_node in iotdb-datanode.properties is correct or alive.");
}

/* Load system configurations */
Expand Down Expand Up @@ -399,11 +401,10 @@ private void sendRegisterRequestToConfigNode() throws StartupException, IOExcept
}
if (dataNodeRegisterResp == null) {
// All tries failed
logger.error(
"Cannot register into cluster after {} retries. "
+ "Please check dn_seed_config_node in iotdb-datanode.properties.",
DEFAULT_RETRY);
throw new StartupException("Cannot register into the cluster.");
logger.error("Cannot register into cluster after {} retries.", DEFAULT_RETRY);
throw new StartupException(
"Cannot register into the cluster. "
+ "Please check whether the dn_seed_config_node in iotdb-datanode.properties is correct or alive.");
}

if (dataNodeRegisterResp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
Expand Down Expand Up @@ -462,10 +463,11 @@ private void sendRestartRequestToConfigNode() throws StartupException {
if (dataNodeRestartResp == null) {
// All tries failed
logger.error(
"Cannot send restart DataNode request to ConfigNode-leader after {} retries. "
+ "Please check dn_seed_config_node in iotdb-datanode.properties.",
"Cannot send restart DataNode request to ConfigNode-leader after {} retries.",
DEFAULT_RETRY);
throw new StartupException("Cannot send restart DataNode request to ConfigNode-leader.");
throw new StartupException(
"Cannot send restart DataNode request to ConfigNode-leader. "
+ "Please check whether the dn_seed_config_node in iotdb-datanode.properties is correct or alive.");
}

if (dataNodeRestartResp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
Expand Down