{"push_id":982503936,"size":1,"distinct_size":1,"ref":"refs/heads/dev/failover-slots94","head":"bb577c91a23313b6f13b60f364203882c976ada4","before":"d5cb7ea4d69c1929d43ae70b04d31ba0865bdf59","commits":[{"sha":"bb577c91a23313b6f13b60f364203882c976ada4","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\n\nBackported to 9.4\n\nConflicts:\n\tcontrib/pg_xlogdump/rmgrdesc.c\n\tsrc/backend/access/rmgrdesc/Makefile\n\tsrc/backend/access/transam/rmgr.c\n\tsrc/backend/replication/logical/decode.c\n\tsrc/backend/replication/slot.c\n\tsrc/include/access/rmgrlist.h\n\tsrc/include/replication/slot.h","distinct":true,"url":"https://api.github.com/repos/2ndQuadrant/postgres/commits/bb577c91a23313b6f13b60f364203882c976ada4"}]}