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

Pbm 88 adding storages #184

Merged
merged 12 commits into from
Feb 6, 2019
Merged

Pbm 88 adding storages #184

merged 12 commits into from
Feb 6, 2019

Conversation

percona-csalguero
Copy link
Contributor

No description provided.

TestgGlobalWithDaemon and TestBackupToS3 are passing.
I didn't remove iyet the old DestinationType, DestinationDir and
other fields that are going to be deprecated just to jave a starting
point where backups are working with the new storage but wihout code
cleanup.
Now the restore uses a new reader pkg that creates the readers chain.
Code cleanup hasn't been made yet. There are a lot of commented out
lines that will be removed after implementing and testing an S3 reader.
Added list storages command but still need to validate storages
}

createTempDir()
createTempBucket(storages.Storages["s3-us-west"].S3)

Choose a reason for hiding this comment

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

Error return value of createTempBucket is not checked (from errcheck)


func createTempDir() {
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
os.MkdirAll(tmpDir, os.ModePerm)

Choose a reason for hiding this comment

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

Error return value of os.MkdirAll is not checked (from errcheck)

if err != nil {
t.Fatalf("Cannot get storage %q: %s", storageName, err)
}
err = os.MkdirAll(localStg.Filesystem.Path, os.ModePerm)

Choose a reason for hiding this comment

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

ineffectual assignment to err (from ineffassign)

// and the oplog generator is starting to count from 101 sequentially, so last inserted document = count
rs1BeforeCount := int64(rs1LastOplogDoc["o"].(bson.M)["number"].(int))
rs2BeforeCount := int64(rs2LastOplogDoc["o"].(bson.M)["number"].(int))
rs1AfterCount, err := s1Session.DB(dbName).C(colName).Find(nil).Count()

Choose a reason for hiding this comment

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

ineffectual assignment to err (from ineffassign)

rs1BeforeCount := int64(rs1LastOplogDoc["o"].(bson.M)["number"].(int))
rs2BeforeCount := int64(rs2LastOplogDoc["o"].(bson.M)["number"].(int))
rs1AfterCount, err := s1Session.DB(dbName).C(colName).Find(nil).Count()
rs2AfterCount, err := s2Session.DB(dbName).C(colName).Find(nil).Count()

Choose a reason for hiding this comment

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

ineffectual assignment to err (from ineffassign)

@percona-csalguero percona-csalguero merged commit 5902ea2 into master Feb 6, 2019
@percona-csalguero percona-csalguero deleted the PBM-88-Adding-storages branch May 16, 2019 16:07
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.

3 participants