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

HDDS-11959. Remove tests for non-Ratis SCM #7612

Merged
merged 17 commits into from
Jan 9, 2025

Conversation

chungen0126
Copy link
Contributor

@chungen0126 chungen0126 commented Dec 23, 2024

What changes were proposed in this pull request?

Remove tests that exercise non-Ratis SCM.

Please describe your PR in detail:

  1. Remove tests for non-Ratis SCM
  2. Remove unnecessary "Enable SCM Ratis" config.
  3. Set OZONE_SCM_RATIS_PORT_KEY and OZONE_SCM_GRPC_PORT_KEY as a free port to avoid port conflict from MiniOzoneClusterProvider.
  4. Wait for pipeline ready in some tests to fix tests failure.(TestSCMContainerManagerMetrics, TestContainerStateMachine, and TestReconTasks)
  5. Disable test cases in SCM integration tests where test implementation is specific to non-Ratis mode (should be updated in HDDS-11989, HDDS-12202, and HDDS-12023)
  6. Disable test cases in SCM unit tests where test implementation is specific to non-Ratis mode (should be updated in HDDS-11986)

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-11959

How was this patch tested?

https://github.com/chungen0126/ozone/actions/runs/12621318024

@chungen0126 chungen0126 marked this pull request as ready for review December 24, 2024 04:34
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @chungen0126 for the patch.

There are some leftover references in tests:

conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);

conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);

conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, false);

(please check if TestSecureOzoneCluster works without this setting)

Also in MiniOzoneClusterImpl:

//TODO: HDDS-6897
//Disabling Ratis for only of MiniOzoneClusterImpl.
//MiniOzoneClusterImpl doesn't work with Ratis enabled SCM
if (StringUtils.isNotEmpty(
conf.get(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY))
&& SCMHAUtils.isSCMHAEnabled(conf)) {
scmStore.setSCMHAFlag(true);
scmStore.persistCurrentState();
SCMRatisServerImpl.initialize(clusterId, scmId,
SCMHANodeDetails.loadSCMHAConfig(conf, scmStore)
.getLocalNodeDetails(), conf);
}

@chungen0126
Copy link
Contributor Author

Thanks @adoroszlai for reviewing.

There are some leftover references in tests:

conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);

conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);

(please check if TestSecureOzoneCluster works without this setting)

Also in MiniOzoneClusterImpl:

//TODO: HDDS-6897
//Disabling Ratis for only of MiniOzoneClusterImpl.
//MiniOzoneClusterImpl doesn't work with Ratis enabled SCM
if (StringUtils.isNotEmpty(
conf.get(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY))
&& SCMHAUtils.isSCMHAEnabled(conf)) {
scmStore.setSCMHAFlag(true);
scmStore.persistCurrentState();
SCMRatisServerImpl.initialize(clusterId, scmId,
SCMHANodeDetails.loadSCMHAConfig(conf, scmStore)
.getLocalNodeDetails(), conf);
}

I'm leaving the reference in MiniOzoneClusterImpl because that enabling SCM Ratis in all tests with MiniOzoneClusterImpl leads to many tests failures. TestSCMSnapshot.java and TestSCMInstallSnapshot.java should set OZONE_SCM_HA_ENABLE_KEY to true because MiniOzoneClusterImpl is non-Ratis SCM by default.
I believe we should fix this in HDDS-6897.

(please check if TestSecureOzoneCluster works without this setting)

TestSecureOzoneCluster doesn't work with OZONE_SCM_HA_ENABLE_KEY set to true but works without it. However, MiniOzoneClusterImpl is non-Ratis SCM by default.

I'll convert this to draft and fix HDDS-6897 first. I think that would make the change clearer.

@chungen0126 chungen0126 marked this pull request as draft December 24, 2024 09:42
@chungen0126 chungen0126 marked this pull request as ready for review January 5, 2025 23:44
@chungen0126 chungen0126 requested a review from adoroszlai January 5, 2025 23:44
@chungen0126
Copy link
Contributor Author

chungen0126 commented Jan 7, 2025

There is only one OZONE_SCM_HA_ENABLE_KEY in all the tests which is in TestOzoneConfigurationFields. It should be removed after the config is removed.

@adoroszlai
Copy link
Contributor

It should be removed after the TestOzoneConfigurationFields is removed.

I guess you mean when the config itself is removed.

@chungen0126
Copy link
Contributor Author

It should be removed after the TestOzoneConfigurationFields is removed.

I guess you mean when the config itself is removed.

Yes, you're right, I wrote the wrong word. Thanks for the reminder.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @chungen0126 for the patch, mostly LGTM.

* Test Recon SCM HA Snapshot Download implementation.
*/
@Timeout(300)
public class TestReconScmHASnapshot {
Copy link
Contributor

Choose a reason for hiding this comment

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

Both TestReconScmHASnapshot and TestReconScmNonHASnapshot are covered by TestReconScmSnapshot.

@jojochuang jojochuang merged commit 400e94d into apache:master Jan 9, 2025
29 checks passed
@jojochuang
Copy link
Contributor

Merged. Thanks @chungen0126 and @adoroszlai for review.

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.

3 participants