Skip to content

[vtctld] Migrate ListBackups as GetBackups in new vtctld server#7352

Merged
rohit-nayak-ps merged 5 commits intovitessio:masterfrom
tinyspeck:am_vtctld_listbackups
Jan 23, 2021
Merged

[vtctld] Migrate ListBackups as GetBackups in new vtctld server#7352
rohit-nayak-ps merged 5 commits intovitessio:masterfrom
tinyspeck:am_vtctld_listbackups

Conversation

@ajm188
Copy link
Contributor

@ajm188 ajm188 commented Jan 23, 2021

Description

Migrates ListBackups as GetBackups in the new rpcs. Functionality is the same. I also added a util package for going from a backupstorage.BackupHandle to a proto message, and I un-exported the TestTabletManagerClient type I added in #7346 because I want to enforce the singleton pattern I documented through the type system.

Example:

❯ vtctldclient --server "localhost:15999" GetTablets
zone1-0000000100 commerce 0 master SFO-M-AMASON02:15100 SFO-M-AMASON02:17100 [] 2021-01-23T21:53:39Z
zone1-0000000101 commerce 0 replica SFO-M-AMASON02:15101 SFO-M-AMASON02:17101 [] <null>
zone1-0000000102 commerce 0 rdonly SFO-M-AMASON02:15102 SFO-M-AMASON02:17102 [] <null>
❯ vtctlclient -server "localhost:15999" Backup zone1-0000000101
❯ vtctldclient --server "localhost:15999" GetBackups commerce 0
2021-01-23.215429.zone1-0000000101

Related Issue(s)

Checklist

  • Should this PR be backported? No
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build
  • VTAdmin

Andrew Mason added 5 commits January 22, 2021 17:04
Signed-off-by: Andrew Mason <amason@slack-corp.com>
…oproto

Signed-off-by: Andrew Mason <amason@slack-corp.com>
…d tests

Signed-off-by: Andrew Mason <amason@slack-corp.com>
The reason this should not be exported is that we want to enforce a
singleton usage for these testutil implementations, and the best way to
ensure that is to make it impossible for users to create a new instance
by hiding the type away.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 requested review from deepthi and doeg January 23, 2021 02:51
@ajm188 ajm188 requested a review from sougou as a code owner January 23, 2021 02:51
Copy link
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

Looks good to me. I trust your judgement on whether you want to try testing this locally before it's merged!

}

// ListBackups is part of the backupstorage.BackupStorage interface.
func (bs *backupStorage) ListBackups(ctx context.Context, dir string) ([]backupstorage.BackupHandle, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Implementing a whole new fake is so much work but it will definitely pay off 🏆 thank you!

@ajm188 ajm188 requested a review from rohit-nayak-ps January 23, 2021 21:58
@rohit-nayak-ps rohit-nayak-ps merged commit 0c75403 into vitessio:master Jan 23, 2021
@askdba askdba added this to the v9.0 milestone Jan 25, 2021
ajm188 pushed a commit to tinyspeck/vitess that referenced this pull request Feb 11, 2021
[vtctld] Migrate ListBackups as GetBackups in new vtctld server
setassociative pushed a commit to tinyspeck/vitess that referenced this pull request Mar 11, 2021
[vtctld] Migrate ListBackups as GetBackups in new vtctld server
ajm188 pushed a commit to tinyspeck/vitess that referenced this pull request Apr 6, 2021
[vtctld] Migrate ListBackups as GetBackups in new vtctld server

Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 deleted the am_vtctld_listbackups branch May 29, 2021 10:25
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