Skip to content

HDDS-16247. Separate StorageContainerLocationProtocol RPC identity from its internal Java interface - #11098

Open
echonesis wants to merge 4 commits into
apache:masterfrom
echonesis:test-HDDS-16247
Open

echonesis wants to merge 4 commits into
apache:masterfrom
echonesis:test-HDDS-16247

Conversation

@echonesis

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

StorageContainerLocationProtocol currently serves two different purposes:

  1. Its fully qualified class name is used as the historical Hadoop RPC protocol identity.
  2. Its methods define the internal Java interface used by SCM clients and implementations.

The actual Hadoop RPC protocol is StorageContainerLocationProtocolPB, which extends the generated Protobuf blocking interface and provides the RPC protocol name, version, and Kerberos metadata. Keeping the internal Java methods in StorageContainerLocationProtocol incorrectly makes changes to an internal interface appear to be changes to the RPC protocol.

This pull request separates these responsibilities:

  • Keeps StorageContainerLocationProtocol as an empty final class so that its historical FQCN remains available as the RPC identity.
  • Moves the internal Java methods and constants to the new StorageContainerLocationInternalInterface.
  • Updates internal implementations, clients, translators, SCM HA proxy handling, and callers to use the new internal interface.
  • Adds focused tests confirming that:
    • StorageContainerLocationProtocolPB continues to provide the historical protocol name, version, and Kerberos metadata.
    • The RPC identity class is separate from the internal Java interface.

What is the link to the Apache JIRA

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

How was this patch tested?

Local Tests

mvn -pl :hdds-server-framework test \
  -Dtest=TestStorageContainerLocationProtocolPB \
  -DskipShade -DskipRecon -DskipDocs

# Secure-mode authentication and SCM service authorization passed:
mvn -pl :ozone-integration-test -am test \
  -Dtest=TestSecureOzoneCluster#testSecureScmAndOmStartupAndAccessControl \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -DskipShade -DskipRecon -DskipDocs \
  -Dmdep.analyze.skip=true

# SCM HA proxy and failover coverage passed:
mvn -pl :ozone-integration-test -am test \
  -Dtest=TestFailoverWithSCMHA \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -DskipShade -DskipRecon -DskipDocs \
  -Dmdep.analyze.skip=true

GitHub Actions CI: https://github.com/echonesis/ozone/actions/runs/32688066691

Generated-by: Codex (GPT-5)

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @echonesis +1 LGTM.

# Conflicts:
#	hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/spi/impl/TestStorageContainerServiceProviderImpl.java
Preserve the shared Kerberos test getters and StorageContainerLocationInternalInterface in TestSecureOzoneCluster.

Validated with JDK 21: clean reactor build, TestStorageContainerLocationProtocolPB, secure SCM/OM startup and access control, TestFailoverWithSCMHA, and checkstyle.
Preserve dynamic SCM proxy reconfiguration while using StorageContainerLocationInternalInterface for container clients and test mocks.

Validated with JDK 21: clean integration-test reactor build, 17 unit tests, 13 integration tests covering secure SCM/OM access control, SCM HA failover and OM SCM nodes reconfiguration, and CI checkstyle (0 violations).

Generated-by: Codex (GPT-6)

@rich7420 rich7420 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @echonesis for the patch. Protocol metadata, secure SCM/OM access control, and SCM HA tests passed locally (6 tests, 0 failures or errors). Checkstyle passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants