display offset along with block number in vacuum errors

2020-07-24 Thread Mahendra Singh Thalor
Hi hackers, We discussed in another email thread[1], that it will be helpful if we can display offset along with block number in vacuum error. Here, proposing a patch to add offset along with block number in vacuum errors. In commit b61d161(Introduce vacuum errcontext to display additional informa

Re: display offset along with block number in vacuum errors

2020-07-25 Thread Michael Paquier
On Fri, Jul 24, 2020 at 11:18:43PM +0530, Mahendra Singh Thalor wrote: > In commit b61d161(Introduce vacuum errcontext to display additional > information), we added vacuum errcontext to display additional > information(block number) so that in case of vacuum error, we can identify > which block we

Re: display offset along with block number in vacuum errors

2020-07-27 Thread Masahiko Sawada
On Sat, 25 Jul 2020 at 02:49, Mahendra Singh Thalor wrote: > > Hi hackers, > We discussed in another email thread[1], that it will be helpful if we can > display offset along with block number in vacuum error. Here, proposing a > patch to add offset along with block number in vacuum errors. > >

Re: display offset along with block number in vacuum errors

2020-07-27 Thread Mahendra Singh Thalor
Thanks Michael for looking into this. On Sat, 25 Jul 2020 at 15:02, Michael Paquier wrote: > > On Fri, Jul 24, 2020 at 11:18:43PM +0530, Mahendra Singh Thalor wrote: > > In commit b61d161(Introduce vacuum errcontext to display additional > > information), we added vacuum errcontext to display add

Re: display offset along with block number in vacuum errors

2020-07-27 Thread Justin Pryzby
On Fri, Jul 24, 2020 at 11:18:43PM +0530, Mahendra Singh Thalor wrote: > Hi hackers, > We discussed in another email thread[1], that it will be helpful if we can > display offset along with block number in vacuum error. Here, proposing a > patch to add offset along with block number in vacuum error

Re: display offset along with block number in vacuum errors

2020-07-28 Thread Mahendra Singh Thalor
Thanks Justin, Sawada and Michael for reviewing. On Mon, 27 Jul 2020 at 16:43, Justin Pryzby wrote: > > On Fri, Jul 24, 2020 at 11:18:43PM +0530, Mahendra Singh Thalor wrote: > > Hi hackers, > > We discussed in another email thread[1], that it will be helpful if we can > > display offset along wi

Re: display offset along with block number in vacuum errors

2020-07-28 Thread Justin Pryzby
On Wed, Jul 29, 2020 at 12:35:17AM +0530, Mahendra Singh Thalor wrote: > Apart from these, I fixed comments given by Sawada and Michael in the > latest patch. Attaching v2 patch for review. Thanks. lazy_check_needs_freeze iterates over blocks and this patch changes it to update vacrelstats. I th

Re: display offset along with block number in vacuum errors

2020-07-31 Thread Justin Pryzby
Bcc: Subject: Re: display offset along with block number in vacuum errors Reply-To: In-Reply-To: On Wed, Jul 29, 2020 at 12:35:17AM +0530, Mahendra Singh Thalor wrote: > > Here: > > > > @@ -1924,14 +1932,22 @@ lazy_vacuum_page(Relation onerel, BlockNumber > &

Re: display offset along with block number in vacuum errors

2020-07-31 Thread Justin Pryzby
On Fri, Jul 31, 2020 at 04:55:14PM -0500, Justin Pryzby wrote: > Bcc: > Subject: Re: display offset along with block number in vacuum errors > Reply-To: > In-Reply-To: > whoops > On Wed, Jul 29, 2020 at 12:35:17AM +0530, Mahendra Singh Thalor wrote: > > > He

Re: display offset along with block number in vacuum errors

2020-08-01 Thread Mahendra Singh Thalor
Thanks Justin. On Sat, 1 Aug 2020 at 11:47, Justin Pryzby wrote: > > On Fri, Jul 31, 2020 at 04:55:14PM -0500, Justin Pryzby wrote: > > Bcc: > > Subject: Re: display offset along with block number in vacuum errors > > Reply-To: > > In-Reply-To: > > > &g

Re: display offset along with block number in vacuum errors

2020-08-01 Thread Justin Pryzby
On Sat, Aug 01, 2020 at 12:31:53PM +0530, Mahendra Singh Thalor wrote: > Actually I was waiting for review comments from committer and other > people also and was planning to send a patch after that. I already > fixed your comments in my offline patch and was waiting for more > comments. Anyway, th

Re: display offset along with block number in vacuum errors

2020-08-01 Thread Masahiko Sawada
On Sat, 1 Aug 2020 at 16:02, Mahendra Singh Thalor wrote: > > Thanks Justin. > > On Sat, 1 Aug 2020 at 11:47, Justin Pryzby wrote: > > > > On Fri, Jul 31, 2020 at 04:55:14PM -0500, Justin Pryzby wrote: > > > Bcc: > > > Subject: Re: display offse

Re: display offset along with block number in vacuum errors

2020-08-01 Thread Justin Pryzby
On Sun, Aug 02, 2020 at 01:02:42PM +0900, Masahiko Sawada wrote: > Thank you for updating the patch! > > Here are my comments on v3 patch: > > @@ -2024,6 +2033,11 @@ lazy_check_needs_freeze(Buffer buf, bool *hastup) > if (PageIsNew(page) || PageIsEmpty(page)) > return false; > > +

Re: display offset along with block number in vacuum errors

2020-08-02 Thread Masahiko Sawada
On Sun, 2 Aug 2020 at 13:24, Justin Pryzby wrote: > > On Sun, Aug 02, 2020 at 01:02:42PM +0900, Masahiko Sawada wrote: > > Thank you for updating the patch! > > > > Here are my comments on v3 patch: > > > > @@ -2024,6 +2033,11 @@ lazy_check_needs_freeze(Buffer buf, bool *hastup) > > if (PageIs

Re: display offset along with block number in vacuum errors

2020-08-04 Thread Mahendra Singh Thalor
1, 2020 at 04:55:14PM -0500, Justin Pryzby wrote: > > > > Bcc: > > > > Subject: Re: display offset along with block number in vacuum errors > > > > Reply-To: > > > > In-Reply-To: > > > > > > > > > > whoops > > &g

Re: display offset along with block number in vacuum errors

2020-08-05 Thread Robert Haas
On Sun, Aug 2, 2020 at 10:43 PM Masahiko Sawada wrote: > I think that since the user who uses this errcontext information is > likely to know more or less the internal of PostgreSQL I think 0-based > block number and 1-based offset will not be a problem. However, I > expected these are documented

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Amit Kapila
On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby wrote: > > On Wed, Jul 29, 2020 at 12:35:17AM +0530, Mahendra Singh Thalor wrote: > > Apart from these, I fixed comments given by Sawada and Michael in the > > latest patch. Attaching v2 patch for review. > > Thanks. > > lazy_check_needs_freeze iterate

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Amit Kapila
On Wed, Aug 5, 2020 at 12:47 AM Mahendra Singh Thalor wrote: > > Apart from these, I fixed Justin's comment of extra brackets(That was > due to "patch -p 1 < file", as 002_fix was not applying directly). I > haven't updated the document for this(Sawada's comment). I will try in > the next patch. >

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Justin Pryzby
On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapila wrote: > On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby wrote: > > > > On Wed, Jul 29, 2020 at 12:35:17AM +0530, Mahendra Singh Thalor wrote: > > > Apart from these, I fixed comments given by Sawada and Michael in the > > > latest patch. Attachi

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Amit Kapila
On Thu, Aug 6, 2020 at 7:51 PM Justin Pryzby wrote: > > On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapila wrote: > > On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby wrote: > > > > > > > > > lazy_check_needs_freeze iterates over blocks and this patch changes it to > > > update vacrelstats. I th

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Masahiko Sawada
On Fri, 7 Aug 2020 at 10:49, Amit Kapila wrote: > > On Thu, Aug 6, 2020 at 7:51 PM Justin Pryzby wrote: > > > > On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapila wrote: > > > On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby > > > wrote: > > > > > > > > > > > > lazy_check_needs_freeze iterates

Re: display offset along with block number in vacuum errors

2020-08-06 Thread Amit Kapila
On Fri, Aug 7, 2020 at 8:10 AM Masahiko Sawada wrote: > > On Fri, 7 Aug 2020 at 10:49, Amit Kapila wrote: > > > > On Thu, Aug 6, 2020 at 7:51 PM Justin Pryzby wrote: > > > > > > On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapila wrote: > > > > On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby >

Re: display offset along with block number in vacuum errors

2020-08-09 Thread Masahiko Sawada
On Fri, 7 Aug 2020 at 13:04, Amit Kapila wrote: > > On Fri, Aug 7, 2020 at 8:10 AM Masahiko Sawada > wrote: > > > > On Fri, 7 Aug 2020 at 10:49, Amit Kapila wrote: > > > > > > On Thu, Aug 6, 2020 at 7:51 PM Justin Pryzby wrote: > > > > > > > > On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapi

Re: display offset along with block number in vacuum errors

2020-08-14 Thread Amit Kapila
On Mon, Aug 10, 2020 at 10:24 AM Masahiko Sawada wrote: > > It's true that heap_page_is_all_visible() is called from only > lazy_vacuum_page() but I'm concerned it would lead misleading since > it's not actually removing tuples but just checking after vacuum. I > guess that the errcontext should s

Re: display offset along with block number in vacuum errors

2020-08-14 Thread Amit Kapila
On Fri, Aug 7, 2020 at 7:18 AM Amit Kapila wrote: > > On Thu, Aug 6, 2020 at 7:51 PM Justin Pryzby wrote: > > > > On Thu, Aug 06, 2020 at 07:39:21PM +0530, Amit Kapila wrote: > > > On Wed, Jul 29, 2020 at 1:09 AM Justin Pryzby > > > wrote: > > > > > > > > > > > > lazy_check_needs_freeze iterate

Re: display offset along with block number in vacuum errors

2020-08-14 Thread Amit Kapila
On Thu, Aug 6, 2020 at 7:41 PM Amit Kapila wrote: > > On Wed, Aug 5, 2020 at 12:47 AM Mahendra Singh Thalor > wrote: > > > > Apart from these, I fixed Justin's comment of extra brackets(That was > > due to "patch -p 1 < file", as 002_fix was not applying directly). I > > haven't updated the docum

Re: display offset along with block number in vacuum errors

2020-08-14 Thread Amit Kapila
On Fri, Aug 14, 2020 at 4:06 PM Amit Kapila wrote: > > On Mon, Aug 10, 2020 at 10:24 AM Masahiko Sawada > wrote: > > > > It's true that heap_page_is_all_visible() is called from only > > lazy_vacuum_page() but I'm concerned it would lead misleading since > > it's not actually removing tuples but

Re: display offset along with block number in vacuum errors

2020-08-16 Thread Masahiko Sawada
On Sat, 15 Aug 2020 at 12:19, Amit Kapila wrote: > > On Fri, Aug 14, 2020 at 4:06 PM Amit Kapila wrote: > > > > On Mon, Aug 10, 2020 at 10:24 AM Masahiko Sawada > > wrote: > > > > > > It's true that heap_page_is_all_visible() is called from only > > > lazy_vacuum_page() but I'm concerned it woul

Re: display offset along with block number in vacuum errors

2020-08-17 Thread Amit Kapila
On Mon, Aug 17, 2020 at 11:38 AM Masahiko Sawada wrote: > > On Sat, 15 Aug 2020 at 12:19, Amit Kapila wrote: > > > > The reason why I have not included heap_page_prune related change in > > the patch is that I don't want to sprinkle this in every possible > > function (code path) called via vacuu

Re: display offset along with block number in vacuum errors

2020-08-19 Thread Masahiko Sawada
On Tue, 18 Aug 2020 at 13:06, Amit Kapila wrote: > > On Mon, Aug 17, 2020 at 11:38 AM Masahiko Sawada > wrote: > > > > On Sat, 15 Aug 2020 at 12:19, Amit Kapila wrote: > > > > > > The reason why I have not included heap_page_prune related change in > > > the patch is that I don't want to sprinkl

Re: display offset along with block number in vacuum errors

2020-08-19 Thread Amit Kapila
On Wed, Aug 19, 2020 at 12:54 PM Masahiko Sawada wrote: > > On Tue, 18 Aug 2020 at 13:06, Amit Kapila wrote: > > > > > > I don't think we need to expose LVRelStats. We can just pass the > > address of vacrelstats->offset_num to achieve what we want. I have > > tried that and it works, see the > >

Re: display offset along with block number in vacuum errors

2020-08-19 Thread Masahiko Sawada
On Thu, 20 Aug 2020 at 14:01, Amit Kapila wrote: > > On Wed, Aug 19, 2020 at 12:54 PM Masahiko Sawada > wrote: > > > > On Tue, 18 Aug 2020 at 13:06, Amit Kapila wrote: > > > > > > > > > I don't think we need to expose LVRelStats. We can just pass the > > > address of vacrelstats->offset_num to a

Re: display offset along with block number in vacuum errors

2020-08-20 Thread Amit Kapila
On Thu, Aug 20, 2020 at 12:18 PM Masahiko Sawada wrote: > > On Thu, 20 Aug 2020 at 14:01, Amit Kapila wrote: > > > > On Wed, Aug 19, 2020 at 12:54 PM Masahiko Sawada > > wrote: > > > > Here, we can notice that for the index, we are getting context > > information but not for the heap. The reason

Re: display offset along with block number in vacuum errors

2020-08-20 Thread Amit Kapila
On Thu, Aug 20, 2020 at 12:32 PM Amit Kapila wrote: > > On Thu, Aug 20, 2020 at 12:18 PM Masahiko Sawada > wrote: > > > > On Thu, 20 Aug 2020 at 14:01, Amit Kapila wrote: > > > > > > On Wed, Aug 19, 2020 at 12:54 PM Masahiko Sawada > > > wrote: > > > > > > Here, we can notice that for the index

Re: display offset along with block number in vacuum errors

2020-08-21 Thread Masahiko Sawada
On Thu, 20 Aug 2020 at 21:12, Amit Kapila wrote: > > On Thu, Aug 20, 2020 at 12:32 PM Amit Kapila wrote: > > > > On Thu, Aug 20, 2020 at 12:18 PM Masahiko Sawada > > wrote: > > > > > > On Thu, 20 Aug 2020 at 14:01, Amit Kapila wrote: > > > > > > > > On Wed, Aug 19, 2020 at 12:54 PM Masahiko Saw

Re: display offset along with block number in vacuum errors

2020-08-23 Thread Amit Kapila
On Fri, Aug 21, 2020 at 12:31 PM Masahiko Sawada wrote: > > On Thu, 20 Aug 2020 at 21:12, Amit Kapila wrote: > > > > > > Attached are both the patches. The first one is to improve existing > > error context information, so I think we should back-patch to 13. The > > second one is to add additiona

Re: display offset along with block number in vacuum errors

2020-08-25 Thread Mahendra Singh Thalor
On Thu, 20 Aug 2020 at 17:42, Amit Kapila wrote: > > On Thu, Aug 20, 2020 at 12:32 PM Amit Kapila wrote: > > > > On Thu, Aug 20, 2020 at 12:18 PM Masahiko Sawada > > wrote: > > > > > > On Thu, 20 Aug 2020 at 14:01, Amit Kapila wrote: > > > > > > > > On Wed, Aug 19, 2020 at 12:54 PM Masahiko Saw

Re: display offset along with block number in vacuum errors

2020-08-25 Thread Amit Kapila
On Wed, Aug 26, 2020 at 8:54 AM Mahendra Singh Thalor wrote: > > On Thu, 20 Aug 2020 at 17:42, Amit Kapila wrote: > > > > Attached are both the patches. The first one is to improve existing > > error context information, so I think we should back-patch to 13. The > > second one is to add addition

Re: display offset along with block number in vacuum errors

2020-08-25 Thread Masahiko Sawada
On Wed, 26 Aug 2020 at 15:07, Amit Kapila wrote: > > On Wed, Aug 26, 2020 at 8:54 AM Mahendra Singh Thalor > wrote: > > > > On Thu, 20 Aug 2020 at 17:42, Amit Kapila wrote: > > > > > > Attached are both the patches. The first one is to improve existing > > > error context information, so I think