-
Notifications
You must be signed in to change notification settings - Fork 148
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
fix(backup): manually synchronizing backup volumes. #2660
Conversation
When users make a Is it possible to synchronize backup volumes by simply editing customer resources? Or do we need to a different method that doesn't involve HTTP calls? |
Users can modify the field |
Can we just simply update |
Yes, we can and modified. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation LGTM.
Currently, the main concern is, will the websocket keep calling BackupVolumeList then Longhorn generates tons of requests to the remote? If users are using public cloud services like S3, it will lead to a higher bill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider just updating SyncRequestedAt
to trigger the sync? We could have a constant value representing that the sync will be just triggered, and the mutator will update it with a qualified time value instead. WDYT?
In this way, for UI or even manifest, users can trigger the sync immediately with the same experience.
backupTarget.Spec.SyncRequestedAt = "now" // metav1.Time{Time: time.Now().UTC()}
P.S. I assume we don't have schema validation for that property.
I think it isn't easy to have a constant value representing to trigger the sync , and the mutator will update it with a qualified time value instead because of https://github.com/longhorn/longhorn-manager/blob/master/webhook/admission/request.go#L43. |
c171459
to
5aeaddf
Compare
Hello @mantissahz Is the PR ready? |
Hi @derekbit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, will Longhorn UI show all backup volumes for all backup targets? If NO, it's better to add an input BackupTargetName
for API SyncBackupTarget
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I meant, you can rely on the mutator to update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, LGTM. however, still have some feedback required to resolve.
P.S. In the current implementation, it's specific for REST API. How do users trigger it by updating the CR? need to exactly update the right time in the syncat field of backup target or backup volume on their own? I still recommend a way that can benefit both interfaces (UI and CLI kubectl)
After a quick discussion with @mantissahz , we added type validation for the sync_at field, so it's infeasible to use a non-time value to trigger the sync. so for non-UI users, we can create a CLI command for it. James will create a ticket for the following improvement. /chart/templates/crds.yaml#L961-L965 syncRequestedAt:
description: The time to request run sync the remote backup target.
format: date-time
nullable: true
type: string |
afe13c0
to
4c502f9
Compare
@mantissahz Ready to review? |
When users make a requst to synchronize the backup target by a new Backup Volume APIs `syncBackupTarget`, it will also trigger the synchronization for thee backup volumes of the backup target. Ref: 7982 Signed-off-by: James Lu <james.lu@suse.com>
@derekbit, Yes, it is ready. |
@Mergifyio backport v1.6.x |
✅ Backports have been created
|
Which issue(s) this PR fixes:
Issue # longhorn/longhorn#7982
What this PR does / why we need it:
When users make a requst to get backup volumes information by Backup Volume Get/List APIs, it will also trigger the synchronization for these backup volumes once.
Special notes for your reviewer:
Additional documentation or context