On Fri, Nov 12, 2010 at 05:04:43PM +0100, bs_li...@aakef.fastmail.fm wrote: > # HG changeset patch > # User Bernd Schubert <bernd.schub...@fastmail.fm> > # Date 1289577717 -3600 > # Node ID 750c5a016d8135a7170d4a2fbe0de0f98478c572 > # Parent 0324966049c1e90b9d18c9c63041d2c73964d42f > cl_log: Restore old logfile open/seek/write/close behaviour. > > This patch actually does not completely revert commit 2435:ada347da564d, > but adds a layer to support both, open/write/close and and > open-once, write, close/open-for signal handlers > > It also changes a marco into a static function. And also uses > system IO (open/close/write) instead of libc IO (fopen/fclose/fwrite). > Libc IO has a buffer, which is not suitable for log files (in case of > a stonith, all the buffer and which might large, will be missing in > log files.
You are aware of this thread? http://www.mail-archive.com/linux-ha-dev@lists.linux-ha.org/msg05590.html Basically I suggest to fflush every time the inner message logging loop is done, and add an fsync for pri ERR and worse. we can make that warning and worse, or even make it configurable. It should perform better than the always unbuffered approach, while keeping similar guarantees about not losing (important) messages. Also, if you want to comment on the issues raised in http://www.mail-archive.com/linux-ha-dev@lists.linux-ha.org/msg05598.html about log rotation and files potentially being in use anyways, still? -- : 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@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/