From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Roevens To: development@lists.ipfire.org Subject: Re: [PATCH] collectd: Do not sync Date: Tue, 30 Jan 2024 20:50:02 +0100 Message-ID: In-Reply-To: <20240130180152.4161491-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4040198089852498052==" List-Id: --===============4040198089852498052== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi Michael, all First, this mail does not contain critique, I'm only trying to learn, if I'm wrong. But I think your remark about fixing hardware is not correct? In my understanding, sync synchronizes the not-yet-written data currently in kernel managed cache memory (hence in volatile system memory) to permanent storage.  Normally storage hardware also has its own cache, which I presume you are referring to, but I don't think sync cares or even knows about that and that is/should be handled within the hardware itself.  As soon as storage hardware returns an ACK on a write operation, sync is happy. Not actually guaranteeing any physical write, only that all to-be-written data is actually delivered to the storage hardware. I do agree that a (full) sync there is probably overkill. The content of the config will be available to the collectd daemon whether it is actually written on disk or still in cache, so no sync needed.  If the server crashes/powercycles/... on that point, I think a possible commented line that should be uncommented in that config is then probably of the least concern. On the other hand, a sync that blocks forever, is probably more of an indicator that the hardware should be fixed, as this would mean sync doesn't get all the ACK's it expects. Please correct me if I'm wrong. Regards Robin Michael Tremer schreef op di 30-01-2024 om 18:01 [+0000]: > Calling a global sync operation manually is generally a bad idea as > it > can block for forever. If people have storage that does not retain > anything that is being written to it, they need to fix their > hardware. > > Signed-off-by: Michael Tremer > --- >  src/initscripts/system/collectd | 3 --- >  1 file changed, 3 deletions(-) > > diff --git a/src/initscripts/system/collectd > b/src/initscripts/system/collectd > index bb8a2f54f..56b799d56 100644 > --- a/src/initscripts/system/collectd > +++ b/src/initscripts/system/collectd > @@ -146,9 +146,6 @@ case "$1" in >   sed -i -e "s|^#LoadPlugin swap|LoadPlugin > swap|g" /etc/collectd.conf >   fi >   > - # sync after config update... > - sync > - >   if [ $(date +%Y) -gt 2011 ]; then >   boot_mesg "Starting Collection daemon..." >   /usr/sbin/collectd -C /etc/collectd.conf > -- > 2.39.2 > > -- Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn. --===============4040198089852498052==--