From: Dominik Csapak <d.csapak@proxmox.com>
To: Dietmar Maurer <dietmar@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2] client/pull: log snapshots that are skipped because of time
Date: Fri, 4 Jun 2021 16:03:51 +0200 [thread overview]
Message-ID: <96614e7a-f9fe-bb7f-313e-4dc3934b5a40@proxmox.com> (raw)
In-Reply-To: <1669610747.49.1622814872295@webmail.proxmox.com>
On 6/4/21 15:54, Dietmar Maurer wrote:
>
>> +impl std::fmt::Display for SkipInfo {
>> + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
>> + if self.count > 1 {
>> + write!(
>> + f,
>> + "{} snapshots ({}..{}) that are older than the newest local snapshot",
>> + self.count,
>> + proxmox::tools::time::epoch_to_rfc3339_utc(self.oldest)
>> + .map_err(|_| std::fmt::Error)?,
>> + proxmox::tools::time::epoch_to_rfc3339_utc(self.newest)
>> + .map_err(|_| std::fmt::Error)?,
>> + )
>
> what is the purpose of this complex message (why we want to show self.oldest and self.newest)?
> Its confusing me more than it helps...
was the suggestion from Fabian, and i did like the idea to tell the user
*which* snapshots were skipped (and if we only have one line,
there is not many ways to represent that)
>
>> + } else if self.count == 1 {
>> + write!(
>> + f,
>> + "1 snapshot ({}) that is older than the newest local snapshot",
>> + proxmox::tools::time::epoch_to_rfc3339_utc(self.oldest)
>> + .map_err(|_| std::fmt::Error)?,
>> + )
>
> do we really need this special case?
if we want to keep the info which snapshots are skipped, then
yes imho, otherwise we have line such as
1 snapshots (X..X) that are older than the newest local snapshot
which is grammatically wrong (1 snapshots are older)
and contains redundant info (X..X)
>
>> + } else {
>> + write!(f, "0 snapshots")
>
> Instead, I would avoid to call this function if count is 0 ...
i already avoid it calling below, but i wanted to implement this,
in case we reuse that struct somewhere else
>
>> + }
>> + }
>> +}
>> +
>> pub async fn pull_group(
next prev parent reply other threads:[~2021-06-04 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 13:54 Dietmar Maurer
2021-06-04 14:03 ` Dominik Csapak [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-06-07 8:30 Dominik Csapak
2021-06-04 10:43 Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96614e7a-f9fe-bb7f-313e-4dc3934b5a40@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=dietmar@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal