szetszwo commented on code in PR #8600: URL: https://github.com/apache/ozone/pull/8600#discussion_r2145559332
########## hadoop-hdds/docs/content/feature/OM-HA.md: ########## @@ -125,7 +125,23 @@ ozone om [global options (optional)] --bootstrap --force Note that using the _force_ option during bootstrap could crash the OM process if it does not have updated configurations. +## Automatic Snapshot Installation for Stale Ozone Managers + +Sometimes an OM follower node may be offline or fall so far behind the leader OM's log that it cannot catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. Review Comment: Since git diff compares files line by line, I suggest using short lines for better tracking. I also revise some sentenses. ```md Sometimes an OM follower node may be offline or fall far behind the OM leader's raft log. Then, it cannot easily catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. ``` ########## hadoop-hdds/docs/content/feature/OM-HA.md: ########## @@ -125,7 +125,23 @@ ozone om [global options (optional)] --bootstrap --force Note that using the _force_ option during bootstrap could crash the OM process if it does not have updated configurations. +## Automatic Snapshot Installation for Stale Ozone Managers + +Sometimes an OM follower node may be offline or fall so far behind the leader OM's log that it cannot catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. + +How it works: + +1. Leader determines that the follower is too far behind. +2. Leader notifies the follower to catch up via snapshot. Review Comment: Let's change it to `... to install a snapshot.` ########## hadoop-hdds/docs/content/feature/OM-HA.md: ########## @@ -125,7 +125,23 @@ ozone om [global options (optional)] --bootstrap --force Note that using the _force_ option during bootstrap could crash the OM process if it does not have updated configurations. +## Automatic Snapshot Installation for Stale Ozone Managers + +Sometimes an OM follower node may be offline or fall so far behind the leader OM's log that it cannot catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. + +How it works: + +1. Leader determines that the follower is too far behind. +2. Leader notifies the follower to catch up via snapshot. +3. The follower downloads and installs the latest snapshot from the leader. +4. After installing the snapshot, the follower OM resumes normal operation and log replication from the new state. + +This logic is implemented in the [`OzoneManagerStateMachine.notifyInstallSnapshotFromLeader()` method](https://github.com/apache/ozone/blob/931bc2d8a9e8e8595bb49034c03c14e2b15be865/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L521-L541). Review Comment: Let's point to a particular release: ```md This logic is implemented in the `OzoneManagerStateMachine.notifyInstallSnapshotFromLeader()`; see the [code](https://github.com/apache/ozone/blob/ozone-2.0.0/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L520-L531) in Release 2.0.0. ``` It would be great if there is a way to specify a base URL variable something like below: ``` BASE_URL=https://github.com/apache/ozone/blob/ozone-2.0.0 ``` Then the link becomes ```md [code](${BASE_URL}/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L520-L531) ``` ########## hadoop-hdds/docs/content/feature/OM-HA.md: ########## @@ -125,7 +125,23 @@ ozone om [global options (optional)] --bootstrap --force Note that using the _force_ option during bootstrap could crash the OM process if it does not have updated configurations. +## Automatic Snapshot Installation for Stale Ozone Managers + +Sometimes an OM follower node may be offline or fall so far behind the leader OM's log that it cannot catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. + +How it works: + +1. Leader determines that the follower is too far behind. +2. Leader notifies the follower to catch up via snapshot. +3. The follower downloads and installs the latest snapshot from the leader. Review Comment: > ... the latest snapshot from the leader. Side note: we should support install snapshot from another follower in order to reduce the load of the leader. ########## hadoop-hdds/docs/content/feature/OM-HA.md: ########## @@ -125,7 +125,23 @@ ozone om [global options (optional)] --bootstrap --force Note that using the _force_ option during bootstrap could crash the OM process if it does not have updated configurations. +## Automatic Snapshot Installation for Stale Ozone Managers + +Sometimes an OM follower node may be offline or fall so far behind the leader OM's log that it cannot catch up by replaying individual log entries. The OM HA implementation includes an automatic snapshot installation and recovery process for such cases. + +How it works: + +1. Leader determines that the follower is too far behind. +2. Leader notifies the follower to catch up via snapshot. +3. The follower downloads and installs the latest snapshot from the leader. +4. After installing the snapshot, the follower OM resumes normal operation and log replication from the new state. + +This logic is implemented in the [`OzoneManagerStateMachine.notifyInstallSnapshotFromLeader()` method](https://github.com/apache/ozone/blob/931bc2d8a9e8e8595bb49034c03c14e2b15be865/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L521-L541). + +In most scenarios, stale OMs will recover automatically, even if they have missed a large number of operations. Manual intervention (such as running `ozone om --bootstrap`) is only required when adding a new OM node to the cluster or when explicitly requested by support instructions. + ## References * Check [this page]({{< ref "design/omha.md" >}}) for the links to the original design docs * Ozone distribution contains an example OM HA configuration, under the `compose/ozone-om-ha` directory which can be tested with the help of [docker-compose]({{< ref "start/RunningViaDocker.md" >}}). +* [Apache Ratis State Machine API documentation](https://github.com/apache/ratis/blob/3612bcaf7d3e48a658935fc8b250e5d3b35df174/ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java) Review Comment: Use a release tag: https://github.com/apache/ratis/blob/ratis-3.1.3/ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java -- 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]
