[pve-devel] [PATCH manager v2] Jobs: fix scheduling after updating job from a different node

Fabian Ebner f.ebner at proxmox.com
Wed Jul 20 14:07:40 CEST 2022


Am 15.07.22 um 14:34 schrieb Dominik Csapak:
> since the jobs are configured clusterwide in pmxcfs, a user can use any
> node to update the config of them. for some configs (schedule/enabled)
> we need to update the last runtime in the state file, but this
> is sadly only node-local.
> 
> to also update the state file on the other nodes, we introduce
> a new 'detect_changed_runtime_props' function that checks and saves relevant
> properties from the config to the statefile each round of the scheduler if they
> changed.
> 
> this way, we can detect changes in those and update the last runtime too.
> 
> the only situation where we don't detect a config change is when the
> user changes back to the previous configuration in between iterations.
> This can be ignored though, since it would not be scheduled then
> anyway.
> 
> in 'synchronize_job_states_with_config' we switch from reading the
> jobstate unconditionally to check the existance of the statefile
> (which is the only condition that can return undef anyway)
> so that we don't read the file multiple times each round.
> 
> Fixes: 530b0a71 ("fix #4053: don't run vzdump jobs when they change from
> disabled->enabled")
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>

Looks good to me:
Reviewed-by: Fabian Ebner <f.ebner at proxmox.com>





More information about the pve-devel mailing list