Skip to content
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-6856. HA aware reads from Snapshots #7988

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ivandika3
Copy link
Contributor

@ivandika3 ivandika3 commented Feb 28, 2025

What changes were proposed in this pull request?

This adds a support for Ozone client to be able to do read-only snapshot operations (GetSnapshotInfo, ListSnapshots, SnapshotDiff, ListSnapshotDiffJobs) from non-leader OM.

For example, currently Snapdiff request will always go to the current OM leader. The leader will start a Snapdiff job if it does not exist yet and once it's finished, the user can rerun the snapdiff command again to receive the snapshot diffs returned by the Snapdiff job. However, if there is a OM leader change and another snapshot diff is called, the new OM leader needs to start the Snapdiff job again and the client will receive that the snapdiff is not ready yet, although it was ready at the previous leader. Furthermore, additional snapdiff job also adds some overhead.

This adds the following features

  • Single (no-failover) proxy implementation to pick a specific OM node to get snapshot from SingleOMFailoverProxyProviderBase
  • Supports for non-leader OM node to serve snapshot-related reads
    • This is supported by adding a new omNodeId proto field which if set means that the OM request is intended for the particular OM node
    • The client request will fail immediately for any NotLeaderException since it implies that the OM node does not accept the request.
  • Ozone snapshot shell supports to read snapshots from followers

A possible usage would be to implement asynchronous bucket replication using bucket snapshot and snapdiffs similar to Cloudera Replication Manager (https://docs.cloudera.com/replication-manager/1.5.4/replication-policies/topics/rm-pvce-understand-ozone-replication-policy.html) mentioned in https://issues.apache.org/jira/browse/HDDS-12307. Since asynchronous replication does not require the most up-to-date key information, we can use OM listener (#7262) to generate snapdiff jobs required for the incremental snapshot. This way, the OM leader does not need to handle the replication related requests.

In the future, we can address https://issues.apache.org/jira/browse/HDDS-9666 to support reading keys in a snapshot from non-leader OM.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6856

How was this patch tested?

Unit test (proxy provider implementation), integration test (Ozone client), and acceptance test (Ozone shell, I moved the snapshot shell tests to be under ozone-ha environment).

Clean CI: https://github.com/ivandika3/ozone/actions/runs/13590426911

@ivandika3 ivandika3 self-assigned this Feb 28, 2025
@ivandika3 ivandika3 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Feb 28, 2025
@ivandika3 ivandika3 marked this pull request as ready for review March 1, 2025 02:28
Copy link
Contributor

@peterxcli peterxcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, feel free to take a look and see if they make sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshot https://issues.apache.org/jira/browse/HDDS-6517
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants