HDDS-15879. Ozone Versioning Metadata foundation#10781
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…equest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| } | ||
|
|
||
| /** No-op when status is null (e.g. records without the new field). */ | ||
| public Builder setVersioningStatus(BucketVersioningStatus status) { |
There was a problem hiding this comment.
Nice work keeping the two fields in sync here! One spot that looks left behind:
OzoneManager#getBucketInfo copies only the legacy flag when resolving a link bucket:
Since SUSPENDED maps to flag=false, a suspended bucket read through a link would come back as UNVERSIONED. Should we also add .setVersioningStatus(realBucket.getVersioningStatus()) there?
There was a problem hiding this comment.
Nice catch, Updated, PTAL.
| * Returns the requested versioning status, or null if not being changed. | ||
| * @return BucketVersioningStatus | ||
| */ | ||
| public BucketVersioningStatus getVersioningStatus() { |
There was a problem hiding this comment.
Tiny one: toAuditMap() still only records IS_VERSION_ENABLED, so a status change via the new field would show up as isVersionEnabled=null in the audit log. Worth adding a versioningStatus entry while we're here?
| // absent on records that predate versioning support (treated as the null | ||
| // version). A delete marker has isDeleteMarker set and no data blocks. | ||
| // isNullVersion marks the single overwritable "null version" slot per key. | ||
| private final Long versionId; |
There was a problem hiding this comment.
Could we also add these three fields to isKeyInfoSame() (and toString())? Right now two records differing only in versionId, or a delete marker vs. a regular key, compare as equal. Looks like the follow-up tasks will rely on OmKeyInfo equality in tests; having this in the foundation would prevent false-positive assertions later. OmBucketInfo already includes the new status in both, so this would keep the two helpers consistent.
There was a problem hiding this comment.
Nice catch, Updated, PTAL.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What changes were proposed in this pull request?
This is the first basic task of Ozone versioning, including the following points
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15879
How was this patch tested?
unit test.