all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH v4 proxmox-backup 3/8] fix #5982: garbage collection: check atime updates are honored
Date: Thu, 06 Mar 2025 13:02:18 +0100	[thread overview]
Message-ID: <1741261669.opzzyxdxb2.astroid@yuna.none> (raw)
In-Reply-To: <19b58a87-d71c-4be7-a25e-1da612a71097@proxmox.com>

On March 6, 2025 12:30 pm, Christian Ebner wrote:
> On 3/6/25 12:02, Fabian Grünbichler wrote:
>> On March 5, 2025 4:14 pm, Christian Ebner wrote:
>>> +            pre_existing,
>>> +        ) {
>>> +            (true, false) => info!("Access time safety check successful (inserted chunk for test)."),
>>> +            (true, true) => {
>>> +                info!("Access time safety check successful (used pre-existing chunk for test).")
>>> +            }
>>> +            (false, false) => bail!(
>>> +                "Access time safety check failed (inserted chunk for test), is atime support \
>>> +                enabled on datastore backing filesystem?"
>>> +            ),
>>> +            (false, true) => bail!(
>>> +                "Access time safety check failed (used pre-existing chunk for test), is atime \
>>> +                support enabled on datastore backing filesystem?"
>>> +            ),
>>> +        }
>> 
>> this is a bit excessive while at the same time not including the
>> interesting bits..
>> 
>> how about the following:
>> 
>> if metadata_before.accessed()? >= metadata_now.accessed()? {
>>      let chunk_info_str = if pre_existing { "pre-existing" } else { "newly inserted" };
>>      log::warn!("Chunk metadata was not correctly updated during atime test:");
>>      info!("Metadata before update: {metadata_before:?}");
>>      info!("Metadata after update: {metadata_now:?}");
>>      bail!("atime safety check using {chunk_info_str} chunk failed, aborting GC!");
>> }
>> 
>> info!("atime safety check successful, proceeding with GC.");
>> 
>> 
>> would look like this in the task log:
>> 
>> Chunk metadata was not correctly updated during atime test:
>> Metadata before update: Metadata { file_type: FileType { is_file: true, is_dir: false, is_symlink: false, .. }, permissions: Permissions(FilePermissions { mode: 0o100500 (-r-x------) }), len: 158, modified: SystemTime { tv_sec: 1673516596, tv_nsec: 65483144 }, accessed: SystemTime { tv_sec: 1741256689, tv_nsec: 18294604 }, created: SystemTime { tv_sec: 1673516596, tv_nsec: 65483144 }, .. }
>> Metadata after update: Metadata { file_type: FileType { is_file: true, is_dir: false, is_symlink: false, .. }, permissions: Permissions(FilePermissions { mode: 0o100500 (-r-x------) }), len: 158, modified: SystemTime { tv_sec: 1673516596, tv_nsec: 65483144 }, accessed: SystemTime { tv_sec: 1741256689, tv_nsec: 18294604 }, created: SystemTime { tv_sec: 1673516596, tv_nsec: 65483144 }, .. }
>> TASK ERROR: atime safety check using pre-existing chunk failed, aborting GC!
>> 
>> alternatively we could of course do our own pretty printing, or add `#`
>> to the format string to get:
>> 
>> Metadata before update:
>> Metadata {
>>      file_type: FileType {
>>          is_file: true,
>>          is_dir: false,
>>          is_symlink: false,
>>          ..
>>      },
>>      permissions: Permissions(
>>          FilePermissions {
>>              mode: 0o100500 (-r-x------),
>>          },
>>      ),
>>      len: 158,
>>      modified: SystemTime {
>>          tv_sec: 1673516596,
>>          tv_nsec: 65483144,
>>      },
>>      accessed: SystemTime {
>>          tv_sec: 1741256877,
>>          tv_nsec: 225020600,
>>      },
>>      created: SystemTime {
>>          tv_sec: 1673516596,
>>          tv_nsec: 65483144,
>>      },
>>      ..
>> }
>> 
>> I think it is important to get the logging right here because if
>> somebody runs into a failing check, they should report the relevant data
>> to us without the need to jump through hoops.
> 
> Agreed on this and above comments regarding error context, would however 
> opt for a custom output, e.g. something along the line of what is used 
> to output pxar entries via `format_single_line_entry`...
> 
> Do we really need information like file type, size and permissions here? 
> That should already be covered by the chunk insert above?

that's a bit hard to tell a priori ;)

file type is probably not *that* relevant since we assume it is a
regular file, the permissions might very well be relevant, but probably
the actual attributes (like append-only or immutable) would be even more
interesting, in case a filesystem is broken and ignores the update
instead of failing in such cases.

so yeah, maybe just pretty printing the timestamps already is enough
here, it might need to be followed-up with lsattr and questions about
their storage setup in many cases anyway.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

  reply	other threads:[~2025-03-06 12:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 15:14 [pbs-devel] [PATCH v4 proxmox-backup 0/8] fix #5982: check atime update is honored Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 1/8] pbs api types: add garbage collection atime safety check flag Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 2/8] pbs api types: add option to set GC chunk cleanup atime cutoff Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 3/8] fix #5982: garbage collection: check atime updates are honored Christian Ebner
2025-03-06 11:02   ` Fabian Grünbichler
2025-03-06 11:30     ` Christian Ebner
2025-03-06 12:02       ` Fabian Grünbichler [this message]
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 4/8] ui: expose GC atime safety check flag in datastore tuning options Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 5/8] docs: mention GC atime update check for " Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 6/8] datastore: conditionally use custom GC atime cutoff if set Christian Ebner
2025-03-06 11:00   ` Fabian Grünbichler
2025-03-06 11:19     ` Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 7/8] ui: expose GC atime cutoff in datastore tuning option Christian Ebner
2025-03-05 15:14 ` [pbs-devel] [PATCH v4 proxmox-backup 8/8] docs: mention gc-atime-cutoff as " Christian Ebner
2025-03-05 15:23 ` [pbs-devel] [PATCH v4 proxmox-backup 0/8] fix #5982: check atime update is honored Christian Ebner
2025-03-06 14:54 ` Christian Ebner

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=1741261669.opzzyxdxb2.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=c.ebner@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