Re: pg_rewind copies

2022-04-05 Thread Daniel Gustafsson
> On 4 Apr 2022, at 15:08, Peter Eisentraut > wrote: > We use snprintf() like that countless times, and approximately none of them > check for overflow. So while you are right, this might not be the place to > start a new policy. Fair enough, I'll remove these hunks before committing and

Re: pg_rewind copies

2022-04-04 Thread Peter Eisentraut
On 01.04.22 11:00, Daniel Gustafsson wrote: One small comment on the patch: + snprintf(srcpath, sizeof(srcpath), "%s/%s", datadir, path); This should IMO check the returnvalue of snprintf to ensure it wasn't truncated. While the risk is exceedingly small, a truncated filename might match

Re: pg_rewind copies

2022-04-01 Thread Daniel Gustafsson
> On 1 Apr 2022, at 12:46, Heikki Linnakangas wrote: >> +if (len >= sizeof(dstpath)) >> +pg_fatal("filepath buffer too small"); /* shouldn't happen */ > > Makes sense. I would remove the "shouldn't happen"; it's not very hard to > make it happen, you just need a very long

Re: pg_rewind copies

2022-04-01 Thread Heikki Linnakangas
On 01/04/2022 12:00, Daniel Gustafsson wrote: I took another look at this patch, and I think it's ready to go in, it clearly fixes a bug that isn't too hard to hit in production settings. To ensure we don't break this I've added a testcase which pipes the pg_rewind --verbose output to a file

Re: pg_rewind copies

2022-04-01 Thread Daniel Gustafsson
I took another look at this patch, and I think it's ready to go in, it clearly fixes a bug that isn't too hard to hit in production settings. To ensure we don't break this I've added a testcase which pipes the pg_rewind --verbose output to a file it's asked to copy, which then guarantees that the

Re: pg_rewind copies

2021-11-09 Thread Daniel Gustafsson
> On 25 Mar 2021, at 14:32, David Steele wrote: > > On 1/22/21 8:26 AM, Heikki Linnakangas wrote: >> On 16/12/2020 00:08, Cary Huang wrote: >>> The following review has been posted through the commitfest application: >>> make installcheck-world: tested, passed >>> Implements feature:

Re: pg_rewind copies

2021-03-25 Thread David Steele
On 1/22/21 8:26 AM, Heikki Linnakangas wrote: On 16/12/2020 00:08, Cary Huang wrote: The following review has been posted through the commitfest application: make installcheck-world:  tested, passed Implements feature:   tested, passed Spec compliant:   tested, passed Documentation: 

Re: pg_rewind copies

2021-01-22 Thread Heikki Linnakangas
On 16/12/2020 00:08, Cary Huang wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested Hello The patch seems

Re: pg_rewind copies

2020-12-15 Thread Cary Huang
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested Hello The patch seems to do as described and the regression and

pg_rewind copies

2020-11-13 Thread Heikki Linnakangas
If a file is modified and becomes larger in the source system while pg_rewind is running, pg_rewind can leave behind a partial copy of file. That's by design, and it's OK for relation files because they're replayed from WAL. But it can cause trouble for configuration files. I ran into this