From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B1AD37C3B7 for ; Fri, 15 Jul 2022 11:21:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9EB88264A3 for ; Fri, 15 Jul 2022 11:20:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 15 Jul 2022 11:20:39 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E36AE422C1 for ; Fri, 15 Jul 2022 11:20:38 +0200 (CEST) Message-ID: Date: Fri, 15 Jul 2022 11:20:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Dominik Csapak , pve-devel@lists.proxmox.com References: <20220714074202.1298324-1-d.csapak@proxmox.com> <8be282a5-772c-a978-4b4a-3e76deea9f80@proxmox.com> From: Fabian Ebner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH manager] Jobs: fix scheduling when updating on unrelated nodes X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 09:21:09 -0000 Am 15.07.22 um 11:01 schrieb Dominik Csapak> On 7/15/22 10:51, Fabian Ebner wrote: >> >>> so that we don't read the file multiple times each round. >>> Could add Fixes: 530b0a71 ("fix #4053: don't run vzdump jobs when they change from disabled->enabled") for completeness. >>> Signed-off-by: Dominik Csapak >> >> What about starting_job and started_job? The saved_props are lost when >> that function writes its new state. Maybe there should be a wrapper for >> updating the job state that always preserves certain properties. > > i guess you're right, but currently that makes no difference since > we're only concerned with not running too early which is irrelevant > for the starting/started case > (and it'll be synced up again after the next iteration) > Hmm, it won't work for (at least) a minutely job. The job will run, the state will lose the saved_props and then synchronize_job_states_with_config will update the last runtime in the next run_jobs, and the job won't run that iteration. >>> @@ -192,6 +206,39 @@ sub update_last_runtime { >>>       }); >>>   } >>>   +# saves some properties of the jobcfg into the jobstate so we can >>> track >>> +# them on different nodes (where the update was not done) >>> +# and update the last runtime when they change >>> +sub update_job_props { >> >> update_saved_props or detect_changed_runtime_props might be a bit more >> telling > > then i'd opt for 'detect_changed_runtime_props' since it's a bit more > verbose imho > While the logic for updating the last run time in PVE/API2/Backup.pm's update_job call is slightly different (won't update when going from enabled to disabled), I feel like we could switch to (unconditionally) calling update_job_props there too?