Skip to content

Commit

Permalink
Reset migration status if number of retries less than threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jul 9, 2022
1 parent 07170a3 commit 9b18b17
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dbs/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,17 @@ func updateMigrationStatus(mrec MigrationRequest, status int) error {
stm = CleanStatement(stm)
mid := mrec.MIGRATION_REQUEST_ID
retryCount := mrec.RETRY_COUNT
if status == FAILED || status == TERM_FAILED {
retryCount += 1
// if our status is FAILED we check for retry count
// if retry count is less then threshold we increment retry count and set status to IN PROGRESS
// this will allow migration service to pick up failed migration request
// otherwise we permanently terminate the migration request and set its status to TERM_FAILED
if status == FAILED {
if retryCount <= MigrationRetries {
retryCount += 1
status = IN_PROGRESS
} else {
status = TERM_FAILED
}
}
if utils.VERBOSE > 0 {
var args []interface{}
Expand Down

0 comments on commit 9b18b17

Please sign in to comment.