X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 7828711F8D34 for ; Wed, 12 Apr 2006 00:09:43 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -1.3 X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5 tests=[AWL=1.300, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id SzFO3W9q-O6Y for ; Wed, 12 Apr 2006 00:09:36 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 219BC11F8BB2 for ; Wed, 12 Apr 2006 00:02:09 -0300 (ADT) Received: from mail.cs.mcgill.ca (mail.CS.McGill.CA [132.206.51.234]) by svr4.postgresql.org (Postfix) with ESMTP id 954685AFD54 for ; Wed, 12 Apr 2006 01:07:14 +0000 (GMT) Received: from mail.cs.mcgill.ca (localhost [127.0.0.1]) by mail.cs.mcgill.ca (Postfix) with ESMTP id 575DB2F93C for ; Tue, 11 Apr 2006 21:07:13 -0400 (EDT) Received: from 65.92.138.65 (SquirrelMail authenticated user ylin30) by mail.cs.mcgill.ca with HTTP; Tue, 11 Apr 2006 21:07:13 -0400 (EDT) Message-ID: <61065.65.92.138.65.1144804033.squirrel@mail.cs.mcgill.ca> Date: Tue, 11 Apr 2006 21:07:13 -0400 (EDT) Subject: Re: FastPath blocked when ERROR is thrown From: "Yi Lin" To: pgsql-jdbc@postgresql.org User-Agent: SquirrelMail/1.5.1 [CVS] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200604/88 X-Sequence-Number: 15022 HI Kris Jurka: >> I used java API FastPath.fastpath(fid, ...) to call a C function >> PGfn(conn, fid,...) in the kernal. But if there is an exception (i.e., >> ERROR messages is thrown in the backend due to elog(ERROR, ...)), the >> FastPath.fastpath(fid, ..) is blocked and never returns. >> > > The attached code runs fine with the cvs jdbc driver and a 8.0.7 server. > You haven't mentioned your versions, but this code hasn't changed recently > so anything relatively new should be fine. > I am using a modified version of Postgresql 7.2. It was modified by adding Writeset functionality needed by replication such as Postgres-R. The function Fastpath.fastpath(2075, ..) -> PQfn(conn, 2075, ..) in the attached codes will trigger a non-standard function putWriteset() implemented by one previous student in my lab. So I don't think you tested the attached codes against the PQfn(..) which I am worried about. It seems to me that the exception caused by elog(ERROR, ..) is not thrown upto Fastpath.fastpath(2075, ..). But I know so little about the kernal of postgresql that I can't trace the bug. Could u please give me some hints (e.g., the functions or files to examinate)? I am going to check if the C version PQfn(..) will be blocked by ERROR or not. > How do you know the function is erroring out? What does the server log > say? I intentionally inserted a tuple twice in two separated txns hence the second insertion txn would cause an ERROR message. And then the function fastpath(..) gets blocked forever. The error message is sth like: ERROR: can't insert the same key to index t_a_pk_index twice. Tuple exists already. To abort the transaction (No Error). Sorry I don't know how to read server logs at all. thanks a lot! Yi > > Kris Jurka ======================================= Yi Lin Ph.D. candidate School of Computer Science McGill University Montreal, Quebec,Canada URL: http://www.cs.mcgill.ca/~ylin30/ \\\ $ /// @ @ ======o0o==0==o0o======================