Skip to content

HDDS-13569. Separate OM and SCM metadata dirs in MiniOzoneClusterImpl#8937

Merged
jojochuang merged 6 commits into
apache:masterfrom
smengcl:HDDS-13569-sep
Aug 15, 2025
Merged

HDDS-13569. Separate OM and SCM metadata dirs in MiniOzoneClusterImpl#8937
jojochuang merged 6 commits into
apache:masterfrom
smengcl:HDDS-13569-sep

Conversation

@smengcl
Copy link
Copy Markdown
Contributor

@smengcl smengcl commented Aug 12, 2025

What changes were proposed in this pull request?

Currently MiniOzoneClusterImpl (non-HA) mixes OM and SCM metadata dirs all under ozone-meta. e.g. under ./hadoop-ozone/integration-test/target/test-dir/MiniOzoneClusterImpl-53868f3f-ffb9-495f-96ab-da3f551b9f06/

.
└── ozone-meta
    ├── datanode-1
    │   ├── data-0
    │   │   └── hdds
    │   │       └── 53868f3f-ffb9-495f-96ab-da3f551b9f06
    │   │           ├── current
    │   │           │   └── containerDir0
    │   │           │       ├── 1
    │   │           │       │   ├── chunks
    │   │           │       │   └── metadata
    │   │           │       ├── 2
    │   │           │       │   ├── chunks
    │   │           │       │   └── metadata
    │   │           ├── DS-974ed241-60c2-416c-aff0-4074acd5165f
    │   │           │   ├── container.db
    │   │           │   ├── db.checkpoints
    │   │           │   └── db.snapshots
    │   │           │       └── checkpointState
    │   │           └── tmp
    │   │               ├── deleted-containers
    │   │               └── disk-check
    │   ├── meta
    │   │   ├── db.checkpoints
    │   │   ├── db.snapshots
    │   │   │   └── checkpointState
    │   │   ├── dnlayoutversion
    │   │   ├── webserver
    │   │   └── witnessed_container.db
    │   └── ratis
    │       ├── 15d8f352-a9ca-474c-afe5-6a154bb0694f
    │       │   ├── current
    │       │   └── sm
    │       ├── 82cd09bf-ad27-44c0-b979-5625bf6ad9f4
    │       │   ├── current
    │       │   └── sm
    │       ├── ac9d6dfc-16c0-4796-95a1-7b50c331b1e2
    │       │   ├── current
    │       │   └── sm
    │       └── tmp
    │           └── disk-check
    ├── datanode-2
...
    ├── datanode-3
...
    ├── db.checkpoints
    ├── db.snapdiff
    ├── db.snapshots
    │   ├── checkpointState
    │   └── diffState
    │       ├── compaction-log
    │       ├── compaction-sst-backup
    │       └── snapDiff
    ├── om
    │   └── current
    ├── om.db
    │   └── archive
    ├── ratis
    │   └── bf265839-605b-3f16-9796-c5ba1605619e
    │       ├── current
    │       └── sm
    ├── scm
    │   └── current
    ├── scm-ha
    │   └── 53868f3f-ffb9-495f-96ab-da3f551b9f06
    │       ├── current
    │       └── sm
    ├── scm.db
    │   └── archive
    ├── snapshot
    └── webserver

This makes it hard to calculate OM metadata disk usage.

Also, some dirs are incorrectly shared among OM and SCM, such as snapshot and webserver.

The goal is to separate those dirs for OM and SCM like we would do in prod.

What is the link to the Apache JIRA

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

How was this patch tested?

  • Existing tests
  • Eyeball new meta dir structure:
.
├── om
│   ├── data
│   │   ├── db.checkpoints
│   │   ├── db.snapshots
│   │   │   ├── checkpointState
│   │   │   │   ├── om.db-1bcfd4d3-6c44-4f16-b0ea-c5035fcdeead
│   │   │   │   └── om.db-6dc5ca52-0471-4c84-94b4-39ee9a90bc9b
│   │   │   └── diffState
│   │   │       ├── compaction-log
│   │   │       ├── compaction-sst-backup
│   │   │       └── snapDiff
│   │   ├── om
│   │   │   └── current
│   │   └── om.db
│   │       └── archive
│   ├── ozone-metadata
│   │   ├── db.snapdiff
│   │   ├── snapshot
│   │   └── webserver
│   └── ratis
│       └── bf265839-605b-3f16-9796-c5ba1605619e
│           ├── current
│           └── sm
├── ozone-metadata
│   ├── datanode-1
│   │   ├── data-0
│   │   │   └── hdds
│   │   │       └── fa2ba8de-2651-4ed0-9e02-6c9bc16258a4
│   │   │           ├── current
│   │   │           │   └── containerDir0
│   │   │           │       ├── 1
│   │   │           │       │   ├── chunks
│   │   │           │       │   └── metadata
│   │   │           │       ├── 2
│   │   │           │       │   ├── chunks
│   │   │           │       │   └── metadata
...
│   │   │           ├── DS-8aaa133f-56c4-414b-a5e4-6941bf65028e
│   │   │           │   ├── container.db
│   │   │           │   ├── db.checkpoints
│   │   │           │   └── db.snapshots
│   │   │           │       └── checkpointState
│   │   │           └── tmp
│   │   │               ├── deleted-containers
│   │   │               └── disk-check
│   │   ├── meta
│   │   │   ├── db.checkpoints
│   │   │   ├── db.snapshots
│   │   │   │   └── checkpointState
│   │   │   ├── dnlayoutversion
│   │   │   └── witnessed_container.db
│   │   └── ratis
│   │       ├── 66b1eb71-d37d-438b-afa4-2ca5646ab092
│   │       │   ├── current
│   │       │   └── sm
│   │       ├── aef89295-7190-49f2-a483-f3a8dcc3b457
│   │       │   ├── current
│   │       │   └── sm
│   │       ├── c219a99e-5f88-4537-8bf5-41e07a246622
│   │       │   ├── current
│   │       │   └── sm
│   │       └── tmp
│   │           └── disk-check
│   ├── datanode-2
...
│   └── datanode-3
...
└── scm
    ├── data
    │   ├── db.checkpoints
    │   ├── db.snapshots
    │   │   └── checkpointState
    │   ├── scm
    │   │   └── current
    │   └── scm.db
    │       └── archive
    ├── ozone-metadata
    │   ├── snapshot
    │   └── webserver
    └── ratis
        └── fa2ba8de-2651-4ed0-9e02-6c9bc16258a4
            ├── current
            └── sm

@smengcl smengcl added the test label Aug 12, 2025
@smengcl smengcl changed the title HDDS-13569. Improve metadata dirs separation for OM and SCM in MiniOzoneClusterImpl HDDS-13569. Separate OM and SCM metadata dirs in MiniOzoneClusterImpl Aug 12, 2025
@smengcl smengcl marked this pull request as ready for review August 13, 2025 19:46
@smengcl smengcl requested a review from Copilot August 15, 2025 01:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Separates OM and SCM metadata directories in MiniOzoneClusterImpl to improve directory organization and enable easier disk usage calculations. Currently both components store metadata under a shared "ozone-meta" directory, making it difficult to track OM-specific metadata usage.

  • Creates separate directory structures for OM and SCM components with dedicated subdirectories
  • Updates configuration to use component-specific paths for database, Ratis, and web server directories
  • Modifies test code to use the new OM-specific configuration key for metadata directory access

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UniformDatanodesFactory.java Updates datanode metadata directory path to use "ozone-metadata" subdirectory
MiniOzoneHAClusterImpl.java Passes HA flag to SCM configuration method
MiniOzoneClusterImpl.java Implements separate directory structures and configuration for OM/SCM components
MiniOzoneCluster.java Adds configuration cleanup to prevent conflicts between cluster builds
TestOMSnapshotDAG.java Updates test to use OM-specific configuration key instead of generic metadata dirs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@jojochuang jojochuang merged commit 4f12199 into apache:master Aug 15, 2025
29 checks passed
@jojochuang
Copy link
Copy Markdown
Contributor

Merged. Thanks @smengcl

@smengcl
Copy link
Copy Markdown
Contributor Author

smengcl commented Aug 18, 2025

Thanks @jojochuang for the review.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants