Skip to content

HDDS-16127. Document OmKeyInfo key location version semantics - #11018

Open
chihsuan wants to merge 4 commits into
apache:masterfrom
chihsuan:HDDS-16127
Open

HDDS-16127. Document OmKeyInfo key location version semantics#11018
chihsuan wants to merge 4 commits into
apache:masterfrom
chihsuan:HDDS-16127

Conversation

@chihsuan

@chihsuan chihsuan commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Document the existing OmKeyInfo.keyLocationVersions behavior:

  • Bucket versioning can retain multiple location groups in one OmKeyInfo.
  • For a committed key, dataSize contains only the latest version size.
  • Metadata written before HDDS-5472 may contain earlier blocks in later groups, so callers accounting for all versions should use getBlocksLatestVersionOnly().
  • HDDS-15728 object versioning stores each object version in a separate OmKeyInfo.

This is a documentation-only change.

What is the link to the Apache JIRA?

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

How was this patch tested?

mvn -pl :ozone-common compile -DskipShade -DskipRecon -DskipDocs
git diff --check

Generated-by: Claude Code (Opus 5)

Copilot AI lite review requested due to automatic review settings August 13, 2026 14:40
@chihsuan
chihsuan marked this pull request as ready for review August 13, 2026 16:50
@chihsuan chihsuan changed the title HDDS-16127. Fix quota repair usedBytes for versioned buckets HDDS-16127. Document that OmKeyInfo holds a single key version Aug 14, 2026
@smengcl smengcl added the documentation Improvements or additions to documentation label Aug 21, 2026
Comment on lines +77 to 82
/**
* Block locations of the key, one group per key version. No write path produces more than one group today, so a
* key holds a single version and {@code dataSize} covers all of its blocks. Object versioning (HDDS-15728) keeps
* each object version in its own OmKeyInfo rather than adding groups here.
*/
private List<OmKeyLocationInfoGroup> keyLocationVersions;

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.

It looks like the current write path can create more than one location group.

testOverWriteKeyWithAndWithOutVersioning enables versioning, overwrites a key through the client, and verifies that keyLocationVersions has two groups.

dataSize contains only the latest version’s size. Therefore, quota repair can undercount used space.

HDDS-15728 proposes a future layout, but it does not remove the current path. Pls remove this statement, or handle multiple groups.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! @smengcl

You're right, the wording rules out a case testOverWriteKeyWithAndWithOutVersioning actually reaches, so it does need to change. I'll reword it to describe the versioned-bucket case rather than deny it.

On handling multiple groups, I'd like to check with you before going that way. Fixing the active-table recount on its own would still leave snapshotUsedBytes collapsing (HDDS-16184) and leave repair and delete disagreeing on the same key (HDDS-16178), and the EC formula question in HDDS-16176 may well change the conversion again, so it seems to grow into a set of four rather than a single fix. Since no write path exercises versioning today, I leaned toward documenting it accurately for now, but I'm happy to take on the whole set if you feel it's worth doing properly. What do you think?

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 @chihsuan . Let's just document it properly atm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @smengcl I’ve updated the Javadoc and PR description accordingly. 🙏

@chihsuan chihsuan changed the title HDDS-16127. Document that OmKeyInfo holds a single key version HDDS-16127. Document OmKeyInfo key location version semantics Aug 22, 2026
@chihsuan
chihsuan requested a review from smengcl August 22, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants