--_000_48DA836F3865C54B8FBF424A3B775AF6DE908683ExchangeServe rs_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I encountered a problem using pgpool with two identical postgres 8.4 server=
s as backends.
Activating the odbc-setting declare/fetch, our application creates an data =
mismatch error.
As far as I can track down the problem, it is caused because the cursors ar=
e defined after an BEGIN, thus with load balancing disabled, but are CLOSED=
after the COMMIT, thus are only closed on one server. This leads to data i=
nconsistency for the next query DECLARING an cursor.
Pgpool log excerpt:
2009-11-19 09:50:00 LOG: pid 16244: statement: BEGIN;declare "SQL_CUR031D=
30F0" cursor with hold for SELECT * FROM table WHERE resultid =3D 1252644 f=
or read only;;fetch 100 in "SQL_CUR031D30F0"
2009-11-19 09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for =
backend 0 completing the query
2009-11-19 09:50:00 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:00 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:00 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:00 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for =
backend 1 completing the query
2009-11-19 09:50:00 DEBUG: pid 16244: read_kind_from_backend: read kind fro=
m 0 th backend C NUM_BACKENDS: 2
2009-11-19 09:50:00 DEBUG: pid 16244: read_kind_from_backend: read kind fro=
m 1 th backend C NUM_BACKENDS: 2
....
2009-11-19 09:50:00 LOG: pid 16244: statement: COMMIT
2009-11-19 09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for =
backend 1 completing the query
2009-11-19 09:50:01 DEBUG: pid 16244: wait_for_query_response: waiting for =
backend 0 completing the query
2009-11-19 09:50:01 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:01 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:01 DEBUG: pid 16244: read_kind_from_backend: read kind fro=
m 0 th backend C NUM_BACKENDS: 2
2009-11-19 09:50:01 DEBUG: pid 16244: read_kind_from_backend: read kind fro=
m 1 th backend C NUM_BACKENDS: 2
....
2009-11-19 09:50:02 LOG: pid 16244: statement: close "SQL_CUR031D30F0"
2009-11-19 09:50:02 DEBUG: pid 16244: wait_for_query_response: waiting for =
backend 0 completing the query
2009-11-19 09:50:02 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:02 DEBUG: pid 16244: detect_error: kind: C
2009-11-19 09:50:02 DEBUG: pid 16244: read_kind_from_backend: read kind fro=
m 0 th backend C NUM_BACKENDS: 1
2009-11-19 09:50:02 DEBUG: pid 16244: pool_process_query: kind from backend=
: C
Any idea other than diabling declare/fetch?
Best regards,
Andreas Gaab
____________________________________________________________ _______________
SCANLAB AG
Dr. Andreas Simon Gaab
Entwicklung * R & D
Siemensstr. 2a * 82178 Puchheim * Germany
Tel. +49 (89) 800 746-513 * Fax +49 (89) 800 746-199
mailto:a.gaab [at] scanlab.de * www.scanlab.de<http://www.scanlab.de>
Amtsgericht München: HRB 124707 * USt-IdNr.: DE 129 456 351
Vorstand: Georg Hofner (Sprecher), Christian Huttenloher, Norbert Petschik
Aufsichtsrat (Vorsitz): Dr. Hans J. Langer
____________________________________________________________ _______________
--_000_48DA836F3865C54B8FBF424A3B775AF6DE908683ExchangeServe rs_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"=
>
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Arial","sans-serif";}
h1
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:18.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:16.0pt;
font-family:"Arial","sans-serif";}
h2
{margin-top:6.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:12.0pt;
font-family:"Arial","sans-serif";
text-decoration:underline;}
h3
{margin-top:3.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:12.0pt;
font-family:"Arial","sans-serif";
font-weight:normal;
text-decoration:underline;}
h4
{margin-top:0cm;
margin-right:0cm;
margin-bottom:12.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:12.0pt;
font-family:"Arial","sans-serif";
font-weight:normal;
text-decoration:underline;}
p.MsoToc1, li.MsoToc1, div.MsoToc1
{margin-top:6.0pt;
margin-right:1.0cm;
margin-bottom:0cm;
margin-left:14.2pt;
margin-bottom:.0001pt;
text-indent:-14.2pt;
font-size:12.0pt;
font-family:"Arial","sans-serif";
font-weight:bold;}
p.MsoToc2, li.MsoToc2, div.MsoToc2
{margin-top:3.0pt;
margin-right:1.0cm;
margin-bottom:0cm;
margin-left:28.4pt;
margin-bottom:.0001pt;
text-indent:-14.2pt;
font-size:12.0pt;
font-family:"Arial","sans-serif";}
p.MsoToc3, li.MsoToc3, div.MsoToc3
{margin-top:0cm;
margin-right:1.0cm;
margin-bottom:0cm;
margin-left:42.55pt;
margin-bottom:.0001pt;
text-indent:-14.2pt;
font-size:12.0pt;
font-family:"Arial","sans-serif";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage20
{mso-style-type:personal-compose;
font-family:"Times New Roman","serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
[at] page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3DDE link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>I
encountered a problem using pgpool with two identical postgres 8.4 servers =
as=A0
backends.<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>Activating
the odbc-setting declare/fetch, our application creates an data mismatch er=
ror.<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>As
far as I can track down the problem, it is caused because the cursors are
defined after an BEGIN, thus with load balancing disabled, but are CLOSED a=
fter
the COMMIT, thus are only closed on one server. This leads to data
inconsistency for the next query DECLARING an cursor.<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>Pgpool
log excerpt:<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 LOG:=A0=A0 pid 16244: statement: BEGIN;declare "SQL_CUR031D30=
F0"
cursor with hold for SELECT * FROM table WHERE resultid =3D 1252644 for rea=
d
only;;fetch 100 in "SQL_CUR031D30F0"<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for backend 0
completing the query<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for backend 1
completing the query<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: read_kind_from_backend: read kind from 0 th back=
end
C NUM_BACKENDS: 2<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: read_kind_from_backend: read kind from 1 th back=
end
C NUM_BACKENDS: 2<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>…<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 LOG:=A0=A0 pid 16244: statement: COMMIT<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:00 DEBUG: pid 16244: wait_for_query_response: waiting for backend 1
completing the query<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:01 DEBUG: pid 16244: wait_for_query_response: waiting for backend 0
completing the query<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:01 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:01 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:01 DEBUG: pid 16244: read_kind_from_backend: read kind from 0 th back=
end
C NUM_BACKENDS: 2<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:01 DEBUG: pid 16244: read_kind_from_backend: read kind from 1 th back=
end
C NUM_BACKENDS: 2<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>…<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 LOG:=A0=A0 pid 16244: statement: close "SQL_CUR031D30F0"=
<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 DEBUG: pid 16244: wait_for_query_response: waiting for backend 0
completing the query<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 DEBUG: pid 16244: detect_error: kind: C<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 DEBUG: pid 16244: read_kind_from_backend: read kind from 0 th back=
end
C NUM_BACKENDS: 1<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>2009-11-19
09:50:02 DEBUG: pid 16244: pool_process_query: kind from backend: C<o:p></o=
:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>Any
idea other than diabling declare/fetch?<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>Best
regards,<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'>Andreas
Gaab<o:p></o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt;font-fami=
ly:"Times New Roman","serif"'><o:p> </o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>_____________________=
______________________________________________________<o:p></o:p></span></p=
>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'><o:p> </o:p></sp=
an></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>SCANLAB AG<o:p><=
/o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Dr. Andreas =
;Simon Gaab<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Entwicklung •
R & D<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'><o:p> </o:p></sp=
an></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Siemensstr. 2a &=
#8226;
82178 Puchheim • Germany<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Tel. +49 (8=
9) 800 746-513
• Fax +49 (89) 800 746-199<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'><a
href=3D"mailto:a.gaab [at] scanlab.de">mailto:a.gaab [at] scanlab.de</a> • <a
href=3D"http://www.scanlab.de">www.scanlab.de</a><o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'><o:p> </o:p></sp=
an></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Amtsgericht Mü=
nchen:
HRB 124707 • USt-IdNr.: DE 129 456 351<o:p></o:p>=
</span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Vorstand:
Georg Hofner (Sprecher), Christian Huttenloher,
Norbert Petschik<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>Aufsichtsrat (Vo=
rsitz):
Dr. Hans J. Langer<o:p></o:p></span></p>
<p class=3DMsoNormal><span style=3D'font-size:10.0pt'>_____________________=
______________________________________________________</span><span
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" '><o:p></o:p></=
span></p>
<p class=3DMsoNormal><o:p> </o:p></p>
</div>
</body>
</html>
--_000_48DA836F3865C54B8FBF424A3B775AF6DE908683ExchangeServe rs_--
