{"id":2533,"date":"2011-02-10T09:21:33","date_gmt":"2011-02-10T17:21:33","guid":{"rendered":"http:\/\/www.chesnok.com\/daily\/?p=2533"},"modified":"2012-03-26T02:51:53","modified_gmt":"2012-03-26T10:51:53","slug":"hot-standby-features-for-9-1-just-committed-pause-and-resume","status":"publish","type":"post","link":"https:\/\/www.chesnok.com\/daily\/2011\/02\/10\/hot-standby-features-for-9-1-just-committed-pause-and-resume\/","title":{"rendered":"Hot Standby features for 9.1, just committed: Pause and Resume"},"content":{"rendered":"<p>On February 8th, <a href=\"http:\/\/git.postgresql.org\/gitweb?p=postgresql.git;a=commitdiff;h=8c6e3adbf792c2bba448e88cbf2c8e03fb802e73\">Simon Riggs committed a couple new functions<\/a> that will allow Hot Standby to be paused and resumed. You can already *read* from the Hot Standby without pausing, but you could never pause the application of changes in the past. You might want to do this if you have a very high-write-volume server, and some very expensive queries that you want to run on a slave.<\/p>\n<blockquote><p>\nBasic Recovery Control functions for use in Hot Standby. Pause, Resume,<br \/>\nStatus check functions only. Also, new recovery.conf parameter to<br \/>\npause_at_recovery_target, default on.\n<\/p><\/blockquote>\n<p>The basic idea is that if you have a read-only standby system, you can give it the command: <code>pg_xlog_replay_pause()<\/code> and the standby will stop applying changes. Then you can use the database in read-only mode without new changes being applied. When you&#8217;re done you can issue the command: <code>pg_xlog_replay_resume()<\/code> and proceed with applying logs.<\/p>\n<p>There are some related features that I can&#8217;t wait to test out around <a href=\"http:\/\/git.postgresql.org\/gitweb?p=postgresql.git;a=commitdiff;h=c016ce728139be95bb0dc7c4e5640507334c2339\">named restore points for replay<\/a>. But the ability to pause replay and run queries is just awesome. <\/p>\n<p>This is a feature that Simon talked about <a href=\"http:\/\/www.chesnok.com\/daily\/2009\/02\/07\/simon-riggs-just-rocked-my-world\/\">back in 2009 at FOSDEM<\/a>, and I am very excited to see it implemented.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On February 8th, Simon Riggs committed a couple new functions that will allow Hot Standby to be paused and resumed. You can already *read* from the Hot Standby without pausing, but you could never pause the application of changes in &hellip; <a href=\"https:\/\/www.chesnok.com\/daily\/2011\/02\/10\/hot-standby-features-for-9-1-just-committed-pause-and-resume\/\">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":[313,412,360,182,647,624,413],"class_list":["post-2533","post","type-post","status-publish","format-standard","hentry","category-postgres","category-postgresql","tag-9-1","tag-commits","tag-features","tag-hot-standby","tag-postgres","tag-postgresql","tag-simon-riggs"],"_links":{"self":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/2533","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=2533"}],"version-history":[{"count":9,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/2533\/revisions"}],"predecessor-version":[{"id":2541,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/posts\/2533\/revisions\/2541"}],"wp:attachment":[{"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/media?parent=2533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/categories?post=2533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chesnok.com\/daily\/wp-json\/wp\/v2\/tags?post=2533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}