Skip to content

HDDS-14735. ComponentVersions should not be compared using int values.#9841

Draft
errose28 wants to merge 16 commits intoapache:HDDS-14496-zdufrom
errose28:HDDS-14735-int-version-wrapper
Draft

HDDS-14735. ComponentVersions should not be compared using int values.#9841
errose28 wants to merge 16 commits intoapache:HDDS-14496-zdufrom
errose28:HDDS-14735-int-version-wrapper

Conversation

@errose28
Copy link
Contributor

@errose28 errose28 commented Feb 27, 2026

Draft since this includes changes from #9832

What changes were proposed in this pull request?

ComponentVersion implementations now contain the following methods:

  • serialize (from HDDS-14723. Create one common interface for LayoutFeature and ComponentVersion #9832): Should only be called when sending a version over the network or to disk
  • deserialize: Should only be called when reading a version from the network or disk
  • isSupportedBy: Should be used to check version compatibility between client and server. This also wraps the deserialization.
    • This will also be wrapped by VersionManager#isAllowed to check against apparent version in
      HDDS-14732
  • For example for the client to check "Does this datanode support read block streaming?" you would write
int dnVersion = dnDetails.getCurrentVersion();
if (HDDSVersion.STREAM_BLOCK_SUPPORT.isSupportedBy(dnVersion)) { ... }

All existing client/server version checks have been migrated to these new methods.

Additionally, CURRENT_VERSION has been renamed to SOFTWARE_VERSION in HDDSVersion and OzoneManagerVersion to reflect the terminology used in the new versioning system. For now ClientVersion continues to use CURRENT_VERSION to refer to the latest version because clients are stateless and will not have apparent versions. TBD if we standardize this terminology so clients also refer to their latest version as SOFTWARE_VERSION in the future.

Some changes were generated by Cursor under my guidance and review.

What is the link to the Apache JIRA

HDDS-14735

How was this patch tested?

TODO:

  • Existing tests should pass since no functional change is expected.
  • Unit tests for the new isSupportedBy methods added.

@github-actions github-actions bot added the zdu Pull requests for Zero Downtime Upgrade (ZDU) https://issues.apache.org/jira/browse/HDDS-14496 label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zdu Pull requests for Zero Downtime Upgrade (ZDU) https://issues.apache.org/jira/browse/HDDS-14496

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant