Skip to content

Commit

Permalink
skip already transitioned objects in data-mover
Browse files Browse the repository at this point in the history
Issue: BB-592
  • Loading branch information
Kerkesni committed Jul 24, 2024
1 parent e19a1e5 commit ee122ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extensions/replication/tasks/CopyLocationTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,11 @@ class CopyLocationTask extends BackbeatTask {
'object contents have changed');
}
}
if (objMD.getDataStoreName() === actionEntry.getAttribute('toLocation')) {
// The object was already transitioned to the destination location
return errors.InvalidObjectState.customizeDescription(
'object already transitioned');
}
return null;
}

Expand All @@ -824,6 +829,11 @@ class CopyLocationTask extends BackbeatTask {
actionEntry.setError(err);
}
log.info('action execution ended', actionEntry.getLogInfo());
// skip object if it was already transitioned
if (err.InvalidObjectState || err.code === 'InvalidObjectState') {
log.info('object skipped: invalid object state', actionEntry.getLogInfo());
return { committable: true };
}
if (!actionEntry.getResultsTopic()) {
// no result requested, we may commit immediately
return { committable: true };
Expand Down

0 comments on commit ee122ec

Please sign in to comment.