Re: [Patch] ALTER SYSTEM READ ONLY

2020-12-13 Thread Amul Sul
On Thu, Dec 10, 2020 at 6:04 AM Andres Freund wrote: > > Hi, > > On 2020-12-09 16:13:06 -0500, Robert Haas wrote: > > That's not good. On a typical busy system, a system is going to be in > > the middle of a checkpoint most of the time, and the checkpoint will > > take a long time to finish - mayb

Re: [Patch] ALTER SYSTEM READ ONLY

2020-12-14 Thread Amul Sul
On Mon, Dec 14, 2020 at 11:28 AM Amul Sul wrote: > > On Thu, Dec 10, 2020 at 6:04 AM Andres Freund wrote: > > > > Hi, > > > > On 2020-12-09 16:13:06 -0500, Robert Haas wrote: > > > That's not good. On a typical busy system, a system is going to be in

CheckpointLock needed in CreateCheckPoint()?

2021-01-06 Thread Amul Sul
Hi ALL, Snip from CreateCheckPoint(): -- /* * Acquire CheckpointLock to ensure only one checkpoint happens at a time. * (This is just pro forma, since in the present system structure there is * only one process that is allowed to issue checkpoints at any given * time.) */ LWLockAcquire(Checkp

Re: CheckpointLock needed in CreateCheckPoint()?

2021-01-06 Thread Amul Sul
On Thu, Jan 7, 2021 at 12:45 PM Bharath Rupireddy wrote: > > On Thu, Jan 7, 2021 at 11:32 AM Amul Sul wrote: > > Snip from CreateCheckPoint(): > > -- > > /* > > * Acquire CheckpointLock to ensure only one checkpoint happens at a time. > > * (This is just pr

Re: [Patch] ALTER SYSTEM READ ONLY

2021-03-02 Thread Amul Sul
On Tue, Mar 2, 2021 at 5:52 PM Dilip Kumar wrote: > > On Fri, Feb 19, 2021 at 5:43 PM Amul Sul wrote: > > > > In the attached version I have made the changes accordingly what Robert has > > summarised in his previous mail[1]. > > > > In addition to that, I

Re: [Patch] ALTER SYSTEM READ ONLY

2021-03-03 Thread Amul Sul
On Wed, Mar 3, 2021 at 12:08 PM Dilip Kumar wrote: > > On Tue, Mar 2, 2021 at 9:01 PM Dilip Kumar wrote: > > > > > > > We don't want that to happen in cases where previous > > > recovery-end-checkpoint is > > > skipped in startup. We want Checkpointer first to convey the barrier to > > > all >

Re: [Patch] ALTER SYSTEM READ ONLY

2021-03-04 Thread Amul Sul
On Wed, Mar 3, 2021 at 7:56 PM Dilip Kumar wrote: > > On Wed, Mar 3, 2021 at 4:50 PM Amul Sul wrote: > > > > On Wed, Mar 3, 2021 at 12:08 PM Dilip Kumar wrote: > > > > > Yes, it is possible to allow wal temporarily for itself by setting > > Loca

Re: Assertion failure when ATTACH partition followed by CREATE PARTITION.

2020-10-26 Thread Amul Sul
Hi, On Mon, Oct 19, 2020 at 4:58 PM Amul Sul wrote: > > Hi, > > Assertion added in commits 6b2c4e59d016 is failing with following test: > > CREATE TABLE sales > ( > prod_id int, > prod_quantity int, > sold_monthdate > ) PARTITION BY RA

Re: [Patch] ALTER SYSTEM READ ONLY

2020-11-20 Thread Amul Sul
On Fri, 20 Nov 2020 at 9:53 PM, Robert Haas wrote: > On Thu, Oct 8, 2020 at 6:23 AM Amul Sul wrote: > > On a quick look at the latest 0001 patch, the following hunk to reset > leftover > > flags seems to be unnecessary: > > > > + /* > > + * If some barrier

Correct comment in StartupXLOG().

2021-02-03 Thread Amul Sul
Hi, SharedRecoveryState member of XLogCtl is no longer a boolean flag, got changes in 4e87c4836ab9 to enum but, comment referring to it still referred as the boolean flag which is pretty confusing and incorrect. Also, the last part of the same comment is as: " .. although the boolean flag to all

Re: Correct comment in StartupXLOG().

2021-02-03 Thread Amul Sul
On Wed, Feb 3, 2021 at 2:48 PM Dilip Kumar wrote: > > On Wed, Feb 3, 2021 at 2:28 PM Amul Sul wrote: > > > > Hi, > > > > SharedRecoveryState member of XLogCtl is no longer a boolean flag, got > > changes > > in 4e87c4836ab9 to enum but, comment referri

Re: Correct comment in StartupXLOG().

2021-02-03 Thread Amul Sul
On Thu, Feb 4, 2021 at 6:18 AM Kyotaro Horiguchi wrote: > > At Wed, 3 Feb 2021 16:36:13 +0530, Amul Sul wrote in > > On Wed, Feb 3, 2021 at 2:48 PM Dilip Kumar wrote: > > > > > > On Wed, Feb 3, 2021 at 2:28 PM Amul Sul wrote: > > > > > > >

Re: Correct comment in StartupXLOG().

2021-02-05 Thread Amul Sul
On Fri, Feb 5, 2021 at 11:53 AM Michael Paquier wrote: > > On Thu, Feb 04, 2021 at 12:58:29PM +0530, Dilip Kumar wrote: > > Looks good to me. > > Rather than using the term "recovery state", I would just use > SharedRecoveryState. This leads me to the attached. Alright, that too looks good. Tha

Re: Multi-Column List Partitioning

2021-12-03 Thread Amul Sul
Hi, Few comments for v7 patch, note that I haven't been through the previous discussion, if any of the review comments that has been already discussed & overridden, then please ignore here too: partbounds.c: In function ‘get_qual_for_list.isra.18’: partbounds.c:4284:29: warning: ‘boundinfo’ may

Re: Multi-Column List Partitioning

2021-12-06 Thread Amul Sul
On Mon, Dec 6, 2021 at 7:27 PM Nitin Jadhav wrote: > > Thank you for reviewing the patch. > > > partbounds.c: In function ‘get_qual_for_list.isra.18’: > > partbounds.c:4284:29: warning: ‘boundinfo’ may be used uninitialized > > in this function [-Wmaybe-uninitialized] > > datumCopy(bound_i

Re: Multi-Column List Partitioning

2021-12-08 Thread Amul Sul
On Thu, Dec 9, 2021 at 11:24 AM Amit Langote wrote: > [] > On Mon, Dec 6, 2021 at 10:57 PM Nitin Jadhav > wrote: > > > Looks difficult to understand at first glance, how about the following: > > > > > > if (b1->isnulls != b2->isnulls) > > >return false; > > I don't think having this block

Re: Multi-Column List Partitioning

2021-12-08 Thread Amul Sul
On Thu, Dec 9, 2021 at 12:03 PM Amit Langote wrote: > > On Thu, Dec 9, 2021 at 3:12 PM Amul Sul wrote: > > On Thu, Dec 9, 2021 at 11:24 AM Amit Langote > > wrote: > > > > > [] > > > On Mon, Dec 6, 2021 at 10:57 PM Nitin Jadhav > > > wrot

Re: Multi-Column List Partitioning

2021-12-09 Thread Amul Sul
On Thu, Dec 9, 2021 at 12:43 PM Amul Sul wrote: > > On Thu, Dec 9, 2021 at 12:03 PM Amit Langote wrote: > > > > On Thu, Dec 9, 2021 at 3:12 PM Amul Sul wrote: > > > On Thu, Dec 9, 2021 at 11:24 AM Amit Langote > > > wrote: > > > > > >

Re: Multi-Column List Partitioning

2021-12-23 Thread Amul Sul
On Tue, Dec 21, 2021 at 6:34 PM Nitin Jadhav wrote: > > --- > > > + if (isnulls && isnulls[i]) > > + cmpval = 0; /* NULL "=" NULL */ > > + else > > + cmpval = 1; /* NULL ">" not-NULL */ > > + } > > + else if (isnulls && isnulls[i]

Re: generalized conveyor belt storage

2021-12-29 Thread Amul Sul
On Wed, Dec 15, 2021 at 9:04 PM Robert Haas wrote: > > On Wed, Dec 15, 2021 at 10:03 AM Matthias van de Meent > wrote: > [...] Thought patch is WIP, here are a few comments that I found while reading the patch and thought might help: + { + if (meta->cbm_oldest_index_segment == +

Re: Multi-Column List Partitioning

2022-01-02 Thread Amul Sul
On Wed, Dec 29, 2021 at 7:26 PM Nitin Jadhav wrote: > > > > -* For range partitioning, we must only perform pruning with values > > -* for either all partition keys or a prefix thereof. > > +* For range partitioning and list partitioning, we must only > > perform > > +

Re: O(n) tasks cause lengthy startups and checkpoints

2022-01-02 Thread Amul Sul
On Mon, Jan 3, 2022 at 2:56 AM Andres Freund wrote: > > Hi, > > On 2021-12-14 20:23:57 +, Bossart, Nathan wrote: > > As promised, here is v2. This patch set includes handling for all > > four tasks noted upthread. I'd still consider this a work-in- > > progress, as I've done minimal testing.

Re: generic plans and "initial" pruning

2022-01-05 Thread Amul Sul
On Fri, Dec 31, 2021 at 7:56 AM Amit Langote wrote: > > On Tue, Dec 28, 2021 at 22:12 Ashutosh Bapat > wrote: >> >> On Sat, Dec 25, 2021 at 9:06 AM Amit Langote wrote: >> > >> > Executing generic plans involving partitions is known to become slower >> > as partition count grows due to a number

Re: TAP test to cover "EndOfLogTLI != replayTLI" case

2022-01-09 Thread Amul Sul
On Mon, Jan 10, 2022 at 8:25 AM Andres Freund wrote: > > Hi, > > On 2021-11-23 11:43:21 +0530, Amul Sul wrote: > > Attached patch covers a case where TLI in the filename for a > > record being read is different from where it belongs to. In other > > words, it

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-22 Thread Amul Sul
In heapam_relation_copy_for_cluster(), begin_heap_rewrite() sets rwstate->rs_new_rel->rd_smgr correctly but next line tuplesort_begin_cluster() get called which cause the system cache invalidation and due to CCA setting, wipe out rwstate->rs_new_rel->rd_smgr which wasn't restored for the subsequent

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-22 Thread Amul Sul
On Mon, Mar 22, 2021 at 3:03 PM Amit Langote wrote: > > On Mon, Mar 22, 2021 at 5:26 PM Amul Sul wrote: > > In heapam_relation_copy_for_cluster(), begin_heap_rewrite() sets > > rwstate->rs_new_rel->rd_smgr correctly but next line > > tuplesort_begin_cluster()

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-23 Thread Amul Sul
On Tue, Mar 23, 2021 at 8:59 PM Tom Lane wrote: > > I wrote: > > Michael Paquier writes: > >> One bisect later, the winner is: > >> commit: 3d351d916b20534f973eda760cde17d96545d4c4 > >> author: Tom Lane > >> date: Sun, 30 Aug 2020 12:21:51 -0400 > >> Redefine pg_class.reltuples to be -1 before t

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-24 Thread Amul Sul
On Wed, Mar 24, 2021 at 8:09 PM Tom Lane wrote: > > Amul Sul writes: > > On Tue, Mar 23, 2021 at 8:59 PM Tom Lane wrote: > >> On closer inspection, I believe the true culprit is c6b92041d, > >> which did this: > >> - heap_sync(state->rs_ne

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-25 Thread Amul Sul
On Thu, Mar 25, 2021 at 12:10 PM Kyotaro Horiguchi wrote: > > Sorry for the bug. > > At Thu, 25 Mar 2021 01:50:29 -0400, Tom Lane wrote in > > Amul Sul writes: > > > On Wed, Mar 24, 2021 at 8:09 PM Tom Lane wrote: > > >> static inline struct SMgrRelatio

Re: CREATE SEQUENCE with RESTART option

2021-04-07 Thread Amul Sul
On Wed, Apr 7, 2021 at 6:52 PM Bharath Rupireddy wrote: > > On Wed, Apr 7, 2021 at 6:04 PM Ashutosh Bapat > wrote: > > At best CREATE SEQUENCE START ... RESTART ... can be a shorthand > > for CREATE SEQUENCE ... START; ALTER SEQUENCE ... RESTART run back to > > back. So it looks useful but i

Re: Avoid unnecessary table open/close for TRUNCATE foo, foo, foo; kind of commands

2021-04-09 Thread Amul Sul
On Fri, Apr 9, 2021 at 8:51 PM Bharath Rupireddy wrote: > > Hi, > > While checking the ExecuteTruncate code for the FOREIGN TRUNCATE > feature, I saw that we filter out the duplicate relations specified in > the TRUNCATE command. But before skipping the duplicates, we are just > opening the relati

Re: Avoid unnecessary table open/close for TRUNCATE foo, foo, foo; kind of commands

2021-04-09 Thread Amul Sul
On Fri, Apr 9, 2021 at 9:23 PM Fujii Masao wrote: > > > > On 2021/04/10 0:39, Amul Sul wrote: > > On Fri, Apr 9, 2021 at 8:51 PM Bharath Rupireddy > > wrote: > >> > >> Hi, > >> > >> While checking the ExecuteTruncate code for the

Re: new heapcheck contrib module

2020-07-20 Thread Amul Sul
Hi Mark, I think new structures should be listed in src/tools/pgindent/typedefs.list, otherwise, pgindent might disturb its indentation. Regards, Amul On Tue, Jul 21, 2020 at 2:32 AM Mark Dilger wrote: > > > > > On Jul 16, 2020, at 12:38 PM, Robert Haas wrote: > > > > On Mon, Jul 6, 2020 at 2

Re: new heapcheck contrib module

2020-07-20 Thread Amul Sul
On Tue, Jul 21, 2020 at 10:58 AM Amul Sul wrote: > > Hi Mark, > > I think new structures should be listed in src/tools/pgindent/typedefs.list, > otherwise, pgindent might disturb its indentation. > > Regards, > Amul > > > On Tue, Jul 21, 2020 at 2:32 AM Mark Dilg

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-23 Thread Amul Sul
On Thu, Jul 23, 2020 at 3:33 AM Soumyadeep Chakraborty wrote: > > Hello, > > I think we should really term this feature, as it stands, as a means to > solely stop WAL writes from happening. > True. > The feature doesn't truly make the system read-only (e.g. dirty buffer > flushes may succeed the

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-23 Thread Amul Sul
On Thu, Jul 23, 2020 at 4:34 AM SATYANARAYANA NARLAPURAM wrote: > > +1 to this feature and I have been thinking about it for sometime. There are > several use cases with marking database read only (no transaction log > generation). Some of the examples in a hosted service scenario are 1/ when >

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-23 Thread Amul Sul
On Thu, Jul 23, 2020 at 6:08 AM Soumyadeep Chakraborty wrote: > > Hi Amul, > Thanks, Soumyadeep for looking and putting your thoughts on the patch. > On Tue, Jun 16, 2020 at 6:56 AM amul sul wrote: > > The proposed feature is built atop of super barrier mechanism commit[1]

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-23 Thread Amul Sul
On Fri, Jul 24, 2020 at 6:28 AM Soumyadeep Chakraborty < soumyadeep2...@gmail.com> wrote: > > On Thu, Jun 18, 2020 at 7:54 AM Robert Haas wrote: > > I think we'd want the FIRST write operation to be the end-of-recovery > > checkpoint, before the system is fully read-write. And then after that > >

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-24 Thread Amul Sul
On Fri, Jul 24, 2020 at 7:34 AM Andres Freund wrote: > > Hi, Thanks for looking at the patch. > > > From f0188a48723b1ae7372bcc6a344ed7868fdc40fb Mon Sep 17 00:00:00 2001 > > From: Amul Sul > > Date: Fri, 27 Mar 2020 05:05:38 -0400 > > Subject: [PATCH v3 2/6]

Re: new heapcheck contrib module

2020-07-26 Thread Amul Sul
On Tue, Jul 21, 2020 at 2:32 AM Mark Dilger wrote: > [] > > > > + StaticAssertStmt(InvalidOffsetNumber + 1 == > > FirstOffsetNumber, > > +"InvalidOffsetNumber > > increments to FirstOffsetNumber"); > > > > If you are going to rely

Re: [Patch] ALTER SYSTEM READ ONLY

2020-07-29 Thread Amul Sul
On Fri, Jul 24, 2020 at 10:40 PM Soumyadeep Chakraborty < soumyadeep2...@gmail.com> wrote: > On Thu, Jul 23, 2020 at 10:14 PM Amul Sul wrote: > > > > On Fri, Jul 24, 2020 at 6:28 AM Soumyadeep Chakraborty < > soumyadeep2...@gmail.com> wrote: > > > In case

Re: new heapcheck contrib module

2020-08-16 Thread Amul Sul
On Thu, Jul 30, 2020 at 11:29 PM Robert Haas wrote: > > On Mon, Jul 27, 2020 at 1:02 PM Mark Dilger > wrote: > > Not at all! I appreciate all the reviews. > > Reviewing 0002, reading through verify_heapam.c: > > +typedef enum SkipPages > +{ > + SKIP_ALL_FROZEN_PAGES, > + SKIP_ALL_VISIBLE_PAGES,

Re: new heapcheck contrib module

2020-08-20 Thread Amul Sul
On Thu, Aug 20, 2020 at 8:00 AM Mark Dilger wrote: > > > > > On Aug 16, 2020, at 9:37 PM, Amul Sul wrote: > > > > In addition to this, I found a few more things while reading v13 patch are > > as > > below: > > > > Patch v13-0001: > > >

Re: new heapcheck contrib module

2020-08-24 Thread Amul Sul
ffer(querybuf, + "SELECT public.bt_index_parent_check('%s'::regclass, %s, %s)", + idxoid, + settings.heapallindexed ? "true" : "false", + settings.rootdescend ? "true" : "false"); The assumption that the amcheck extension will be a

Re: Asymmetric partition-wise JOIN

2020-08-26 Thread Amul Sul
On Sat, Aug 24, 2019 at 2:03 PM Kohei KaiGai wrote: > > 2019年8月24日(土) 7:02 Thomas Munro : > > > > On Fri, Aug 23, 2019 at 4:05 AM Kohei KaiGai wrote: > > > We can consider the table join ptable X t1 above is equivalent to: > > > (ptable_p0 + ptable_p1 + ptable_p2) X t1 > > > = (ptable_p0 X t1)

Re: [Patch] ALTER SYSTEM READ ONLY

2021-10-12 Thread Amul Sul
On Thu, Oct 7, 2021 at 6:21 PM Amul Sul wrote: > > On Thu, Oct 7, 2021 at 5:56 AM Jaime Casanova > wrote: > > > > On Tue, Oct 05, 2021 at 04:11:58PM +0530, Amul Sul wrote: > > >On Mon, Oct 4, 2021 at 1:57 PM Rushabh Lathia > > > wrote: > >

Re: prevent immature WAL streaming

2021-10-12 Thread Amul Sul
Hi, On Thu, Oct 7, 2021 at 6:57 PM Alvaro Herrera wrote: > > On 2021-Oct-07, Amul Sul wrote: > > > Make sense, thanks for the explanation. > > You're welcome. Also, I forgot: thank you for taking the time to review > the code. Much appreciated. :) > > I ha

Re: when the startup process doesn't (logging startup delays)

2021-10-13 Thread Amul Sul
On Wed, Sep 29, 2021 at 11:10 PM Robert Haas wrote: > > On Wed, Sep 29, 2021 at 10:08 AM Nitin Jadhav > wrote: > > Sorry. There was a misunderstanding about this and for the patch > > shared on September 27th, I had tested for the value '0' and observed > > that no progress messages were getting

Re: prevent immature WAL streaming

2021-10-14 Thread Amul Sul
On Wed, Oct 13, 2021 at 10:58 PM Alvaro Herrera wrote: > > On 2021-Oct-13, Amul Sul wrote: > > > I have one more question, regarding the need for other global > > variables i.e. abortedRecPtr. (Sorry for coming back after so long.) > > > > Instead of abortedRe

Re: using an end-of-recovery record in all cases

2021-10-17 Thread Amul Sul
On Wed, Oct 6, 2021 at 7:24 PM Amul Sul wrote: > > On Tue, Oct 5, 2021 at 10:42 PM Robert Haas wrote: > > > > On Tue, Oct 5, 2021 at 12:41 PM Amul Sul wrote: > > > No, InRecovery flag get cleared before this point. I think, we can use > > > lastReplayed

Re: [Patch] ALTER SYSTEM READ ONLY

2021-10-18 Thread Amul Sul
On Thu, Oct 14, 2021 at 11:10 PM Robert Haas wrote: > > On Tue, Oct 12, 2021 at 8:18 AM Amul Sul wrote: > > In the attached version I have fixed this issue by restoring > > missingContrecPtr. > > > > To handle abortedRecPtr and missingContrecPtr newly added gl

Re: prevent immature WAL streaming

2021-10-22 Thread Amul Sul
On Thu, Oct 14, 2021 at 6:14 PM Amul Sul wrote: > > On Wed, Oct 13, 2021 at 10:58 PM Alvaro Herrera > wrote: > > > > On 2021-Oct-13, Amul Sul wrote: > > > > > I have one more question, regarding the need for other global > > > variables i.e. aborted

Re: prevent immature WAL streaming

2021-10-24 Thread Amul Sul
On Mon, Oct 25, 2021 at 7:02 AM Kyotaro Horiguchi wrote: > > At Fri, 22 Oct 2021 18:43:52 +0530, Amul Sul wrote in > > Any thoughts about the patch posted previously? > > Honestly, xlogreader looks fine with the current shape. The reason is > that it seems cleaner as an int

Re: [Patch] ALTER SYSTEM READ ONLY

2021-10-25 Thread Amul Sul
On Tue, Oct 19, 2021 at 3:50 AM Robert Haas wrote: > > On Mon, Oct 18, 2021 at 9:54 AM Amul Sul wrote: > > I tried this in the attached version, but I'm a bit skeptical with > > changes that are needed for CreateCheckPoint(), those don't seem to be > > clean. &g

Re: TAP test for recovery_end_command

2021-10-25 Thread Amul Sul
On Wed, Oct 20, 2021 at 11:09 AM Michael Paquier wrote: > > On Wed, Oct 06, 2021 at 06:49:10PM +0530, Amul Sul wrote: > > Thanks for the suggestion, added the same in the attached version. > > Hmm. The run-time of 020_archive_status.p bumps from 4.7s to 5.8s on > my lap

Re: [Patch] ALTER SYSTEM READ ONLY

2021-10-26 Thread Amul Sul
On Mon, Oct 25, 2021 at 8:15 PM Robert Haas wrote: > > On Mon, Oct 25, 2021 at 3:05 AM Amul Sul wrote: > > Ok, did the same in the attached 0001 patch. > > > > There is no harm in calling LocalSetXLogInsertAllowed() calling > > multiple times, but the problem I c

Re: TAP test for recovery_end_command

2021-10-26 Thread Amul Sul
On Wed, Oct 27, 2021 at 9:37 AM Michael Paquier wrote: > > On Mon, Oct 25, 2021 at 02:42:28PM +0530, Amul Sul wrote: > > Understood, moved tests to 002_archiving.pl in the attached version. > > Thanks for the new patch. I have reviewed its contents, and there > were a

Re: TAP test for recovery_end_command

2021-10-27 Thread Amul Sul
On Thu, Oct 28, 2021 at 7:24 AM Michael Paquier wrote: > > On Wed, Oct 27, 2021 at 02:20:50PM +0900, Michael Paquier wrote: > > ok(!-f $recovery_end_command_file, > > - 'recovery_end_command executed after promotion'); > > + 'recovery_end_command not executed yet'); > > Indeed :p > > While lo

Re: inefficient loop in StandbyReleaseLockList()

2021-10-27 Thread Amul Sul
On Thu, Oct 28, 2021 at 9:07 AM Bossart, Nathan wrote: > > Hi hackers, > > I've seen a few cases now for v13 where the startup process on a > standby appears to be stuck on StandbyReleaseLockList(). It looks > like most of the time is spent on list_delete_first(). I believe this > is related to

Correct error message for end-of-recovery record TLI

2021-10-28 Thread Amul Sul
Hi, In xlog_redo, for end-of-recovery case error message describes the record as a checkpoint record which seems to be incorrect; the attached patch corrects that. -- Regards, Amul Sul EDB: http://www.enterprisedb.com diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam

Re: Correct error message for end-of-recovery record TLI

2021-10-28 Thread Amul Sul
On Fri, Oct 29, 2021 at 2:36 AM Robert Haas wrote: > > On Thu, Oct 28, 2021 at 3:52 PM Bossart, Nathan wrote: > > When I apply the patch, it changes the PANIC message in the > > XLOG_CHECKPOINT_ONLINE section, not the XLOG_END_OF_RECOVERY one. > > Well that's a good point. *facepalm* > Oops... :

Re: removing global variable ThisTimeLineID

2021-11-03 Thread Amul Sul
On Tue, Nov 2, 2021 at 12:46 AM Robert Haas wrote: > > [...] > I would like to clean this up. Attached is a series of patches which > try to do that. For ease of review, this is separated out into quite a > few separate patches, but most likely we'd combine some of them for > commit. Patches 0001

Unnecessary global variable declared in xlog.c

2021-11-15 Thread Amul Sul
Hi, The attached patch moves the "LastRec" variable declaration inside StartupXLOG() where it is supposed to be. -- Regards, Amul Sul EDB: http://www.enterprisedb.com remove_global_declaration.patch Description: Binary data

Re: Unnecessary global variable declared in xlog.c

2021-11-16 Thread Amul Sul
On Wed, Nov 17, 2021 at 7:36 AM Michael Paquier wrote: > > On Tue, Nov 16, 2021 at 02:08:54AM -0500, Tom Lane wrote: > > I think LastRec was originally referenced by multiple functions > > in xlog.c. But it does look like it could be a local now. > > Thanks for double-checking, applied this one a

Re: [Patch] ALTER SYSTEM READ ONLY

2021-11-16 Thread Amul Sul
On Sat, Nov 13, 2021 at 2:18 AM Robert Haas wrote: > > On Mon, Nov 8, 2021 at 8:20 AM Amul Sul wrote: > > Attached is the rebased version of refactoring as well as the > > pg_prohibit_wal feature patches for the latest master head (commit # > > 39a3105678a). > &g

Re: [Patch] ALTER SYSTEM READ ONLY

2021-11-17 Thread Amul Sul
On Wed, Nov 17, 2021 at 11:13 AM Amul Sul wrote: > > On Sat, Nov 13, 2021 at 2:18 AM Robert Haas wrote: > > > > On Mon, Nov 8, 2021 at 8:20 AM Amul Sul wrote: > > > Attached is the rebased version of refactoring as well as the > > > pg_prohibit_wal featur

Re: [Patch] ALTER SYSTEM READ ONLY

2021-11-17 Thread Amul Sul
On Wed, Nov 17, 2021 at 4:07 PM Amul Sul wrote: > > On Wed, Nov 17, 2021 at 11:13 AM Amul Sul wrote: > > > > On Sat, Nov 13, 2021 at 2:18 AM Robert Haas wrote: > > > > > > On Mon, Nov 8, 2021 at 8:20 AM Amul Sul wrote: > > > > Attached is t

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-18 Thread Amul Sul
On Thu, Nov 18, 2021 at 3:31 AM Robert Haas wrote: > > I spent a lot of time trying to figure out why xlog.c has global > variables ReadRecPtr and EndRecPtr instead of just relying on the > eponymous structure members inside the XLogReaderState. I concluded > that the values are the same at most p

Re: Should rename "startup process" to something else?

2021-11-18 Thread Amul Sul
On Thu, Nov 18, 2021 at 6:06 PM Andrey Borodin wrote: > > > > > 15 нояб. 2021 г., в 19:32, Rushabh Lathia > > написал(а): > > > > Open for suggestions and thoughts. > > > How about walapplier ? > Similar to walsender, walreciver.. > Or maybe walreplayer ? Regards, Amul

Re: xlog.c: removing ReadRecPtr and EndRecPtr

2021-11-21 Thread Amul Sul
On Fri, Nov 19, 2021 at 12:43 AM Robert Haas wrote: > > On Thu, Nov 18, 2021 at 7:30 AM Amul Sul wrote: > > Somehow with and without patch I am getting the same log. > > Try applying the attached 0001-dubious-test-cast.patch for you and see > if that fails. It does fo

TAP test to cover "EndOfLogTLI != replayTLI" case

2021-11-22 Thread Amul Sul
s a case where recovery_target_lsn and recovery_target_inclusive=off which doesn't exist as of now and that is the reason I have added this test to 003_recovery_targets.pl file. Thoughts? Suggestions? -- Regards, Amul Sul EDB: http://www.enterprisedb.com From 4e2bbb37d4874c910494ba221c7be7e02a2

Re: [Patch] ALTER SYSTEM READ ONLY

2021-11-23 Thread Amul Sul
On Wed, Nov 17, 2021 at 6:20 PM Amul Sul wrote: > > On Wed, Nov 17, 2021 at 4:07 PM Amul Sul wrote: > > > > On Wed, Nov 17, 2021 at 11:13 AM Amul Sul wrote: > > > > > > On Sat, Nov 13, 2021 at 2:18 AM Robert Haas wrote: > > > > > &

Re: Deduplicate code updating ControleFile's DBState.

2021-11-24 Thread Amul Sul
On Thu, Nov 11, 2021 at 1:30 AM Bossart, Nathan wrote: > > On 10/1/21, 10:40 PM, "Michael Paquier" wrote: > > On Fri, Oct 01, 2021 at 05:47:45PM +, Bossart, Nathan wrote: > >> I'm inclined to agree that anything that calls update_controlfile() > >> should update the timestamp. > > > > pg_cont

Re: prevent immature WAL streaming

2021-11-24 Thread Amul Sul
On Wed, Nov 24, 2021 at 2:10 AM Alvaro Herrera wrote: > > On 2021-Nov-23, Tom Lane wrote: > > > We're *still* not out of the woods with 026_overwrite_contrecord.pl, > > as we are continuing to see occasional "mismatching overwritten LSN" > > failures, further down in the test where it tries to sta

Re: prevent immature WAL streaming

2021-11-25 Thread Amul Sul
On Fri, Nov 26, 2021 at 1:42 AM Tom Lane wrote: > > Alvaro Herrera writes: > > On 2021-Nov-25, Tom Lane wrote: > >> Really? AFAICS the WAL record contains the correct value, or at least > >> we should define that one as being correct, for precisely this reason. > > > I don't know what is the cor

Re: Deduplicate code updating ControleFile's DBState.

2021-11-26 Thread Amul Sul
ControlFile() is fine, on the contrary. My bad, sorry for the sloppy change, corrected it in the attached version. Regards, Amul From a2c385f6a6152dbba1e33149f1d7f102243ed0cd Mon Sep 17 00:00:00 2001 From: Amul Sul Date: Thu, 23 Sep 2021 00:47:52 -0400 Subject: [PATCH v6] Do the Control

Re: Deduplicate code updating ControleFile's DBState.

2021-11-28 Thread Amul Sul
On Mon, Nov 29, 2021 at 10:12 AM Michael Paquier wrote: > > On Mon, Nov 29, 2021 at 09:28:23AM +0530, Bharath Rupireddy wrote: > > In that case, why can't we inline UpdateControlFile to avoid the > > function call cost? Do you see any issues with it? > > This routine is IMO not something worth bot

tweak to a few index tests to hits ambuildempty() routine.

2021-11-28 Thread Amul Sul
Hi, Attached patch is doing small changes to brin, gin & gist index tests to use an unlogged table without changing the original intention of those tests and that is able to hit ambuildempty() routing which is otherwise not reachable by the current tests. -- Regards, Amul Sul EDB:

Update stale code comment in CheckpointerMain()

2021-11-29 Thread Amul Sul
Hi, The attached patch updates the code comment which is no longer true after commit # 4a92a1c3d1c361ffb031ed05bf65b801241d7cdd -- Regards, Amul Sul EDB: http://www.enterprisedb.com diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index be7366379d0

Re: Update stale code comment in CheckpointerMain()

2021-11-30 Thread Amul Sul
On Tue, Nov 30, 2021 at 3:09 PM Daniel Gustafsson wrote: > > > On 30 Nov 2021, at 08:00, Amul Sul wrote: > > > The attached patch updates the code comment which is no longer true > > after commit # 4a92a1c3d1c361ffb031ed05bf65b801241d7cdd > > Agreed, but looking a

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-05 Thread amul sul
On Thu, Apr 5, 2018 at 10:17 AM, Amit Kapila wrote: > On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund wrote: >> [...] >> >> Questions: >> >> - I'm not perfectly happy with >> "tuple to be locked was already moved to another partition due to >> concurrent update" >> as the error message. If som

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-06 Thread amul sul
On Fri, Apr 6, 2018 at 12:07 PM, amul sul wrote: > On Thu, Apr 5, 2018 at 10:17 AM, Amit Kapila wrote: >> On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund wrote: >>> > [...] >>> >>> Questions: >>> >>> - I'm not perfectly happy with &g

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-06 Thread amul sul
On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund wrote: > Hi, > > On 2018-04-02 11:26:38 -0400, Robert Haas wrote: >> On Wed, Mar 28, 2018 at 2:12 PM, Andres Freund wrote: [] > I've attached a noticeably editorialized patch: > > - I'm uncomfortable with the "moved" information not being crash-sa

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-06 Thread amul sul
On Fri, Apr 6, 2018 at 1:19 PM, Amit Kapila wrote: > On Fri, Apr 6, 2018 at 12:50 PM, amul sul wrote: >> >> Updated patch attached. >> > > + if (ItemPointerIndicatesMovedPartitions(&hufd.ctid)) > + ereport(ERROR, > + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQU

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-07 Thread amul sul
On Sat, Apr 7, 2018 at 9:08 AM, Andres Freund wrote: > Hi Tom, All, > > On 2018-04-06 14:19:02 +0530, amul sul wrote: >> Thanks for the reminder -- fixed in the attached version. > > Tom, this seems to be the best approach for fixing the visibility issues > around this. I&

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-04-08 Thread amul sul
On Sun, Apr 8, 2018 at 2:04 AM, Andres Freund wrote: > On 2018-04-07 20:13:36 +0530, amul sul wrote: >> Attached is the patch does the renaming of this tests -- need to apply >> to the top of v10 patch[1]. > > These indeed are a bit too long, so I went with the numbers. I&

Re: wal_consistency_checking reports an inconsistency on master branch

2018-04-12 Thread amul sul
Will look into this, thanks. Regards, Amul Sent from a mobile device. Please excuse brevity and tpyos. On Fri, Apr 13, 2018, 9:06 AM Andres Freund wrote: > On 2018-04-13 12:29:21 +0900, Amit Lan

Re: wal_consistency_checking reports an inconsistency on master branch

2018-04-13 Thread amul sul
On Fri, Apr 13, 2018 at 9:06 AM, Andres Freund wrote: > On 2018-04-13 12:29:21 +0900, Amit Langote wrote: >> On 2018/04/13 7:36, Peter Geoghegan wrote: >> > On Thu, Apr 12, 2018 at 11:47 AM, Peter Geoghegan wrote: >> >> In short, it looks like the tests added to update.sql by commit >> >> 2f17844

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-09-04 Thread amul sul
On Wed, Sep 4, 2019 at 2:40 AM Alvaro Herrera wrote: > Fujita-san, amul, > > CFbot complains that Fujita-san submitted a patch that doesn't apply, > which makes sense since the necessary previous patch was only referred > to without being resubmitted. I suggest to always post all patches > toget

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-10-25 Thread amul sul
he join, s/inner side/outer side -- Regards, Amul 1] https://postgr.es/m/CAPmGK145V8DNCNQ2gQBgNE3QqoJGjsmK5WMwaA3FMirNM723KQ%40mail.gmail.com From c7f165b575fd984ca3053ce7162bdd8e4bf56be8 Mon Sep 17 00:00:00 2001 From: Amul Sul Date: Thu, 24 Oct 2019 05:38:11 -0400 Subject: [PATCH] delta Changes : 1. Call process_outer_partition & proc

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-03-06 Thread amul sul
Thanks Rajkumar, I am looking into this. Regards, Amul On Thu, Mar 7, 2019 at 11:54 AM Rajkumar Raghuwanshi < rajkumar.raghuwan...@enterprisedb.com> wrote: > > > On Tue, Mar 5, 2019 at 3:45 PM amul sul wrote: > >> Attached is the rebased atop of the latest master head(

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-03-10 Thread amul sul
On Mon, Mar 11, 2019 at 8:29 AM Ashutosh Bapat wrote: > On Thu, Mar 7, 2019 at 8:20 PM amul sul wrote: > >> >> >> On Thu, Mar 7, 2019 at 1:02 PM amul sul wrote: >> >>> Thanks Rajkumar, >>> >>> I am looking into this. >&g

Re: Some memory not freed at the exit of RelationBuildPartitionDesc()

2019-08-08 Thread amul sul
On Thu, Aug 8, 2019 at 1:27 PM Amit Langote wrote: > Hi Amul, > > On Thu, Aug 8, 2019 at 4:15 PM amul sul wrote: > > > > Hi, > > > > In RelationBuildPartitionDesc(), a memory space that use to gather > partitioning > > bound info wasn't free at

Re: Some memory not freed at the exit of RelationBuildPartitionDesc()

2019-08-13 Thread amul sul
On Sat, Aug 10, 2019 at 12:16 AM David Fetter wrote: > On Thu, Aug 08, 2019 at 05:42:21PM +0900, Amit Langote wrote: > > On Thu, Aug 8, 2019 at 5:33 PM amul sul wrote: > > > On Thu, Aug 8, 2019 at 1:27 PM Amit Langote > wrote: > > > > >> Thanks for the

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-08-28 Thread amul sul
Thank you Fujita San for the enhancement, will have a look. Regards, Amul On Wed, Aug 28, 2019 at 3:52 PM Etsuro Fujita wrote: > On Fri, Aug 16, 2019 at 10:25 PM Etsuro Fujita > wrote: > > It seems that I performed the above tests on an assertion-enabled > > build. :( So I executed the tests

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-09-01 Thread amul sul
Hi Fujita San, Please find my comments inline below: On Wed, Aug 28, 2019 at 3:52 PM Etsuro Fujita wrote: > On Fri, Aug 16, 2019 at 10:25 PM Etsuro Fujita > wrote: > > [... skipped ..] > > About the attached: > > * The attached patch modified try_partitionwise_join() so that we call > parti

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-01-11 Thread amul sul
On Thu, Jan 11, 2018 at 8:06 PM, Stephen Frost wrote: > Amul, > > * amul sul (sula...@gmail.com) wrote: >> Agree, updated in the attached patch. Patch 0001 also includes your >> previous review comment[1] and typo correction suggested by Alvaro[2]. > > Looks like this

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-01-23 Thread amul sul
On Tue, Jan 23, 2018 at 7:01 PM, Amit Kapila wrote: > On Fri, Jan 12, 2018 at 11:43 AM, amul sul wrote: [] > I have asked to change the message "tuple to be updated .." after > heap_lock_tuple call not in nodeModifyTable.c, so please revert the > message in nodeModify

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-02-02 Thread amul sul
Hi Amit, Sorry for the delayed response. On Fri, Jan 26, 2018 at 11:58 AM, Amit Kapila wrote: > On Wed, Jan 24, 2018 at 12:44 PM, amul sul wrote: >> On Tue, Jan 23, 2018 at 7:01 PM, Amit Kapila wrote: >>> On Fri, Jan 12, 2018 at 11:43 AM, amul sul wrote: [] > I t

Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key

2018-02-06 Thread amul sul
On Sun, Feb 4, 2018 at 10:47 AM, Amit Kapila wrote: > On Fri, Feb 2, 2018 at 2:11 PM, amul sul wrote: >> On Fri, Jan 26, 2018 at 11:58 AM, Amit Kapila >> wrote: >> [] >>> I think you can manually (via debugger) hit this by using >>> PUBLICATION/SUBS

  1   2   3   4   >