-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-11891. Design doc for find Block missing Key tool #7548
Open
xichen01
wants to merge
4
commits into
apache:master
Choose a base branch
from
xichen01:HDDS-11891
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+106
−0
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
hadoop-hdds/docs/content/design/find-block-missing-key.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
title: Erasure Coding in Ozone | ||
summary: Use Erasure Coding algorithm for efficient storage | ||
date: 2024-12-09 | ||
jira: HDDS-11891 | ||
status: draft | ||
--- | ||
<!-- | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. See accompanying LICENSE file. | ||
--> | ||
|
||
## Summary | ||
|
||
This document provides a design overview of a client-side tool used to locate Block Missing Keys. | ||
|
||
In Ozone, the metadata of a Key is stored in the OM (Ozone Manager), while the data is stored on DNs (DataNodes). If the metadata of a Key is missing, the Key becomes invisible. However, if the metadata is intact but the data is missing, this issue cannot be identified until the Key is accessed. The goal of this tool is to detect such scenarios where the data is missing but the metadata remains intact, referred to as a Block Missing Key. | ||
|
||
|
||
## Definitions | ||
|
||
- Key: In this document, a Key refers to both OBJECT_STORE objects and files in FSO buckets. At the Block level, they are treated the same way. | ||
- Missing: Refers to a situation where a Key cannot be read successfully. If a Key is missing some replicas but can still be read, it is not considered a missing Key. This tool also provides functionality to detect Keys with partially missing replicas. | ||
- Block Missing Key: Refers to a Key whose data is missing while its metadata remains intact. | ||
|
||
|
||
## Limitations | ||
|
||
The following cases are not included in the scope of Block Missing Key detection in this document: | ||
|
||
1. Key data loss caused by Block data corruption. | ||
2. Data block integrity errors, such as mismatched chunksum values. | ||
|
||
This tool only verifies the existence of Block data and metadata. It does not validate the correctness of data blocks, meaning it does not read Blocks to calculate their chunksum for comparison with metadata. | ||
|
||
|
||
## Potential Scenarios for Block Missing Keys | ||
|
||
1. The Container containing the Key is in a `DELETED` or `DELETING` state. | ||
2. The Container containing the Key is missing, and there is no record of the Container in the cluster. | ||
3. The metadata of the Key’s Block is missing. | ||
4. The data of the Key’s Block is missing. | ||
|
||
|
||
## Scanning Process Overview | ||
|
||
1. Retrieve Key metadata: | ||
- Gather metadata such as the Key name and BlockID (consisting of ContainerID and localID). | ||
- After collecting sufficient Key metadata, organize it for further processing. | ||
- There are three approaches to retrieve metadata (detailed in [Three Approaches to Retrieve Metadata](https://www.notion.so/meeting-room-Conference-Room-d17916fda32244f2b5edfec93c165cee?pvs=21)). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Notion should be markdown, we should include it here in the PR itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
2. Organize Keys by Container: | ||
- Group Keys by their respective Containers in local memory. Keys within the same Container are grouped together, and relevant information is recorded. | ||
3. Query Container Status: | ||
- Send requests to the SCM (Storage Container Manager) to obtain Container locations (i.e., which DNs the Container resides on). | ||
- If the Container is in a `DELETED` or `DELETING` state, or if the Container cannot be found, the Key is marked as a Block Missing Key. | ||
- If the Container is found and its status is normal, continue to check the existence of the Blocks. | ||
- Containers in the `OPEN` and `RECOVERING` state should be skipped. However, for Containers in the `CLOSING` or `QUASI_CLOSED` state, further investigation is needed, as these states may indicate Block issues. | ||
4. Query Block Existence: | ||
- Based on the information provided by the SCM, send `headBlocks` requests to the DNs to verify the existence of the Blocks. | ||
- A single `headBlocks` request can query multiple Blocks at once. | ||
- A new DN API for `headBlocks` requests needs to be developed. | ||
5. Determine Block Missing Keys: | ||
- Once the existence of all Block replicas for a Key is verified, the client determines whether the Key is a Block Missing Key based on its replication tolerance: | ||
- For simple replication: the total number of replicas. | ||
- For EC Keys: Parity Cell count + 1. | ||
6. Final Verification: | ||
- Perform an additional verification for detected Block Missing Keys to confirm whether the Key has been deleted. | ||
- If the Key is no longer present in OM, it is confirmed as a Block Missing Key. | ||
|
||
|
||
## Additional Features | ||
|
||
1. Result Output: Supports exporting results to a specified file in a predefined format. | ||
2. Progress Tracking: Supports saving scan progress to enable resumption from checkpoints. | ||
3. Partial Replica Check: Can detect Keys with partially missing replicas. This feature may overlap with the `find-missing-padding` command. | ||
4. Parallel Bucket Scanning: Supports scanning multiple buckets concurrently. | ||
5. Retry Mechanism: For large clusters, where scans may take significant time, and DN restarts are likely, the tool should support retries to improve reliability. | ||
|
||
|
||
## Three Approaches to Retrieve Metadata | ||
|
||
1. Using `listStatusLight` and `listKeysLight`: | ||
- Advantages: Lightweight and high performance. | ||
- Disadvantages: Requires API enhancements to include Block information. | ||
2. Using `listStatus` and `listKeys`: | ||
- Advantages: Can be used directly without additional development. | ||
- Disadvantages: Lower performance and may become a bottleneck. | ||
3. Directly Scanning RocksDB: | ||
- Advantages: Offers the best performance. If an independent snapshot is used, it can operate without affecting online services. | ||
- Disadvantages: Most complex implementation, and it can only be executed on nodes with access to OM RocksDB data. | ||
|
||
|
||
## Suggestions for Improvement | ||
|
||
1. API Enhancement: Develop lightweight APIs to directly retrieve Key Block information. | ||
2. Fault Tolerance: Ensure robust handling of DN failures, network timeouts, and other issues to complete scans effectively. | ||
3. Tool Integration: Consider integrating this tool into existing administration tools, such as the `ozone fs` command, for better usability. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update title and summary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.