siddhantsangwan commented on code in PR #8460: URL: https://github.com/apache/ozone/pull/8460#discussion_r2161282061
########## hadoop-hdds/docs/content/design/full-volume-handling.md: ########## @@ -0,0 +1,203 @@ +--- +title: Full Volume Handling +summary: Immediately trigger Datanode heartbeat on detecting full volume +date: 2025-05-12 +jira: HDDS-12929 +status: implemented +author: Siddhant Sangwan, Sumit Agrawal +--- + +<!-- + 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 +Trigger datanode heartbeat immediately when the container being written to is (close) to full, or volume is full, +or container is unhealthy, while handling a write request. The immediate heartbeat will contain close container action. +The overall objective is to avoid Datanode disks from getting completely full and preventing degradation of write +performance. + +## Problem +When a Datanode volume is close to full, the SCM may not be immediately aware of this because storage reports are only +sent to it every one minute (`HDDS_NODE_REPORT_INTERVAL_DEFAULT = "60s"`). Additionally, SCM only has stale +information about the current size of a container because container size is only updated when an Incremental Container +Report (event based, for example when a container transitions from open to closing state) is received or a Full +Container Report (`HDDS_CONTAINER_REPORT_INTERVAL_DEFAULT = "60m"`) is received. This can lead to the SCM +over-allocating blocks to containers on a Datanode volume that has already reached the min free space boundary. + +In the future, in https://issues.apache.org/jira/browse/HDDS-12151 we plan to fail writes for containers on a volume +that has reached the min free space boundary. +So, in the future, when the Datanode fails writes for such a volume, overall write performance will drop because the +client will have to request for a different set of blocks. + +We currently do queue a close container action to be sent in the next heartbeat, when: +1. Container is at 90% capacity. +2. Volume is full, counting committed space. That is `available - reserved - committed - min free space <= 0`. +3. Container is `UNHEALTHY`. + +But since the next heartbeat can be sent up to 30 seconds later in the worst case, this reaction time is too slow. +This design proposes sending Datanode heartbeat immediately so SCM can get the close container action +immediately. This will help in reducing performance drop because of write failures when +https://issues.apache.org/jira/browse/HDDS-12151 is implemented in the future. + +### The definition of a full volume +Currently, a volume is considered full if the following (existing) method returns true. +```java Review Comment: Removed. I've only kept the full volume definition. -- 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]
