Re: report expected contrecord size

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-03, Tom Lane wrote: > Alvaro Herrera writes: > > On 2020-Sep-03, Tom Lane wrote: > >> Uh ... is it really possible for gotlen to be more than total_len? > >> (I've not looked at the surrounding code here, but that seems weird.) > > > Well, as I understand, total_len comes from one pa

Re: report expected contrecord size

2020-09-03 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Sep-03, Tom Lane wrote: >> Uh ... is it really possible for gotlen to be more than total_len? >> (I've not looked at the surrounding code here, but that seems weird.) > Well, as I understand, total_len comes from one page, and gotlen comes > from the continuation

Re: report expected contrecord size

2020-09-03 Thread Alvaro Herrera
On 2020-Sep-03, Tom Lane wrote: > Alvaro Herrera writes: > > Well, the intention there is to cast the first operand (which is uint32) > > so that it turns into signed 64-bits; the subtraction then occurs in 64 > > bit arithmetic normally. If I let the subtraction occur in 32-bit width > > unsign

Re: report expected contrecord size

2020-09-03 Thread Tom Lane
Alvaro Herrera writes: > Well, the intention there is to cast the first operand (which is uint32) > so that it turns into signed 64-bits; the subtraction then occurs in 64 > bit arithmetic normally. If I let the subtraction occur in 32-bit width > unsigned, the result might overflow 32 bits. Uh

Re: report expected contrecord size

2020-09-03 Thread Alvaro Herrera
On 2020-Sep-03, Tom Lane wrote: > Alvaro Herrera writes: > > A pretty minor issue: when reporting that WAL appears invalid because > > contrecord length doesn't match, we may as well print to the server log > > the value that we're expecting. Patch attached. > > ITYW > > +

Re: report expected contrecord size

2020-09-03 Thread Tom Lane
Alvaro Herrera writes: > A pretty minor issue: when reporting that WAL appears invalid because > contrecord length doesn't match, we may as well print to the server log > the value that we're expecting. Patch attached. ITYW + (long long) (total_len - gotlen)

report expected contrecord size

2020-09-03 Thread Alvaro Herrera
A pretty minor issue: when reporting that WAL appears invalid because contrecord length doesn't match, we may as well print to the server log the value that we're expecting. Patch attached. -- Álvaro Herrera http://www.flickr.com/photos/alvherre/ diff --git a/src/backend/