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

Fix issue 5881 #5894

Merged
merged 1 commit into from
Feb 24, 2023
Merged

Fix issue 5881 #5894

merged 1 commit into from
Feb 24, 2023

Conversation

Lyndon-Li
Copy link
Contributor

@Lyndon-Li Lyndon-Li commented Feb 21, 2023

This is to fix issue 5881, enhance the PVB tracker in two modes, Track and Taken

Fix issue #5881

Signed-off-by: Lyndon-Li <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2023

Codecov Report

Merging #5894 (08b8498) into main (a83c153) will decrease coverage by 0.68%.
The diff coverage is 90.62%.

@@            Coverage Diff             @@
##             main    #5894      +/-   ##
==========================================
- Coverage   40.84%   40.16%   -0.68%     
==========================================
  Files         248      249       +1     
  Lines       21648    22044     +396     
==========================================
+ Hits         8843     8855      +12     
- Misses      12160    12543     +383     
- Partials      645      646       +1     
Impacted Files Coverage Δ
pkg/backup/pvc_snapshot_tracker.go 85.36% <87.50%> (-4.29%) ⬇️
pkg/backup/item_backupper.go 77.74% <100.00%> (+0.17%) ⬆️
pkg/cmd/cli/backup/describe.go 0.00% <0.00%> (ø)
pkg/cmd/util/output/describe.go 0.00% <0.00%> (ø)
pkg/cmd/util/output/backup_structured_describer.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

if volume.PersistentVolumeClaim != nil {
t.pvcs.Insert(key(pod.Namespace, volume.PersistentVolumeClaim.ClaimName))
// Track indicates a volume from a pod should be snapshotted by pod volume backup.
func (t *pvcSnapshotTracker) Track(pod *corev1api.Pod, volumeName string) {
Copy link
Contributor

@reasonerjt reasonerjt Feb 22, 2023

Choose a reason for hiding this comment

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

Track .vs. Take is a little confusing, how about pass the status or mode as a parameter and make the naming more explicit?

so the caller will call tracker.Track(pod, volume, VOLUME_SNAPSHOT) or tracker.Track(pod, volume, PODVOLUME_BACKUP)

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Feb 22, 2023

Choose a reason for hiding this comment

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

I have been thinking of how to clearly distinguish them, actually:

  • Track means the volume is decided to be handled by PVB according to rules and annotations. We need to record this situation because we don't want the BIA and volume snapshotter to process the volume again
  • Take means the volume has been processed by PVB successfully. We need to record this situation, because we want the volumes that ought to be processed by PVB but missed by the backup with the 1st pod should be processed by backups with other pods. (In the case of RWX mount)

Therefore, if we want to use status, the status should be something like:

  • VestedToPVB
  • ProcessedByPVB

What do you think? @reasonerjt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants