[pve-devel] [PATCH pve-guest-common] PVE::Replication - cleanup job state on job removal

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jun 27 11:19:35 CEST 2017


On Tue, Jun 27, 2017 at 10:29:22AM +0200, Dietmar Maurer wrote:
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> ---
>  PVE/Replication.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/PVE/Replication.pm b/PVE/Replication.pm
> index 7608d4d..da3ee05 100644
> --- a/PVE/Replication.pm
> +++ b/PVE/Replication.pm
> @@ -206,6 +206,7 @@ sub replicate {
>  	# remove all local replication snapshots (lastsync => 0)
>  	prepare($storecfg, $sorted_volids, $jobid, 0, undef, $logfunc);
>  
> +	PVE::ReplicationState::write_job_state($jobcfg, undef);

$run_replication_nolock() will re-add it afterwards when it does
PVE::ReplicationState::record_job_end() on that $jobcfg.

Maybe record_job_end() is actually a better place for this? If it
doesn't get an $err passed and $jobcfg->{remove_job} is set?

>  	PVE::ReplicationConfig::delete_job($jobid); # update config
>  	$logfunc->("job removed");
>  
> -- 
> 2.11.0




More information about the pve-devel mailing list