Replication eRServer problems - Mailing list pgsql-hackers

From John Li
Subject Replication eRServer problems
Date
Msg-id EBECLIDIJCMMAPENHIFLAEEOCEAA.john.li@earthlink.net
Whole thread Raw
Responses Re: Replication eRServer problems  (Peter Eisentraut <peter_e@gmx.net>)
Re: Replication eRServer problems  (Devrim GUNDUZ <devrim@gunduz.org>)
Re: Replication eRServer problems  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-hackers
<div class="Section1"><p class="MsoNormal"><span class="EmailStyle15"><font color="black" face="Arial" size="2"><span
style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial">I just implemented eRServer for one of my clients and found many problems with it. </span></font></span><p
class="MsoNormal"><spanclass="EmailStyle15"><font color="black" face="Arial" size="2"><span
style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial"> </span></font></span><ol start="1" style="mso-margin-top-alt:0in" type="1"><li class="MsoNormal"
style="color:black;mso-list:l0level1 lfo1;tab-stops:list .5in"><span class="EmailStyle15"><font color="black"
face="Arial"size="2"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial">It crashes when using
“ers_addtable”to add big tables. The problem is that it used pg_dump –d then tried to read the whole output in memory.
Ifixed it by reading one row at a time and inserting it to slave.</span></font></span><li class="MsoNormal"
style="color:black;mso-list:l0level1 lfo1;tab-stops:list .5in"><span class="EmailStyle15"><font color="black"
face="Arial"size="2"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial">“ers_addslave” crashes
whencreating table schema if one rows on the master were dropped. Apparently, when a row was dropped, the “attname” in
“pg_attribute”table was changed to “………pg.dropped.#…………..” and the type of the column became “-“. That made the “create
table”sql statement for slave wrong. I fixed this problem by excluding those kind of columns.</span></font></span><li
class="MsoNormal"style="color:black;mso-list:l0 level1 lfo1;tab-stops:list .5in"><span class="EmailStyle15"><font
color="black"face="Arial" size="2"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial">There was
noindex created on “_ers_uniq” on slave side. It took minutes per transaction to delete on huge tables. After I found
theproblem and created index on the column, it only took about 5 milliseconds to delete.</span></font></span><li
class="MsoNormal"style="color:black;mso-list:l0 level1 lfo1;tab-stops:list .5in"><span class="EmailStyle15"><font
color="black"face="Arial" size="2"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial">To handle
columnswith default and nextval, eRServer expected to see </span></font></span>nextval('"sequence_name"'::text) and
useddouble quote to extract sequence names. But postgres also allow nextval('sequence_name'::text) without double
quotes.The fix was easy.<font face="Arial" size="2"><span
style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial"></span></font><liclass="MsoNormal"
style="color:black;mso-list:l0level1 lfo1;tab-stops:list .5in"><font color="black" face="Times New Roman"
size="3"><spanstyle="font-size:12.0pt">eRServer.pm failed because DBI could not handle columns with types such as
“text[]”but Pg module should work.</span></font><font face="Arial" size="2"><span
style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial"></span></font></ol><pclass="MsoNormal"><font
color="black"face="Times New Roman" size="3"><span style="font-size:12.0pt;color:black"> </span></font><font
color="black"><spanstyle="color:black;mso-color-alt:windowtext"></span></font><p class="MsoNormal"><font color="black"
face="TimesNew Roman" size="3"><span style="font-size:12.0pt;color:black"> </span></font><font color="black"><span
style="color:black;mso-color-alt:windowtext"></span></font><pclass="MsoNormal"><font color="black" face="Times New
Roman"size="3"><span style="font-size:12.0pt;color:black">Hope those will be fixed in the next version. I can also
providemy fixes if needed.</span></font><span class="EmailStyle15"><font color="black" face="Arial" size="2"><span
style="font-size:
10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial"></span></font></span><p class="MsoNormal"><span
class="EmailStyle15"><fontcolor="black" face="Arial" size="2"><span
style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial"> </span></font></span><p class="MsoNormal"><font color="black"><span style="color:black"><i><span
style="font-style:italic">JohnLi</span></i></span></font><i><font color="black"><span style="color:black; 
mso-color-alt:windowtext;font-style:italic"></span></font></i><p class="MsoNormal"><font color="black"><span
style="color:black"> </span></font><fontcolor="black"><span
style="color:black;mso-color-alt:windowtext"></span></font></div>

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] dollar quoting
Next
From: Rod Taylor
Date:
Subject: Re: Slow DROP INDEX