-
Notifications
You must be signed in to change notification settings - Fork 91
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
Conversation
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
)
No description provided.