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

[grpcvtctldserver] Fix backup detail limit math #8402

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Jun 29, 2021

We always want to base off the total number of backups, not the total
number after applying the overall limit.

Signed-off-by: Andrew Mason amason@slack-corp.com

Description

tl;dr I'm bad at math. Consider this:

  • 25 total backups
  • limit = 10
  • detailedLimit = 5

Then,

  • totalBackups = req.Limit = 10
  • backupsToSkip = len(bhs) - totalBackups = 25 - 10 = 15
  • backupsToSkipDetails = totalBackups - detailedLimit = 10 - 5 = 5

this means we would skip getting details for only the first 5 backups, and show details for the remaining 25 - 5 = 20 backups (then, after applying the overall limit, we would show details for all 10 backups).

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

We always want to base off the total number of backups, not the total
number after applying the overall limit.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 requested a review from doeg June 29, 2021 20:02
@ajm188 ajm188 added this to In progress in Vtctld Service via automation Jun 29, 2021
@ajm188 ajm188 merged commit a59c8a0 into vitessio:main Jun 29, 2021
Vtctld Service automation moved this from In progress to Done Jun 29, 2021
@ajm188 ajm188 deleted the am_vtctld_backup_detail_fix branch June 29, 2021 23:32
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jul 6, 2021
…il_fix

[grpcvtctldserver] Fix backup detail limit math
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jul 23, 2021
…il_fix

[grpcvtctldserver] Fix backup detail limit math
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants