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

[To rel/1.0] Cherry pick cluster node start protocol for rel/1.0 #8592

Merged
merged 11 commits into from
Dec 26, 2022

Conversation

Beyyes
Copy link
Member

@Beyyes Beyyes commented Dec 23, 2022

I have tested the compatibility from 1.0 to 1.0.1

1.0 lib:
image

1.0.1 lib:
image

@Beyyes Beyyes changed the title Cherry pick cluster node start protocol for rel/1.0 [To rel/1.0] Cherry pick cluster node start protocol for rel/1.0 Dec 23, 2022
// Notice: The Seed-ConfigNode must also have the privilege to give system configuration.
// Otherwise, the IoTDB-cluster will not have the ability to restart from scratch.
if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
|| ConfigNodeDescriptor.getInstance().isSeedConfigNode()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove || ConfigNodeDescriptor.getInstance().isSeedConfigNode() || SystemPropertiesUtils.isSeedConfigNode() judgement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The Seed-ConfigNode must also have the privilege to give system configuration.

TSStatus status = confirmLeader();
// Notice: The Seed-ConfigNode must also have the privilege to do Node restart check.
// Otherwise, the IoTDB-cluster will not have the ability to restart from scratch.
if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove || ConfigNodeDescriptor.getInstance().isSeedConfigNode() || SystemPropertiesUtils.isSeedConfigNode() judgement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The Seed-ConfigNode must also have the privilege to do Node restart check.

// Notice: The Seed-ConfigNode must also have the privilege to do Node restart check.
// Otherwise, the IoTDB-cluster will not have the ability to restart from scratch.
if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
|| ConfigNodeDescriptor.getInstance().isSeedConfigNode()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove || ConfigNodeDescriptor.getInstance().isSeedConfigNode()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The Seed-ConfigNode must also have the privilege to do Node restart check.

if (clusterName == null) {
LOGGER.warn(
"Lack cluster_name field in data/confignode/system/confignode-system.properties, set it as defaultCluster");
systemProperties.setProperty("cluster_name", "defaultCluster");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to constant CLUSTER_NAME and DEFAULT_CLUSTER_NAME

private static final int SCHEDULE_WAITING_RETRY_NUM = 20;
private static final long STARTUP_RETRY_INTERVAL_IN_MS = TimeUnit.SECONDS.toMillis(30);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30000ms? before is 1000ms

// Check system configurations
IoTDBStartCheck.getInstance().checkSystemConfig();

return isFirstStart;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return !SYSTEM_PROPERTIES.exists();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The system.properties file will be created in IoTDBStartCheck.getInstance().checkSystemConfig(). So we should get the isFirstStart at the beginning

@sonarcloud
Copy link

sonarcloud bot commented Dec 25, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 290 Code Smells

0.0% 0.0% Coverage
15.6% 15.6% Duplication

Copy link
Contributor

@CRZbulabula CRZbulabula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants