{"push_id":982529707,"size":15,"distinct_size":15,"ref":"refs/heads/dev/failover-slots","head":"a6ef7d36e4810433af245d61c4d44cacd64f4f20","before":"5d7f6a56cc5b4f0c44944990888e8d17a63f6dd6","commits":[{"sha":"9449c4b1ec7114ae6927a563b43d1fbd4d5bbae4","author":{"email":"1db01d43e08596f43a65fb393d969b98ee5b4dc6@leadboat.com","name":"Noah Misch"},"message":"Replace broken link in comment.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/9449c4b1ec7114ae6927a563b43d1fbd4d5bbae4"},{"sha":"57c932475504d63d8f8a68fc6925d7decabc378a","author":{"email":"9f4ca770b638615ac5c3e0d2da16b77c80c2f2c6@hagander.net","name":"Magnus Hagander"},"message":"Fix typo","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/57c932475504d63d8f8a68fc6925d7decabc378a"},{"sha":"31b6606c48edf7c008ffe91907c080404a8c8046","author":{"email":"1f6acd02e97f7332f0e624e7be5170a1e771cb87@postgresql.org","name":"Fujii Masao"},"message":"Make concurrent refresh check early that there is a unique index on matview.\n\nIn REFRESH MATERIALIZED VIEW command, CONCURRENTLY option is only\nallowed if there is at least one unique index with no WHERE clause on\none or more columns of the matview. Previously, concurrent refresh\nchecked the existence of a unique index on the matview after filling\nthe data to new snapshot, i.e., after calling refresh_matview_datafill().\nSo, when there was no unique index, we could need to wait a long time\nbefore we detected that and got the error. It was a waste of time.\n\nTo eliminate such wasting time, this commit changes concurrent refresh\nso that it checks the existence of a unique index at the beginning of\nthe refresh operation, i.e., before starting any time-consuming jobs.\nIf CONCURRENTLY option is not allowed due to lack of a unique index,\nconcurrent refresh can immediately detect it and emit an error.\n\nAuthor: Masahiko Sawada\nReviewed-by: Michael Paquier, Fujii Masao","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/31b6606c48edf7c008ffe91907c080404a8c8046"},{"sha":"cfafd8beadcd6f8c8a570ab2504a75c33c58e504","author":{"email":"1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@joeconway.com","name":"Joe Conway"},"message":"Correct Copyright year from 2015 to 2016\n\nLooks like this patch went in after Copyright messages\nwere updated for 2016 and it missed the boat. Fixed.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/cfafd8beadcd6f8c8a570ab2504a75c33c58e504"},{"sha":"db76b1efbbab2441428a9ef21f7ac9ba43c52482","author":{"email":"883768b6dd2c42aea0031b24be8a2da40fef4b64@anarazel.de","name":"Andres Freund"},"message":"Allow SetHintBits() to succeed if the buffer's LSN is new enough.\n\nPreviously we only allowed SetHintBits() to succeed if the commit LSN of\nthe last transaction touching the page has already been flushed to\ndisk. We can't generally change the LSN of the page, because we don't\nnecessarily have the required locks on the page. But the required LSN\ninterlock does not mean the commit record has to be flushed immediately,\nit just requires that the commit record will be flushed before the page is\nwritten out. Therefore if the buffer LSN is newer than the commit LSN,\nthe hint bit can be safely set.\n\nIn a number of scenarios (e.g. pgbench) this noticeably increases the\nnumber of hint bits are set. But more importantly it also keeps the\nsuccess rate up when flushing WAL less frequently. That was the original\nreason for commit 4de82f7d7, which has negative performance consequences\nin a number of scenarios. This will allow a followup commit to reduce\nthe flush rate.\n\nDiscussion: 20160118163908.GW10941@awork2.anarazel.de","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/db76b1efbbab2441428a9ef21f7ac9ba43c52482"},{"sha":"8c95ae81fab11b75a611b57d6aaa0ef77e8b8e41","author":{"email":"ffeaa947aef224da9ba99b6a18bdd74288df0e3e@sss.pgh.pa.us","name":"Tom Lane"},"message":"Suppress compiler warnings about useless comparison of unsigned to zero.\n\nReportedly, some compilers warn about tests like \"c < 0\" if c is unsigned,\nand hence complain about the character range checks I added in commit\n3bb3f42f3749d40b8d4de65871e8d828b18d4a45.  This is a bit of a pain since\nthe regex library doesn't really want to assume that chr is unsigned.\nHowever, since any such reconfiguration would involve manual edits of\nregcustom.h anyway, we can put it on the shoulders of whoever wants to\ndo that to adjust this new range-checking macro correctly.\n\nPer gripes from Coverity and Andres.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/8c95ae81fab11b75a611b57d6aaa0ef77e8b8e41"},{"sha":"5df44d14ba9fd3f6149c3fa0919745c9e24bcffe","author":{"email":"3c84f0de6f8a0f296d36cdd9f57fa166641c96b1@alvh.no-ip.org","name":"Alvaro Herrera"},"message":"pgbench: avoid FD_ISSET on an invalid file descriptor\n\nThe original code wasn't careful to test the file descriptor returned by\nPQsocket() for an invalid socket.  If an invalid socket did turn up,\nthat would amount to calling FD_ISSET with fd = -1, whereby undefined\nbehavior can be invoked.\n\nTo fix, test file descriptor for validity and stop further processing if\nthat fails.\n\nProblem noticed by Coverity.\n\nThere is an existing FD_ISSET callsite that does check for invalid\nsockets beforehand, but the error message reported by it was\nstrerror(errno); in testing the aforementioned change, that turns out to\nresult in \"bad socket: Success\" which isn't terribly helpful.  Instead\nuse PQerrorMessage() in both places which is more likely to contain an\nuseful error message.\n\nBackpatch-through: 9.1.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/5df44d14ba9fd3f6149c3fa0919745c9e24bcffe"},{"sha":"7975c5e0a992ae9a45e03d145e0d37e2b5a707f5","author":{"email":"883768b6dd2c42aea0031b24be8a2da40fef4b64@anarazel.de","name":"Andres Freund"},"message":"Allow the WAL writer to flush WAL at a reduced rate.\n\nCommit 4de82f7d7 increased the WAL flush rate, mainly to increase the\nlikelihood that hint bits can be set quickly. More quickly set hint bits\ncan reduce contention around the clog et al.  But unfortunately the\nincreased flush rate can have a significant negative performance impact,\nI have measured up to a factor of ~4.  The reason for this slowdown is\nthat if there are independent writes to the underlying devices, for\nexample because shared buffers is a lot smaller than the hot data set,\nor because a checkpoint is ongoing, the fdatasync() calls force cache\nflushes to be emitted to the storage.\n\nThis is achieved by flushing WAL only if the last flush was longer than\nwal_writer_delay ago, or if more than wal_writer_flush_after (new GUC)\nunflushed blocks are pending. Based on some tests the default for\nwal_writer_delay is 1MB, which seems to work well both on SSD and\nrotational media.\n\nTo avoid negative performance impact due to 4de82f7d7 an earlier\ncommit (db76b1e) made SetHintBits() more likely to succeed; preventing\nperformance regressions in the pgbench tests I performed.\n\nDiscussion: 20160118163908.GW10941@awork2.anarazel.de","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/7975c5e0a992ae9a45e03d145e0d37e2b5a707f5"},{"sha":"851636bfdaa9aa62d5adfaa0aa8c06b408e0d8a9","author":{"email":"1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@joeconway.com","name":"Joe Conway"},"message":"Move DATA entry to correct position\n\nIn commit 7b4bfc87 the DATA and DESCR entries for the new\nrow_security_active() function were inadvertantly put after\nthe PROVOLATILE defines, rather than before as they should\nhave been placed. Move them up where they belong.\n\nBackpatch to 9.5 where the new entries were introduced.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/851636bfdaa9aa62d5adfaa0aa8c06b408e0d8a9"},{"sha":"597f7e3a6ec393cf9ff3e11552faf69ff0ab652b","author":{"email":"1f6acd02e97f7332f0e624e7be5170a1e771cb87@postgresql.org","name":"Fujii Masao"},"message":"Correct the formulas for System V IPC parameters SEMMNI and SEMMNS in docs.\n\nIn runtime.sgml, the old formulas for calculating the reasonable\nvalues of SEMMNI and SEMMNS were incorrect. They have forgotten to\ncount the number of semaphores which both the checkpointer process\n(introduced in 9.2) and the background worker processes (introduced\nin 9.3) need.\n\nThis commit fixes those formulas so that they count the number of\nsemaphores which the checkpointer process and the background worker\nprocesses need.\n\nReport and patch by Kyotaro Horiguchi. Only the patch for 9.3 was\nmodified by me. Back-patch to 9.2 where the checkpointer process was\nadded and the number of needed semaphores was increased.\n\nAuthor: Kyotaro Horiguchi\nReviewed-by: Fujii Masao\nBackpatch: 9.2\nDiscussion: http://www.postgresql.org/message-id/20160203.125119.66820697.horiguchi.kyotaro@lab.ntt.co.jp","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/597f7e3a6ec393cf9ff3e11552faf69ff0ab652b"},{"sha":"bdc309c7dc849a7362a624846ebc9170a8c353f3","author":{"email":"d65e86e9f63e8ebd237ae089e7c4417e05d5f9dd@postgresql.org","name":"Tatsuo Ishii"},"message":"Improve wording in the planner doc\n\nChange \"In this case\" to \"In the example above\" to clarify what it\nactually refers to.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/bdc309c7dc849a7362a624846ebc9170a8c353f3"},{"sha":"5f41d6a6694ca4e5f335d4cb9e4e8f4f73896015","author":{"email":"c4b5a8c0fafd56ae12499ba1d5d55022dbe4108e@2ndquadrant.com","name":"Craig Ringer"},"message":"Allow logical slots to follow timeline switches\n\nMake logical replication slots timeline-aware, so replay can\ncontinue from a historical timeline onto the server's current\ntimeline.\n\nThis is required to make failover slots possible and may also\nbe used by extensions that CreateReplicationSlot on a standby\nand replay from that slot once the replica is promoted.\n\nThis does NOT add support for replaying from a logical slot on\na standby or for syncing slots to replicas.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/5f41d6a6694ca4e5f335d4cb9e4e8f4f73896015"},{"sha":"0b7bc923791c679e6f1e4475041d76ed8623c2ec","author":{"email":"c4b5a8c0fafd56ae12499ba1d5d55022dbe4108e@2ndquadrant.com","name":"Craig Ringer"},"message":"Allow replication slots to follow failover\n\nOriginally replication slots were unique to a single node and weren't\nrecorded in WAL or replicated. A logical decoding client couldn't follow\na physical standby failover and promotion because the promoted replica\ndidn't have the original master's slots. The replica may not have\nretained all required WAL and there was no way to create a new logical\nslot and rewind it back to the point the logical client had replayed to.\n\nFailover slots lift this limitation by replicating slots consistently to\nphysical standbys, keeping them up to date and using them in WAL\nretention calculations. This allows a logical decoding client to follow\na physical failover and promotion without losing its place in the change\nstream.\n\nA failover slot may only be created on a master server, as it must be\nable to write WAL. This limitation may be lifted later.\n\nThis patch adds a new backup label entry 'MIN FAILOVER SLOT LSN' that,\nif present, indicates the minimum LSN needed by any failover slot that\nis present in the base backup. Backup tools should check for this entry\nand ensure they retain all xlogs including and after that point. It also\nchanges the return value of pg_start_backup(), the BASE_BACKUP walsender\ncommand, etc to report the minimum WAL required by any failover slot\nif this is a lower LSN than the redo position so that base backups\ncontain the WAL required for slots to work.\n\npg_basebackup is also modified to copy the contents of pg_replslot.\nNon-failover slots will now be removed during backend startup instead\nof being omitted from the copy.\n\nThis patch does not add any user interface for failover slots. There's\nno way to create them from SQL or from the walsender. That and the\ndocumentation for failover slots are in the next patch in the series\nso that this patch is entirely focused on the implementation.\n\nCraig Ringer, based on a prototype by Simon Riggs","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/0b7bc923791c679e6f1e4475041d76ed8623c2ec"},{"sha":"e0e9ece14cf712995bf4de0d611a402277f2b2aa","author":{"email":"c4b5a8c0fafd56ae12499ba1d5d55022dbe4108e@2ndquadrant.com","name":"Craig Ringer"},"message":"Add the UI and documentation for failover slots\n\nExpose failover slots to the user.\n\nAdd a new 'failover' argument to pg_create_logical_replication_slot and\npg_create_physical_replication_slot . Report if a slot is a failover\nslot in pg_catalog.pg_replication_slots. Accept a new FAILOVER keyword\nargument in CREATE_REPLICATION_SLOT on the walsender protocol.\n\nDocument the existence of failover slots support and how to use them.","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/e0e9ece14cf712995bf4de0d611a402277f2b2aa"},{"sha":"a6ef7d36e4810433af245d61c4d44cacd64f4f20","author":{"email":"c4b5a8c0fafd56ae12499ba1d5d55022dbe4108e@2ndquadrant.com","name":"Craig Ringer"},"message":"(not for inclusion): Test script for failover slots","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/a6ef7d36e4810433af245d61c4d44cacd64f4f20"}]}