{"id":3007,"date":"2011-05-21T11:00:44","date_gmt":"2011-05-21T19:00:44","guid":{"rendered":"http:\/\/www.chesnok.com\/daily\/?p=3007"},"modified":"2012-03-26T02:51:26","modified_gmt":"2012-03-26T10:51:26","slug":"pgcon-pub-track-learning-more-about-synchronous-replication","status":"publish","type":"post","link":"https:\/\/www.chesnok.com\/daily\/2011\/05\/21\/pgcon-pub-track-learning-more-about-synchronous-replication\/","title":{"rendered":"PgCon Pub Track: Learning more about Synchronous Replication"},"content":{"rendered":"<p><a href=\"http:\/\/www.chesnok.com\/daily\/wp-content\/uploads\/2011\/05\/5743376089_815a3b3c80_b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.chesnok.com\/daily\/wp-content\/uploads\/2011\/05\/5743376089_815a3b3c80_b-300x225.jpg\" alt=\"\" title=\"5743376089_815a3b3c80_b\" width=\"300\" height=\"225\" class=\"alignleft size-medium wp-image-3038\" srcset=\"https:\/\/www.chesnok.com\/daily\/wp-content\/uploads\/2011\/05\/5743376089_815a3b3c80_b-300x225.jpg 300w, https:\/\/www.chesnok.com\/daily\/wp-content\/uploads\/2011\/05\/5743376089_815a3b3c80_b.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So, we&#8217;re at the Pub and doing <a href=\"http:\/\/it.toolbox.com\/blogs\/database-soup\/one-billion-tables-or-bust-46270\">&#8220;create a billion tables&#8221; time trials<\/a> with Jan Urbanski using Python and Josh Berkus using Perl.<\/p>\n<p>We&#8217;re also hacking on a test framework the Slony developers have, specifically hacking with <a href=\"http:\/\/scanningpages.wordpress.com\/\">Steve Singer<\/a>. What we discovered is that sync rep doesn&#8217;t wait for a WAL segment to be *replayed* before it returns. In the pg_stat_replication table, we see sent_location, write_location and flush_location synchronized, but not replay_location.<\/p>\n<p>This makes sense from a database perspective, but may be surprising behavior for application developers. There are patches out there (according to what I just heard from Bernd) to make synchronous replication wait for replay on the slave, but it&#8217;s not certain when that will be committed. It definitely won&#8217;t be part of version 9.1.<\/p>\n<p>I just <a href=\"http:\/\/tech.myemma.com\/replication-synchronized\/\">wrote up configuration details from a database administrator&#8217;s perspective<\/a>, and am planning on doing some additional work to make a highly condensed configuration tutorial for our main docs.  We definitely need to explain this more clearly for users, who might be thinking of it more from an application perspective.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, we&#8217;re at the Pub and doing &#8220;create a billion tables&#8221; time trials with Jan Urbanski using Python and Josh Berkus using Perl. We&#8217;re also hacking on a test framework the Slony developers have, specifically hacking with Steve Singer. What &hellip; <a href=\"https:\/\/www.chesnok.com\/daily\/2011\/05\/21\/pgcon-pub-track-learning-more-about-synchronous-replication\/\">Continue reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97,9],"tags":[648,647,624,455],"class_list":["post-3007","post","type-post","status-publish","format-standard","hentry","category-postgres","category-postgresql","tag-pgcon","tag-postgres","tag-postgresql","tag-pubtrack"],"_links":{"self":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/3007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/comments?post=3007"}],"version-history":[{"count":9,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/3007\/revisions"}],"predecessor-version":[{"id":3926,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/3007\/revisions\/3926"}],"wp:attachment":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/media?parent=3007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/categories?post=3007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/tags?post=3007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}