Skip to content

Commit

Permalink
Add final dataset blocks to the list of migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jun 30, 2022
1 parent 92cbfa6 commit cf20517
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dbs/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,22 @@ func startMigrationRequest(rec MigrationRequest) ([]MigrationReport, error) {
}
}

// if input is a dataset we should find its blocks and add them for migration
if !strings.Contains(input, "#") {
blocks, err := GetBlocks(rurl, input)
if err != nil {
msg = fmt.Sprintf("unable to get blocks for dataset %s", input)
log.Println(msg)
return []MigrationReport{migrationReport(req, msg, status, err)},
Error(err, DatabaseErrorCode, msg, "dbs.migrate.startMigrationRequest")
}
for _, blk := range blocks {
if !utils.InList(blk, srcParentBlocks) {
migBlocks = append(migBlocks, blk)
}
}
}

// if no migration blocks found to process return immediately
if len(migBlocks) == 0 {
msg = fmt.Sprintf("%s is already fulfilled, no blocks found for migration", mstr)
Expand Down

0 comments on commit cf20517

Please sign in to comment.