The `recoverLocallyUpToGlobalCheckpoint` step of peer recovery may take an extended period of time, but today we do not disable the recovery monitor during this step so if it takes more than 30 minutes (by default) then the recovery will time out, fail, and retry repeatedly. We should disable the recovery monitor during this step.
server/src/main/java/org/elasticsearch/indices/recovery/RecoveryTarget.java
decRef();
                }
            }
        }
    }
    public void notifyListener(RecoveryFailedException e, boolean sendShardFailure) {
        listener.onRecoveryFailure(state(), e, sendShardFailure);
    }
    
    public void markAsDone() {
        if (finished.compareAndSet(false, true)) {
            assert multiFileWriter.tempFileNames.isEmpty() : "not all temporary files are renamed";
            try {
                
                
                indexShard.postRecovery("peer recovery done");
            } finally {
                
                decRef();
            }
            listener.onRecoveryDone(state(), indexShard.getTimestampRange());
        }
    }
    @Override
    protected void closeInternal() {
        try {
            multiFileWriter.close();
        } finally {