Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 2F0249FB5C8; Fri, 20 Apr 2007 06:21:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 59386-10; Fri, 20 Apr 2007 06:21:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from serv1.oss.ntt.co.jp (ns.oss.ntt.co.jp [222.151.198.98]) by postgresql.org (Postfix) with ESMTP id 8F2AD9FB27D; Fri, 20 Apr 2007 06:21:23 -0300 (ADT) Received: from [172.17.1.90] (unknown [172.17.1.90]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id 048A1104002; Fri, 20 Apr 2007 18:21:22 +0900 (JST) Message-ID: <462885AC.6080407@oss.ntt.co.jp> Date: Fri, 20 Apr 2007 18:19:40 +0900 From: Koichi Suzuki User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Tom Lane CC: Simon Riggs , Zeugswetter Andreas ADI SD , Hannu Krosing , "Joshua D. Drake" , josh@agliodbs.com, pgsql-hackers@postgresql.org, pgsql-patches@postgresql.org Subject: Re: [HACKERS] Full page writes improvement, code update References: <460886E8.6040907@oss.ntt.co.jp> <4609CAC3.7060008@oss.ntt.co.jp> <1175072848.4386.323.camel@silverbirch.site> <200703291145.28574.josh@agliodbs.com> <1175200117.4386.616.camel@silverbirch.site> <460C611E.6090800@oss.ntt.co.jp> <27693.1176226131@sss.pgh.pa.us> <461C3557.6040201@oss.ntt.co.jp> <461C3732.20006@commandprompt.com> <1176269612.3962.11.camel@localhost.localdomain> <461D9090.60808@oss.ntt.co.jp> <461ECA4E.9010101@oss.ntt.co.jp> <19002.1176475004@sss.pgh.pa.us> <1176478259.3635.176.camel@silverbirch.site> <19755.1176479261@sss.pgh.pa.us> <1176480368.3635.199.camel@silverbirch.site> <20249.1176483033@sss.pgh.pa.us> In-Reply-To: <20249.1176483033@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/442 X-Sequence-Number: 2009 Here's only a part of the reply I should do, but as to I/O error checking ... Here's a list of system calls and other external function/library calls used in pg_lesslog patch series, together with how current patch checks each errors and how current postgresql source handles the similar calls: -------------------------------- 1. No error check is done 1-1. fileno() fileno() is called against stdin and stdout from pg_compresslog.c and pg_decompresslog.c. They are intended to be invoked from a shell and so stdin and stdout are both available. fileno() error occurs only if invoker of pg_compresslog or pg_decompresslog closes stdin and/or stdout before the invoker executes them. I found similar fileno() usage in pg_dump/pg_backup_archive.c and postmaster/syslogger.c. I don't think this is an issue. 1-2. fflush() fflush() is called against stdout within a debug routine, debug.c. Such usage can also be found in bin/initdb.c, bin/scripts/createdb.c, bin/psql/common.c and more. I don't think this is an issue either. 1-3. printf() and fprintf() It is common practice not to check the error. We can find such calls in many of existing source codes. 1-4. strerror() It is checked that system call returns error before calling strerror. Similar code can be found in other PostgreSQL source too. ---------------------------------- 2. Error check is done All the following function calls are associated with return value check. open(), close(), fstat(), read(), write() ----------------------------------- 3. Functions do not return error The following functin will not return errors, so no error check is needed. exit(), memcopy(), memset(), strcmp() ------------------------------------ I hope this helps. Regards; Tom Lane wrote: > "Simon Riggs" writes: >> Writing lots of additional code simply to remove a parameter that >> *might* be mis-interpreted doesn't sound useful to me, especially when >> bugs may leak in that way. My take is that this is simple and useful >> *and* we have it now; other ways don't yet exist, nor will they in time >> for 8.3. > > The potential for misusing the switch is only one small part of the > argument; the larger part is that this has been done in the wrong way > and will cost performance unnecessarily. The fact that it's ready > now is not something that I think should drive our choices. > > I believe that it would be possible to make the needed core-server > changes in time for 8.3, and then to work on compress/decompress > on its own time scale and publish it on pgfoundry; with the hope > that it would be merged to contrib or core in 8.4. Frankly the > compress/decompress code needs work anyway before it could be > merged (eg, I noted a distinct lack of I/O error checking). > > regards, tom lane > -- ------------- Koichi Suzuki