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

[Feature]To take out of sync full/delta snapshot, delegate the incoming http request from backup Follower to the backup Leader. #354

Closed
Tracked by #107
ishan16696 opened this issue Jul 5, 2021 · 3 comments · Fixed by #353
Assignees
Labels
kind/enhancement Enhancement, improvement, extension release/beta Planned for Beta release of the Feature

Comments

@ishan16696
Copy link
Member

ishan16696 commented Jul 5, 2021

Feature (What you would like to be added):
If backup-restore Follower receives the HTTP/HTTPS requests to take out-of-sync full/delta snapshot then delegate that incoming request to the backup-restore Leader and Let the backup-restore leader take/upload the out-of-sync snapshot(full as well as incremental).

Motivation (Why is this needed?):
While adding support to bring the snapshotters (both full and incremental) go routines under the control of the leader-election as described here, We observed that all backup-restore Follower's http handler don't have updated SnapshotterState, if the request comes to the REST endpoints fo follower to take out of sync full/delta snapshot then the snapshot taken will not be the latest, and it is not good to let backup-restore Follower take the snapshot, it should delegate the request to backup-restore Leader.

Approach/Hint to the implement solution (optional):

@ishan16696 ishan16696 added the kind/enhancement Enhancement, improvement, extension label Jul 5, 2021
@ishan16696 ishan16696 self-assigned this Jul 5, 2021
@ishan16696
Copy link
Member Author

Approach: Get the backup-restore Leader URL and have a reverse proxy on it. so, using this reverse proxy we can able to delegate the incoming HTTP/HTTPS requests from backup-restore Follower to backup-restore Leader.
Using NewSingleHostReverseProxy get the reverse proxy obj which help us to serve the incoming HTTP request.

@timuthy
Copy link
Member

timuthy commented Oct 29, 2021

Using NewSingleHostReverseProxy get the reverse proxy obj which help us to serve the incoming HTTP request.

Can you explain how the follower knows about the target URL of the leader?

@ishan16696
Copy link
Member Author

ishan16696 commented Oct 29, 2021

I have already implemented this feature in this commit of this leader-election PR. Please refer to this func call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhancement, improvement, extension release/beta Planned for Beta release of the Feature
Projects
None yet
3 participants