You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: slony/faq.xml
+94
Original file line number
Diff line number
Diff line change
@@ -421,6 +421,28 @@ server: Error 0</screen>
421
421
</para>
422
422
</answer>
423
423
</qandaentry>
424
+
425
+
<qandaentry>
426
+
427
+
<question> <para> I found conflicting types for <envar>yyleng</envar>
428
+
between <filename>parser.c</filename> and <filename>scan.c</filename>.
429
+
In one case, it used type <type>int</type>, conflicting with
430
+
<type>yy_size_t</type>. What shall I do?</para> </question>
431
+
432
+
<answer><para> This has been observed on <application>MacOS</application>,
433
+
where <application>flex</application> (which generates
434
+
<filename>scan.c</filename>) and <application>bison</application>
435
+
(which generates <filename>parser.c</filename>) diverged in their
436
+
handling of this variable. </para>
437
+
<itemizedlist>
438
+
<listitem><para> You might might <quote>hack</quote> <filename>scan.c</filename> by hand to use the matching type. </para> </listitem>
439
+
<listitem><para> You might select different versions of <application>bison</application> or <application>flex</application> so as to get versions whose data types match. </para> </listitem>
440
+
<listitem><para> Note that you may have multiple versions of <application>bison</application> or <application>flex</application> around, and might need to modify <envar>PATH</envar> in order to select the appropriate one.</para></listitem>
441
+
</answer>
442
+
443
+
444
+
445
+
</qandaentry>
424
446
</qandadiv>
425
447
426
448
<qandadivid="faqhowto"> <title> &slony1; FAQ: How Do I? </title>
@@ -1933,6 +1955,78 @@ CONTEXT: PL/pgSQL function "setaddtable_int" line 71 at SQL statement</screen>
1933
1955
</para>
1934
1956
</answer>
1935
1957
</qandaentry>
1958
+
1959
+
<qandaentry>
1960
+
1961
+
<question> <para>As of version 8.3, &postgres; offers a
1962
+
<envar>synchronous_commit</envar> parameter which may be set either
1963
+
via GUC or <filename>postgresql.conf</filename> which can provide some
1964
+
performance gains by not logging results in WAL. Would it be sensible
1965
+
to turn off synchronous commit on a subscriber node? </para>
1966
+
</question>
1967
+
1968
+
<answer><para> Unfortunately, there is an unpleasant failure case
1969
+
which this would introduce. </para>
1970
+
1971
+
<para>Consider...</para>
1972
+
1973
+
<itemizedlist>
1974
+
1975
+
<listitem><para> Node #2 claims to have committed up to transaction
1976
+
T5, but the WAL only really has records up to T3.</para></listitem>
1977
+
1978
+
<listitem><para> Node #1, the "master", got the report back that #2 is
1979
+
up to date to T5.</para></listitem>
1980
+
1981
+
<listitem><para> Node #2 experiences a failure (e.g. - power
1982
+
outage).</para></listitem>
1983
+
1984
+
</itemizedlist>
1985
+
1986
+
<para>There are two possible outcomes, now, one OK, and one not so OK...</para>
1987
+
1988
+
<itemizedlist>
1989
+
1990
+
<listitem><para> OK </para>
1991
+
1992
+
<para> Node #2 gets restarted, replays WAL, knows it's only got data
1993
+
up to T3, and heads back to node #1, asking for transaction T4 and
1994
+
others.</para>
1995
+
1996
+
<para> No problem.</para></listitem>
1997
+
1998
+
<listitem><para> Not so OK.</para>
1999
+
2000
+
<para> Before node #2 gets back up, node #1 has run an iteration of
2001
+
the cleanup thread, which trims out all the data up to T5, because the
2002
+
other nodes confirmed up to that point.</para>
2003
+
2004
+
<para> Node #2 gets restarted, replays WAL, knows it's only got data
2005
+
up to T3, and heads back to node #1, asking for transaction T4 and
2006
+
T5.</para>
2007
+
2008
+
<para> Oops. Node #1 just trimmed those log entries
2009
+
out.</para></listitem>
2010
+
</itemizedlist>
2011
+
2012
+
<para>The race condition here is quite easy to exercise - you just
2013
+
need to suppress the restart of node 2 for a while, long enough for
2014
+
node 1 to run the cleanup thread.</para>
2015
+
2016
+
<para>You might evade the problem somewhat by setting the &lslon; parameter
2017
+
<xreflinkend="slon-config-cleanup-interval"/> to a larger value.</para>
2018
+
2019
+
<para>Unfortunately, any time the outage of node 2 could exceed that
2020
+
interval, the risk of losing log data inexorably emerges.</para>
2021
+
2022
+
</answer>
2023
+
2024
+
<answer><para> As a result, it cannot be recommended that users run
2025
+
&slony1; in a fashion where it suppresses WAL writing via
0 commit comments