Skip to content

Commit

Permalink
Fiix order of parent blocks; close channel in ProcessMigrationCtx
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jul 10, 2022
1 parent 65b7205 commit 79442fc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dbs/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func GetParentBlocks(rurl, block string, order int) ([]MigrationBlock, error) {
}
} else {
for _, blk := range r.Blocks {
parentBlocks = append(parentBlocks, MigrationBlock{Block: blk, Order: order})
parentBlocks = append(parentBlocks, MigrationBlock{Block: blk, Order: order - 1})
}
}
delete(umap, r.Index)
Expand All @@ -349,7 +349,7 @@ func GetParentBlocks(rurl, block string, order int) ([]MigrationBlock, error) {
out = append(out, pblk)
// request parents of given block and decrease its order since
// it will allow to process it before our block
results, err := GetParentBlocks(rurl, pblk.Block, pblk.Order-1)
results, err := GetParentBlocks(rurl, pblk.Block, pblk.Order-2)
if err != nil {
if utils.VERBOSE > 1 {
log.Printf("fail to get url=%s block=%v error=%v", rurl, pblk, err)
Expand Down Expand Up @@ -891,10 +891,9 @@ func (a *API) ProcessMigrationCtx(timeout int) error {

// create channel to report when operation will be completed
ch := make(chan bool)
// defer close(ch)
defer close(ch)

// set default status
// status = FAILED
status = PENDING

// backward compatibility with DBS migration server which uses migration_rqst_id
Expand Down

0 comments on commit 79442fc

Please sign in to comment.