private boolean shouldRunOfflineRepair() {
    // the conditions to offline repair the Delete request.
    // 1. the feature is enabled and the repair request db is not null
    // 2. and at least one replica returned successful status.
    // 3. and error code precedence is over AmbryUnavailable. We don't do offline repair if BlobExpired or TooManyRequests.
    // 4. It's not a delete request from the BackgroundDeleter. We don't do offline repair for background deleter.
    RouterErrorCode errorCode = ((RouterException) operationException.get()).getErrorCode();
    // @formatter:off
    return (repairRequestsDb != null
        && routerConfig.routerDeleteOfflineRepairEnabled
        && operationTracker.getSuccessCount() > 0
        && getPrecedenceLevel(errorCode) >= getPrecedenceLevel(RouterErrorCode.AmbryUnavailable)
        && !isServiceBackgroundDeleter());
    // @formatter:on
  }
Check if we want to save the partially failed request to the secondary storage and fix it offline.
@return true if choose to fix it offline.
ambry-router/src/main/java/com/github/ambry/router/DeleteOperation.java