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 delete BackupPolicy error #276

Merged
merged 4 commits into from
Jul 7, 2021
Merged

Fix delete BackupPolicy error #276

merged 4 commits into from
Jul 7, 2021

Conversation

ysksuzuki
Copy link
Contributor

Signed-off-by: Yusuke Suzuki yusuke-suzuki@cybozu.co.jp

@ysksuzuki ysksuzuki self-assigned this Jul 6, 2021
ysksuzuki added 2 commits July 6, 2021 17:08
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
backup/backup.go Outdated
@@ -418,7 +418,7 @@ func (bm *BackupManager) backupBinlog(ctx context.Context, op bkop.Operator) err
pw2 = nil

bw := &ByteCountWriter{}
key := calcKey(bm.cluster.Namespace, bm.cluster.Name, constants.BinlogFilename, lastBackup.Time.Time)
key := calcKey(bm.cluster.Namespace, bm.cluster.Name, constants.BinlogFilename, lastBackup.Time.Time.UTC())
Copy link
Member

@ymmt2005 ymmt2005 Jul 6, 2021

Choose a reason for hiding this comment

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

This is a bug by itself that is worth another issue or PR.
Also, I think the conversion to UTC should happen in calcKey because by doing so, any use of calcKey is protected.

In fact, there is another use of calcKey in this same file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright. Will create another PR for it, and convert time zone inside calcKey.

@@ -194,7 +194,7 @@ var _ = Describe("Backup/Restore", func() {
Expect(bc.contents).To(HaveLen(1))

time.Sleep(1100 * time.Millisecond)
restorePoint := time.Now()
restorePoint := time.Now().UTC()
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this conversion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary. Will revert.

Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
Copy link
Member

@ymmt2005 ymmt2005 left a comment

Choose a reason for hiding this comment

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

LGTM

@ysksuzuki ysksuzuki merged commit 3288f03 into main Jul 7, 2021
@ysksuzuki ysksuzuki deleted the fix-delete-backup-policy branch July 7, 2021 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants