Skip to content

Adding deprecate message to backup hooks#11491

Merged
deepthi merged 7 commits intovitessio:release-15.0from
planetscale:deprecate-backup-hooks
Oct 14, 2022
Merged

Adding deprecate message to backup hooks#11491
deepthi merged 7 commits intovitessio:release-15.0from
planetscale:deprecate-backup-hooks

Conversation

@rsajwani
Copy link
Contributor

@rsajwani rsajwani commented Oct 13, 2022

Signed-off-by: Rameez Sajwani rameezwazirali@hotmail.com

Description

This PR generates deprecation message for backup hooks. They are plan to be removed in v16.0

Related Issue(s)

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Oct 13, 2022

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • If this is a change that users need to know about, please apply the release notes (needs details) label so that merging is blocked unless the summary release notes document is included.

If a new flag is being introduced:

  • Is it really necessary to add this flag?
  • Flag names should be clear and intuitive (as far as possible)
  • Help text should be descriptive.
  • Flag names should use dashes (-) as word separators rather than underscores (_).

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow should be required, the maintainer team should be notified.

Bug fixes

  • There should be at least one unit or end-to-end test.
  • The Pull Request description should include a link to an issue that describes the bug.

Non-trivial changes

  • There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • Should be documented, either by modifying the existing documentation or creating new documentation.
  • New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • vtctl command output order should be stable and awk-able.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from VTop, if used there.

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
@rsajwani rsajwani self-assigned this Oct 13, 2022
@rsajwani rsajwani marked this pull request as ready for review October 14, 2022 00:04
@frouioui frouioui mentioned this pull request Oct 14, 2022
100 tasks
Copy link
Contributor

@GuptaManan100 GuptaManan100 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!

…ackup-hooks

Signed-off-by: Manan Gupta <manan@planetscale.com>
@GuptaManan100
Copy link
Contributor

GuptaManan100 commented Oct 14, 2022

@rsajwani I am taking the liberty to merge the release-15.0 branch since the VTOrc test names have changed and they are required now.

func registerBackupFlags(fs *pflag.FlagSet) {
fs.StringVar(&backupStorageHook, "backup_storage_hook", backupStorageHook, "if set, we send the contents of the backup files through this hook (deprecated: hooks will be disabled in v16.0. Please use ExternalCompressorCmd/ExternalDecompressorCmd instead).")
fs.StringVar(&backupStorageHook, "backup_storage_hook", backupStorageHook, "if set, we send the contents of the backup files through this hook.")
_ = fs.MarkDeprecated("backup_storage_hook", "--backup_storage_hook is deprecated; Consider using ExternalCompressorCmd/ExternalDecompressorCmd instead.")
Copy link
Contributor

Choose a reason for hiding this comment

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

For this, pflag is going to do roughly {{f.Name}} is deprecated.{{ if .Message ne "" }} {{ .Message }}{{ endif }}, so you should try this out and adjust accordingly.

Copy link
Contributor Author

@rsajwani rsajwani Oct 14, 2022

Choose a reason for hiding this comment

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

fixed it...

Flag --backup_storage_hook has been deprecated, consider using ExternalCompressorCmd/ExternalDecompressorCmd instead.
W1014 10:26:31.712856 67759 backup.go:211] checkNoDB failed, found active db vt_ks
W1014 10:26:32.067150 67759 builtinbackupengine.go:165] --backup_storage_hook is deprecated; Consider using ExternalCompressorCmd/ExternalDecompressorCmd instead.

Comment on lines +164 to +166
if backupStorageHook != "" {
log.Warning("--backup_storage_hook is deprecated; Consider using ExternalCompressorCmd/ExternalDecompressorCmd instead.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is redundant

Copy link
Collaborator

Choose a reason for hiding this comment

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

We debated this a bit. The flag deprecation warning shows up only at tablet startup, whereas this will show up on every backup/restore, so it does have some additional value.

return nil, err
}
if bm.TransformHook != "" {
log.Warning("--backup_storage_hook is deprecated; Consider using ExternalCompressorCmd/ExternalDecompressorCmd instead.")
Copy link
Contributor

Choose a reason for hiding this comment

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

this is redundant

@ajm188
Copy link
Contributor

ajm188 commented Oct 14, 2022

Looks good to me!

@GuptaManan100 @rsajwani please don't merge this until the deprecation wording is fixed

…ackup-hooks

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
@deepthi deepthi merged commit b2a654c into vitessio:release-15.0 Oct 14, 2022
@deepthi deepthi deleted the deprecate-backup-hooks branch October 14, 2022 23:04
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Oct 14, 2022

I was unable to forwardport this Pull Request to the following branches: main.

rsajwani added a commit to planetscale/vitess that referenced this pull request Oct 26, 2022
* Adding deprecate message to backup hooks

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* adding markdeprecated

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing deprecation message

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing messaging

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fix flag name

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
frouioui pushed a commit that referenced this pull request Oct 28, 2022
* Adding deprecate message to backup hooks (#11491)

* Adding deprecate message to backup hooks

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* adding markdeprecated

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing deprecation message

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing messaging

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fix flag name

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>

* fix release notes and summary

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing some typos in release notes and summary

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* removing newline

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants