Gargi-jais11 opened a new pull request, #9515:
URL: https://github.com/apache/ozone/pull/9515
## What changes were proposed in this pull request?
The DiskBalancer service creates two separate tmp directories due to
inconsistent path resolution:
- At startup: `/data/tmp/diskBalancer` (incorrect, empty, cleaned up)
- During operations: `/data/hdds/CID-xxx/tmp/diskBalancer/` (correct,
actually used)
```
[root disk1]# tree -d
.
└── hadoop-ozone
└── datanode
└── data
├── hdds
│ └── CID-322ew-ee56-4c35-8e49-f5d7c0f35645
│ ├── current
│ │ ├── containerDir15
│ │ │ ├── 8058
│ │ │ │ ├── chunks
│ │ │ │ └── metadata
│ │ │ └── 8064
│ │ │ ├── chunks
│ │ │ └── metadata
│ │ ├── containerDir17
│ │ │ ├── 9008
│ │ │ │ ├── chunks
│ │ │ │ └── metadata
│ │ │ └── 9068
│ │ │ ├── chunks
│ │ │ └── metadata
│ │ ├── containerDir19
│ │ │ ├── 10007
│ │ │ │ ├── chunks
│ │ │ │ └── metadata
│ │ │ └── 10082
│ │ │ ├── chunks
│ │ │ └── metadata
│ │ └── containerDir21
│ │ └── 11003
│ │ ├── chunks
│ │ └── metadata
│ ├── DS-aa9c8571-9e8e-4948-9c7a-b20bdd75c666
│ │ ├── container.db
│ │ ├── db.checkpoints
│ │ └── db.snapshots
│ │ └── checkpointState
│ └── tmp
│ ├── deleted-containers
│ ├── diskBalancer
│ │ └── 8048
│ │ └── chunks
│ └── disk-check
└── tmp
├── container-copy
└── diskBalancer
```
This needs to be corrected.
Solution:
Correct the initialisation logic of DiskBalancer to create diskBalancer tmp
at correct place. Introduce `DiskBalancer.start()` to construct tmp dir.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14114
## How was this patch tested?
Added unit tests in `TestDiskBalancerService`
And check using docker cluster:
Before fix:
```
bash-5.1$ pwd
/data/hdds3/tmp/diskBalancer
```
**After Fix:**
```
bash-5.1$ pwd
/data/hdds3/hdds/CID-2a0edc92-45ba-4e5a-a292-08d3ed3d4809/tmp/diskBalancer
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]