You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Aryan Gupta (Jira)" <ji...@apache.org> on 2025/04/10 19:47:00 UTC

[jira] [Created] (HDDS-12820) Improve OM Ratis Snapshot Installation: Avoid Repeated Downloads When Follower Disk is Full

Aryan Gupta created HDDS-12820:
----------------------------------

             Summary: Improve OM Ratis Snapshot Installation: Avoid Repeated Downloads When Follower Disk is Full
                 Key: HDDS-12820
                 URL: https://issues.apache.org/jira/browse/HDDS-12820
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Aryan Gupta


When a follower OM receives a Ratis snapshot from the leader OM, it attempts to download and install a RocksDB checkpoint via notifyInstallSnapshotFromLeader() in OMStateMachine. However, if the follower OM does not have enough disk space, the snapshot installation fails, and null is returned.
This causes the Ratis follower to respond with InstallSnapshotResult.SNAPSHOT_UNAVAILABLE. Once this happens, the follower still proceeds to call RDBSnapshotProvider.init(), which cleans up any partially downloaded snapshots. The leader then retries snapshot installation, resulting in repeated snapshot downloads, filling up the disk, and entering a loop until manual cleanup or space is freed.

Inside OMStateMachine.notifyInstallSnapshotFromLeader(), check the available disk space at the target OM DB directory. If the space is more than the leader OM DB checkpoint, then only the leader should start transferring snapshots to the follower. We may determine the space on the follower node by running a time-based 'du' command.

Maybe in notifyInstallSnapshotFromLeader() we can set a flag to true if it returns null, which isn't due to a space issue.
{code:java}
if (availableSpace < expectedCheckpointSize) {
  LOG.warn("Not enough disk space for snapshot. Required: {}, Available: {}",
           expectedCheckpointSize, availableSpace);
  isCleanupRequired = false; // No partial download
  return CompletableFuture.completedFuture(null); // Will lead to SNAPSHOT_UNAVAILABLE
}
isCleanupRequired = true;
// Proceed with snapshot installation...{code}
and in notifySnapshotInstalled(),
{code:java}
case SNAPSHOT_UNAVAILABLE:
  // Currently, only trigger for the one who installed snapshot
  if (isCleanupRequired() && ozoneManager.getOmRatisServer().getServerDivision().getPeer().equals(peer)) {
    ozoneManager.getOmSnapshotProvider().init();
  }
  break;{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org