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 1278165001 for ; Tue, 21 Jul 2020 15:04:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 095A718D96 for ; Tue, 21 Jul 2020 15:04:06 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 id 6727618D8C for ; Tue, 21 Jul 2020 15:04:05 +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 33A43432D1 for ; Tue, 21 Jul 2020 15:04:05 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Tue, 21 Jul 2020 15:03:37 +0200 Message-Id: <20200721130337.934653-7-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200721130337.934653-1-f.gruenbichler@proxmox.com> References: <20200721130337.934653-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.071 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pull.rs] Subject: [pbs-devel] [RFC proxmox-backup 6/6] sync: improve log output X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 13:04:36 -0000 add a bit more info and simplify some log statements. Signed-off-by: Fabian Grünbichler --- Notes: I am not sure whether this idea of 'last successful sync' == 'last successful backup' is such a good idea in any case.. this also might be too verbose for busy datastores - maybe just printing a count of skipped, already previously synced snapshots is better? src/client/pull.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/pull.rs b/src/client/pull.rs index 421260a3..1718c752 100644 --- a/src/client/pull.rs +++ b/src/client/pull.rs @@ -310,8 +310,10 @@ pub async fn pull_group( "backup-id": group.backup_id(), }); + worker.log(format!("sync group {}", group)); let mut result = client.get(&path, Some(args)).await?; let mut list: Vec = serde_json::from_value(result["data"].take())?; + worker.log(format!("remote returned {} snapshots", list.len())); list.sort_unstable_by(|a, b| a.backup_time.cmp(&b.backup_time)); @@ -336,7 +338,10 @@ pub async fn pull_group( remote_snapshots.insert(backup_time); if let Some(last_sync_time) = last_sync { - if last_sync_time > backup_time { continue; } + if last_sync_time > backup_time { + worker.log(format!("skipping snapshot {} - already synced", snapshot)); + continue; + } } let options = HttpClientOptions::new() @@ -411,14 +416,14 @@ pub async fn pull_store( let owner = tgt_store.create_backup_group(&group, &username)?; // permission check if owner != username { // only the owner is allowed to create additional snapshots - worker.log(format!("sync group {}/{} failed - owner check failed ({} != {})", - item.backup_type, item.backup_id, username, owner)); + worker.log(format!("sync group {} failed - owner check failed ({} != {})", + group, username, owner)); errors = true; continue; // do not stop here, instead continue } if let Err(err) = pull_group(worker, client, src_repo, tgt_store.clone(), &group, delete).await { - worker.log(format!("sync group {}/{} failed - {}", item.backup_type, item.backup_id, err)); + worker.log(format!("sync group {} failed - {}", group, err)); errors = true; continue; // do not stop here, instead continue } @@ -429,7 +434,7 @@ pub async fn pull_store( let local_groups = BackupGroup::list_groups(&tgt_store.base_path())?; for local_group in local_groups { if new_groups.contains(&local_group) { continue; } - worker.log(format!("delete vanished group '{}/{}'", local_group.backup_type(), local_group.backup_id())); + worker.log(format!("delete vanished group '{}'", local_group)); if let Err(err) = tgt_store.remove_backup_group(&local_group) { worker.log(err.to_string()); errors = true; -- 2.20.1