pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of missing files when using pg_rewind with online s 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c6d33d14408664ccd1ebcd2f4e7dddd54cfe698e Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5f89bb4cf0109bdb36eb8f78943f5b0f141c614a Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/14fe8041395cdfaf05c736911080982d021c5e9d Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1d09fb1f0a9c7edc3298104fc4350e49169f6f2a Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/18ec25412c08e6bdc42c0179a2b42d816d12fbbd Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/92927477ff7062aba67b8139036acdc28603a76a Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix handling of missing files when using pg_rewind with online s @ 2020-07-15 06:19 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2020-07-15 06:19 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of missing files when using pg_rewind with online source When working with an online source cluster, pg_rewind gets a list of all the files in the source data directory using a WITH RECURSIVE query, returning a NULL result for a file's metadata if it gets removed between the moment it is listed in a directory and the moment its metadata is obtained with pg_stat_file() (say a recycled WAL segment). The query result was processed in such a way that for each tuple we checked only that the first file's metadata was NULL. This could have two consequences, both resulting in a failure of the rewind: - If the first tuple referred to a removed file, all files from the source would be ignored. - Any file actually missing would not be considered as such. While on it, rework slightly the code so as no values are saved if we know that a file is going to be skipped. Issue introduced by b36805f, so backpatch down to 9.5. Author: Justin Pryzby, Michael Paquier Reviewed-by: Daniel Gustafsson, Masahiko Sawada Discussion: https://postgr.es/m/20200713061010.GC23581@telsasoft.com Backpatch-through: 9.5 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/23924feca065aa75f0a9edcf78ad953a51405fe8 Modified Files -------------- src/bin/pg_rewind/libpq_fetch.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-07-15 06:19 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz> 2020-07-15 06:19 pgsql: Fix handling of missing files when using pg_rewind with online s Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox