Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH 00 of 10] logd improvements v2

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


bs_lists at aakef

Nov 12, 2010, 8:04 AM

Post #1 of 11 (1178 views)
Permalink
[PATCH 00 of 10] logd improvements v2

[.Sorry for sending it twice, but first time I used a sender address,
which is not subscribed to the mailing list.]

Hi all,

the following patches are to better handle bug 2470 and have some generic
improvements.


Changes to v1 sent in September:
Split the first patch into 3 parts

Sorry that that took so long, but I didn't find a minute before


Thanks,
Bernd


_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


bernd.schubert at fastmail

Nov 10, 2010, 12:23 PM

Post #2 of 11 (803 views)
Permalink
[PATCH 00 of 10] logd improvements v2 [In reply to]

Hi all,

the following patches are to better handle bug 2470 and have some generic
improvements. I'm not sure if I shall attach it to the bugzilla or if the
mailing list is preferred.

Changes to v1 sent in September:
Split the first patch into 3 parts

Sorry that that took so long, but I didn't find a minute before


Thanks,
Bernd

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lars.ellenberg at linbit

Nov 17, 2010, 12:39 AM

Post #3 of 11 (1137 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Fri, Nov 12, 2010 at 05:04:35PM +0100, bs_lists [at] aakef wrote:
> [.Sorry for sending it twice, but first time I used a sender address,
> which is not subscribed to the mailing list.]
>
> Hi all,
>
> the following patches are to better handle bug 2470 and have some generic
> improvements.
>
>
> Changes to v1 sent in September:
> Split the first patch into 3 parts
>
> Sorry that that took so long, but I didn't find a minute before

[PATCH 01 of 10] cl_log: Make functions static
[PATCH 02 of 10] cl_logd: Remove childlog_dump_ipcmsg_stats
[PATCH 03 of 10] cl_log: Remove CircularBuffer
[PATCH 09 of 10] cl_log: Fix white space

Applied without changes.
oh, I should have fixed the cl_logd to ha_logd in the commit message.
too late ;-)

[PATCH 05 of 10] ha_logd: Use C99 initializers, also correct max entity string length

Applied with minimal changes.

================================
[PATCH 10 of 10] ha_logd: Add a SIGHUP signal handler to close/open log files
[PATCH 08 of 10] cl_log: Restore old logfile open/seek/write/close behaviour

Conceptually changed.
Proposed patches attached.
Note: not even compile tested :(

Please try/comment.
================================

[PATCH 07 of 10] ha_logd: New option to disable syslog logging

Dropped.
facility none is already available for that.

[PATCH 04 of 10] cl_log: Simplify a function

Dropped for now, may be revised with the "common log entity",
if we actually get to it.

[PATCH 06 of 10] cl_log: Always print the common log entity to syslog messages

Postponed. I may propose a patch later today/tomorrow.

The desired functionality should in most cases be achieved by
using the log facility. There are LOCAL0 to LOCAL7 reserved
facilities, I dare say that in most deployments one of them can
be used exclusively for cluster logging.

--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
Attachments: reopenlogfiles.diff (5.96 KB)
  logd-buffered-io-fflush-fsync.diff (4.82 KB)


lars.ellenberg at linbit

Nov 17, 2010, 1:10 AM

Post #4 of 11 (1132 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Wed, Nov 17, 2010 at 09:39:17AM +0100, Lars Ellenberg wrote:
> On Fri, Nov 12, 2010 at 05:04:35PM +0100, bs_lists [at] aakef wrote:
> ================================
> [PATCH 10 of 10] ha_logd: Add a SIGHUP signal handler to close/open log files
> [PATCH 08 of 10] cl_log: Restore old logfile open/seek/write/close behaviour
>
> Conceptually changed.
> Proposed patches attached.

There was one missing,
attached now.

> Note: not even compile tested :(
>

Please try/comment.



--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
Attachments: sighup.diff (1.49 KB)


bernd.schubert at fastmail

Nov 17, 2010, 9:42 AM

Post #5 of 11 (1127 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

Hello Lars,

thanks for your very helpful approach! So we won't go into an endless
discussion without a result :)

On Wednesday, November 17, 2010, Lars Ellenberg wrote:

> [PATCH 05 of 10] ha_logd: Use C99 initializers, also correct max entity
> string length
>
> Applied with minimal changes.

Thanks for applying this and the others. Although, I will will be blamed now
that bisecting cluster-glue fails and it is not really my fault ;)
Please see the attached patch. I run into the same trap myself at least a
hundred times, though.

> [PATCH 10 of 10] ha_logd: Add a SIGHUP signal handler to close/open log
> files [PATCH 08 of 10] cl_log: Restore old logfile open/seek/write/close
> behaviour
>
> Conceptually changed.
> Proposed patches attached.
> Note: not even compile tested :(
>
> Please try/comment.

I'm just making this work, but could you please tell me, what
"re_open_logfiles" is supposed to be for?

+ if (re_open_logfiles) {
+ close_log_files();
+ re_open_logfiles = 0;
+ } else if (now - last_stat_time < 61) {

re_open_logfiles was not defined, but obviously it has type 'int'. But what is
the purpose of that?


+static void maybe_close_log_file(const char *fname, struct log_file_context
*lfc)
+{
+ struct stat buf;
+ if (!lcf->fp)
+ return;
+ if (stat(fname, &log_sb) || log_sb.st_ino != lfc->stat_buf.st_ino)
+ close_log_file(lfc);
+}


That should work :) Unless logrotate does something very bad (compress it,
without renaming it, then delete it) *and* another process races and creates
the file *and* the inode is recycled.


Attached files:
log_warning.patch: Fix commit 2474:4a748dfb780e
reopenlogfiles.diff: Compilation fixed, not further tested. FIXME needs to be
done at least first.
sighup.diff: Compilation fixed, not further tested


Cheers,
Bernd
Attachments: log_warning.patch (0.49 KB)
  reopenlogfiles.diff (6.71 KB)
  sighup.diff (1.49 KB)


lars.ellenberg at linbit

Nov 17, 2010, 2:11 PM

Post #6 of 11 (1130 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Wed, Nov 17, 2010 at 06:42:14PM +0100, Bernd Schubert wrote:
> Hello Lars,
>
> thanks for your very helpful approach! So we won't go into an endless
> discussion without a result :)
>
> On Wednesday, November 17, 2010, Lars Ellenberg wrote:
>
> > [PATCH 05 of 10] ha_logd: Use C99 initializers, also correct max entity
> > string length
> >
> > Applied with minimal changes.
>
> Thanks for applying this and the others. Although, I will will be blamed now
> that bisecting cluster-glue fails and it is not really my fault ;)
> Please see the attached patch. I run into the same trap myself at least a
> hundred times, though.

Bah. Thanks.
Maybe I can rebase ... ah well, never mind, it's public already -_-

> > [PATCH 10 of 10] ha_logd: Add a SIGHUP signal handler to close/open log
> > files [PATCH 08 of 10] cl_log: Restore old logfile open/seek/write/close
> > behaviour
> >
> > Conceptually changed.
> > Proposed patches attached.
> > Note: not even compile tested :(
> >
> > Please try/comment.
>
> I'm just making this work, but could you please tell me, what
> "re_open_logfiles" is supposed to be for?

At the time I thought that I'd set this as a flag from the sighup
handler and other places, but then later changed all those places to
just do close_log_files() directly.
Should go. Hey, 'twas late ...

> + if (re_open_logfiles) {
> + close_log_files();
> + re_open_logfiles = 0;
> + } else if (now - last_stat_time < 61) {
>
> re_open_logfiles was not defined, but obviously it has type 'int'. But what is
> the purpose of that?
>
>
> +static void maybe_close_log_file(const char *fname, struct log_file_context
> *lfc)
> +{
> + struct stat buf;
> + if (!lcf->fp)
> + return;
> + if (stat(fname, &log_sb) || log_sb.st_ino != lfc->stat_buf.st_ino)
> + close_log_file(lfc);
> +}
>
>
> That should work :) Unless logrotate does something very bad (compress it,
> without renaming it, then delete it) *and* another process races and creates
> the file *and* the inode is recycled.

The inode cannot be recycled while we still have it open,
no matter if it was deleted.
But yes, that should work.
Though, I'm not sure, there are "things" with unstable inodes ;-)
...

This, btw, would be the place to implement auto-rotation of log files
based on size or time or both.

> Attached files:
> log_warning.patch: Fix commit 2474:4a748dfb780e
> reopenlogfiles.diff: Compilation fixed, not further tested. FIXME needs to be
> done at least first.
> sighup.diff: Compilation fixed, not further tested

Thanks,
will work on that tomorrow.

--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lars.ellenberg at linbit

Nov 18, 2010, 7:43 AM

Post #7 of 11 (1119 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Wed, Nov 17, 2010 at 11:11:08PM +0100, Lars Ellenberg wrote:
> Thanks,
> will work on that tomorrow.

Done, and pushed.
Please complain if something does not work as expected.

Thanks for bringing it up, and not giving up on it ;-)


--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


bernd.schubert at fastmail

Nov 24, 2010, 5:49 AM

Post #8 of 11 (1105 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

Hello Lars,

On Thursday, November 18, 2010, Lars Ellenberg wrote:
> On Wed, Nov 17, 2010 at 11:11:08PM +0100, Lars Ellenberg wrote:
> > Thanks,
> >
> > will work on that tomorrow.
>
> Done, and pushed.
> Please complain if something does not work as expected.
>
> Thanks for bringing it up, and not giving up on it ;-)


thanks a bunch! And sorry for my late reply, I didn't manage to answer during
the past days. What about this last patch?

# HG changeset patch
# Parent 8658bcdd451122d396239226e85ac502b6c017e8

diff --git a/logd/logd.cf b/logd/logd.cf
--- a/logd/logd.cf
+++ b/logd/logd.cf
@@ -18,6 +18,7 @@
#
#
# Facility to use for syslog()/logger
+# 'none' will disable syslog logging.
# Default: daemon
#logfacility daemon



Thanks again for your great help,
Bernd
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Nov 24, 2010, 7:25 AM

Post #9 of 11 (1109 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

Hi,

On Wed, Nov 24, 2010 at 02:49:30PM +0100, Bernd Schubert wrote:
> Hello Lars,
>
> On Thursday, November 18, 2010, Lars Ellenberg wrote:
> > On Wed, Nov 17, 2010 at 11:11:08PM +0100, Lars Ellenberg wrote:
> > > Thanks,
> > >
> > > will work on that tomorrow.
> >
> > Done, and pushed.
> > Please complain if something does not work as expected.
> >
> > Thanks for bringing it up, and not giving up on it ;-)
>
>
> thanks a bunch! And sorry for my late reply, I didn't manage to answer during
> the past days. What about this last patch?

Didn't apply, but I think I got the general intention ;-)
Applied.

Thanks,

Dejan

> # HG changeset patch
> # Parent 8658bcdd451122d396239226e85ac502b6c017e8
>
> diff --git a/logd/logd.cf b/logd/logd.cf
> --- a/logd/logd.cf
> +++ b/logd/logd.cf
> @@ -18,6 +18,7 @@
> #
> #
> # Facility to use for syslog()/logger
> +# 'none' will disable syslog logging.
> # Default: daemon
> #logfacility daemon
>
>
>
> Thanks again for your great help,
> Bernd
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


bernd.schubert at fastmail

Nov 24, 2010, 5:07 PM

Post #10 of 11 (1103 views)
Permalink
Re: status update: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Wednesday, November 24, 2010, Dejan Muhamedagic wrote:
> Hi,
>
> On Wed, Nov 24, 2010 at 02:49:30PM +0100, Bernd Schubert wrote:
> > Hello Lars,
> >
> > On Thursday, November 18, 2010, Lars Ellenberg wrote:
> > > On Wed, Nov 17, 2010 at 11:11:08PM +0100, Lars Ellenberg wrote:
> > > > Thanks,
> > > >
> > > > will work on that tomorrow.
> > >
> > > Done, and pushed.
> > > Please complain if something does not work as expected.
> > >
> > > Thanks for bringing it up, and not giving up on it ;-)
> >
> > thanks a bunch! And sorry for my late reply, I didn't manage to answer
> > during the past days. What about this last patch?
>
> Didn't apply, but I think I got the general intention ;-)
> Applied.

Hmm, probably whitespace. Thanks!


Cheers,
Bernd
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


lars.ellenberg at linbit

Aug 24, 2011, 6:43 AM

Post #11 of 11 (802 views)
Permalink
Re: [PATCH 00 of 10] logd improvements v2 [In reply to]

On Wed, Nov 10, 2010 at 08:23:42PM +0100, Bernd Schubert wrote:

... But: X-Mailman-Approved-At: Wed, 24 Aug 2011 05:32:24 -0600

So, ignore this. Has been dealt with 9 month ago...

--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.