Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Imseih (AWS), Sami
>I adjusted the FAILSAFE_EVERY_PAGES comments, which now point out that >FAILSAFE_EVERY_PAGES is a power-of-two. The implication is that the >compiler is all but guaranteed to be able to reduce the modulo >division into a shift in the lazy_scan_heap loop, at the point of the >

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Peter Geoghegan
On Tue, Dec 20, 2022 at 9:44 AM Imseih (AWS), Sami wrote: > Attached is a patch to check scanned pages rather > than blockno. Pushed, thanks! I adjusted the FAILSAFE_EVERY_PAGES comments, which now point out that FAILSAFE_EVERY_PAGES is a power-of-two. The implication is that the compiler is

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Masahiko Sawada
On Wed, Dec 21, 2022 at 2:44 AM Imseih (AWS), Sami wrote: > > Attached is a patch to check scanned pages rather > than blockno. Thank you for the patch. It looks good to me. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-22 Thread Masahiko Sawada
On Sat, Nov 12, 2022 at 12:28 AM Imseih (AWS), Sami wrote: > > >Yeah, it's a little inconsistent. > > Yes, this should be corrected by calling the failsafe > inside the parallel vacuum loops and handling the case by exiting > the loop and parallel vacuum if failsafe kicks in. I agree it's

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-12-20 Thread Imseih (AWS), Sami
Attached is a patch to check scanned pages rather than blockno. Regards, Sami Imseih Amazon Web Services (AWS) v1-0001-fixed-when-wraparound-failsafe-is-checked.patch Description: v1-0001-fixed-when-wraparound-failsafe-is-checked.patch

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-11-11 Thread Imseih (AWS), Sami
>Yeah, it's a little inconsistent. Yes, this should be corrected by calling the failsafe inside the parallel vacuum loops and handling the case by exiting the loop and parallel vacuum if failsafe kicks in. >I meant that there should definitely be a check between each round of >index

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-11-10 Thread Peter Geoghegan
On Thu, Nov 10, 2022 at 10:20 AM Imseih (AWS), Sami wrote: > Consistency is the key point here. It is odd that a serial > vacuum may skip the remainder of the indexes if failsafe > kicks-in, but in the parallel case it will go through the entire index > cycle. Yeah, it's a little inconsistent.

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-11-10 Thread Imseih (AWS), Sami
>It makes sense to prefer consistency here, I suppose. The reason why >we're not consistent is because it was easier not to be, which isn't >exactly the best reason (nor the worst). Consistency is the key point here. It is odd that a serial vacuum may skip the remainder of the indexes

Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-11-09 Thread Peter Geoghegan
On Wed, Nov 9, 2022 at 6:29 AM Imseih (AWS), Sami wrote: > When a user is running a parallel vacuum and the vacuum is long running > > due to many large indexes, it would make sense to check for failsafe earlier. It makes sense to prefer consistency here, I suppose. The reason why we're not

Call lazy_check_wraparound_failsafe earlier for parallel vacuum

2022-11-09 Thread Imseih (AWS), Sami
While looking through vacuum code, I noticed that unlike non-parallel vacuum, parallel vacuum only gets a failsafe check after an entire index cycle completes. In vacuumlazy.c, lazy_check_wraparound_failsafe is checked after every index completes, while in parallel, it is checked after an entire