Skip to content

Hdds 13184 persist block size#7

Closed
priyeshkaratha wants to merge 41 commits intomasterfrom
HDDS-13184_PersistBlockSize
Closed

Hdds 13184 persist block size#7
priyeshkaratha wants to merge 41 commits intomasterfrom
HDDS-13184_PersistBlockSize

Conversation

@priyeshkaratha
Copy link
Owner

What changes were proposed in this pull request?

Provide a one-liner summary of the changes in the PR Title field above.
It should be in the form of HDDS-1234. Short summary of the change.

Please describe your PR in detail:

  • What changes are proposed in the PR? and Why? It would be better if it is written from third person's
    perspective not just for the reviewer.
  • Provide as much context and rationale for the pull request as possible. It could be copy-paste from
    the Jira's description if the jira is well defined.
  • If it is complex code, describe the approach used to solve the issue. If possible attach design doc,
    issue investigation, github discussion, etc.

Examples of well-written pull requests:

What is the link to the Apache JIRA

Please create an issue in ASF JIRA before opening a pull request, and you need to set the title of the pull
request which starts with the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)

(Please replace this section with the link to the Apache JIRA)

How was this patch tested?

(Please explain how this patch was tested. Ex: unit tests, manual tests, workflow run on the fork git repo.)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this.)

jojochuang and others added 30 commits October 23, 2025 19:54
… not present in compaction log table (apache#9169)

Reviewed-by: Swaminathan Balachandran <swamirishi.sb@gmail.com>
Reviewed-by: Sadanand Shenoy <sadanand.shenoy4898@gmail.com>
… lock again. (apache#9131)

Co-authored-by: Sadanand Shenoy <sadanand.shenoy@cloudera.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @priyeshkaratha, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances Apache Ozone by improving memory management, refining data distribution metrics, and significantly upgrading snapshot functionality. It introduces a bounded byte buffer pool to prevent memory exhaustion in client-side operations and refines container management by delegating tracking to HddsVolume. The SCM command queue metrics are now more efficient with EnumCounters, and a new system for tracking deleted block transaction summaries provides better insights into resource reclamation. Snapshot capabilities are expanded with a manual defragmentation command and a robust local data versioning system. Additionally, ETag handling in the S3 Gateway is made more consistent, and ACL enforcement for key setTimes operations is strengthened.

Highlights

  • Version Updates: Multiple pom.xml files across the project have been updated to version 2.2.0-SNAPSHOT, indicating a routine development cycle progression.
  • Bounded Elastic ByteBuffer Pool: A new BoundedElasticByteBufferPool has been introduced to limit the total size of cached buffers, preventing unbounded memory growth in long-lived RPC clients like S3 Gateway. This is configurable via ozone.client.elastic.byte.buffer.pool.max.size (defaulting to 16GB).
  • Container Management Delegation: Container tracking logic has been refined, with ContainerSet now delegating the management of container IDs (add, remove, iterate, count) to HddsVolume, which uses a ConcurrentSkipListSet for efficient storage.
  • SCM Command Queue Metrics: The internal representation of SCM command queue summaries has been optimized to use EnumCounters instead of generic Map<SCMCommandProto.Type, Integer>, improving efficiency and type safety in various Datanode and SCM components.
  • Deleted Block Transaction Summary: New protobuf messages and API methods have been added to track and expose a summary of deleted block transactions (total count, block count, size) from the SCM. This feature is tied to the STORAGE_DATA_DISTRIBUTION layout feature and is accessible via a new ozone admin scm deletedBlocksTxn summary CLI command.
  • BlockGroup and DeletedBlock Refactoring: A new DeletedBlock class now encapsulates BlockID along with size and replicated size information. The BlockGroup class has been updated to utilize List<DeletedBlock>, ensuring that block deletion requests carry comprehensive size data.
  • RocksDB Checkpoint Handling: Improvements have been made to RocksDB checkpoint handling, including explicit resource closure for TableConfig objects and refactoring of SstFileInfo and CompactionNode for better organization and extensibility.
  • OM Snapshot Defragmentation Command: A new ozone admin om snapshot defrag command has been added, allowing administrators to manually trigger the snapshot defragmentation service on any Ozone Manager node in an HA cluster, with an option for asynchronous execution.
  • S3 Gateway ETag Consistency: ETag handling in the S3 Gateway has been made more robust with new utility methods to stripQuotes and wrapInQuotes, ensuring consistent ETag representation across various S3 operations, especially multipart uploads.
  • OM ACL Enforcement for setTimes: ACL checks for setTimes operations on keys are now performed during the preExecute phase in the Ozone Manager, ensuring that permissions are validated earlier in the request processing lifecycle.
  • OM Snapshot Local Data Versioning: The management of Ozone Manager snapshot local data has been significantly refactored to support versioning, including graph-based dependency tracking, transaction info for purged snapshots, and thread-safe access mechanisms. This enables more granular control and consistency for snapshot data.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several significant enhancements and refactorings. Key changes include the introduction of a BoundedElasticByteBufferPool to prevent unbounded memory growth, and optimizations in ContainerSet to improve performance by tracking containers on a per-volume basis. A major part of this PR is the change to persist block size information in deleted block transactions, which involves modifications across the SCM and common modules, including proto definitions and the introduction of a DeletedBlock class. Additionally, there are substantial refactorings in snapshot management, particularly in OmSnapshotLocalDataManager and the checkpointing servlets, to support snapshot versioning and defragmentation. The ACL check for setTimes has also been correctly moved to preExecute for better enforcement. My main feedback is a minor correction for a copy-pasted description in an enum. Overall, the changes are substantial and appear to improve performance, resource management, and add new features.

"for the last chunk of blocks to support HBase.)"),
WITNESSED_CONTAINER_DB_PROTO_VALUE(9, "ContainerID table schema to use value type as proto");
WITNESSED_CONTAINER_DB_PROTO_VALUE(9, "ContainerID table schema to use value type as proto"),
STORAGE_DATA_DISTRIBUTION(10, "ContainerID table schema to use value type as proto");

Choose a reason for hiding this comment

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

medium

The description for STORAGE_DATA_DISTRIBUTION appears to be a copy-paste from the WITNESSED_CONTAINER_DB_PROTO_VALUE enum constant. Please update it to accurately describe the new layout feature, which seems to be related to persisting block sizes in deleted block transactions.

Suggested change
STORAGE_DATA_DISTRIBUTION(10, "ContainerID table schema to use value type as proto");
STORAGE_DATA_DISTRIBUTION(10, "Persist block size in deleted block transactions.");

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.