Re: Replication & recovery_min_apply_delay

2020-03-16 Thread Asim R P
A key challenge here is how to determine the starting point for WAL receiver when the startup process starts it while still replaying WAL that's already received. Hao and I wrote a much faster and less intrusive solution to determine the starting point. Scan the first page of each WAL segment

Re: Replication & recovery_min_apply_delay

2020-01-27 Thread Asim R P
On Mon, Jan 27, 2020 at 5:11 PM Asim Rama Praveen wrote: > > The following review has been posted through the commitfest application: > make installcheck-world: not tested > Implements feature: not tested > Spec compliant: not tested > Documentation:not tested > > The

Re: Replication & recovery_min_apply_delay

2020-01-21 Thread Asim R P
Replay lag can build up naturally, even when recovery_min_apply_delay is not set, because WAL generation on master is concurrent and WAL replay on standby is performed by a single process. Hao and I have incorporated the new GUC from Konstantin's patch and used it to start WAL receiver in the

Re: Unnecessary delay in streaming replication due to replay lag

2020-01-17 Thread Asim R P
On Fri, Jan 17, 2020 at 11:08 AM Michael Paquier wrote: > > On Fri, Jan 17, 2020 at 09:34:05AM +0530, Asim R P wrote: > > > > 0001 - TAP test to demonstrate the problem. > > There is no real need for debug_replay_delay because we have already > recovery_min_apply_d

Unnecessary delay in streaming replication due to replay lag

2020-01-16 Thread Asim R P
Hi Standby does not start walreceiver process until startup process finishes WAL replay. The more WAL there is to replay, longer is the delay in starting streaming replication. If replication connection is temporarily disconnected, this delay becomes a major problem and we are proposing a

Re: Batch insert in CTAS/MatView code

2019-09-27 Thread Asim R P
On Thu, Sep 26, 2019 at 7:13 PM Alvaro Herrera wrote: > > On 2019-Sep-25, Asim R P wrote: > > > I reviewed your patch today. It looks good overall. My concern is that > > the ExecFetchSlotHeapTuple call does not seem appropriate. In a generic > > place such as cre

Re: Batch insert in CTAS/MatView code

2019-09-25 Thread Asim R P
On Mon, Sep 9, 2019 at 4:02 PM Paul Guo wrote: > > So in theory > we should not worry about additional tuple copy overhead now, and then I tried the patch without setting > multi-insert threshold as attached. > I reviewed your patch today. It looks good overall. My concern is that the

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-09-20 Thread Asim R P
On Thu, Sep 19, 2019 at 5:29 PM Asim R P wrote: > > In order to fix the test failures, we need to distinguish between a missing database directory and a missing tablespace directory. And also add logic to forget missing directories during tablespace drop. I am working on it. Pleas

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-09-19 Thread Asim R P
On Thu, Aug 22, 2019 at 6:44 PM Paul Guo wrote: > > Thanks. I updated the patch to v5. It passes install-check testing and recovery testing. > This patch contains one more bug, in addition to what Anastasia has found. If the test case in the patch is tweaked slightly, as follows, the standby

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-09-12 Thread Asim R P
On Thu, Sep 12, 2019 at 2:05 PM Kyotaro Horiguchi wrote: > > Hello. > > At Wed, 11 Sep 2019 17:26:44 +0300, Anastasia Lubennikova < a.lubennik...@postgrespro.ru> wrote in < a82a896b-93f0-c26c-b941-f56651313...@postgrespro.ru> > > 10.09.2019 14:42, Asim

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-09-10 Thread Asim R P
Hi Anastasia On Thu, Aug 22, 2019 at 9:43 PM Anastasia Lubennikova < a.lubennik...@postgrespro.ru> wrote: > > But during the review, I found a bug in the current implementation. > New behavior must apply to crash-recovery only, now it applies to archiveRecovery too. > That can cause a silent loss

Re: Fault injection framework

2019-09-06 Thread Asim R P
On Tue, Aug 27, 2019 at 6:57 PM Asim R P wrote: > > On Tue, Aug 27, 2019 at 12:35 PM Michael Paquier wrote: > > > > Things like exec_fault_injector_command() need to be more documented. > > It is hard to guess what it is being used for. > > Added a comment

Re: Cleanup isolation specs from unused steps

2019-08-27 Thread Asim R P
On Fri, Aug 23, 2019 at 9:08 PM Alvaro Herrera wrote: > > On 2019-Aug-23, Asim R P wrote: > > > As part of the fault injector patch set [1], I added a new "blocking" > > keyword to isolation grammar so that a step can be declared as blocking. > > See pa

Re: Fault injection framework

2019-08-27 Thread Asim R P
On Tue, Aug 27, 2019 at 12:35 PM Michael Paquier wrote: > > You may want to double-check whitespaces in your patch set, and 0002 > does not apply because of conflicts in isolationtester.h (my fault!). > I've rebased the patch set against the latest master and tried to resolve whitespace issues.

Re: Cleanup isolation specs from unused steps

2019-08-23 Thread Asim R P
On Thu, Aug 22, 2019 at 12:47 AM Alvaro Herrera wrote: > > On 2019-Aug-21, Melanie Plageman wrote: > > > In Greenplum, we mainly add new tests to a separate isolation > > framework (called isolation2) which uses a completely different > > syntax. It doesn't use isolationtester at all. So, I

Re: WIP/PoC for parallel backup

2019-08-23 Thread Asim R P
Hi Asif Interesting proposal. Bulk of the work in a backup is transferring files from source data directory to destination. Your patch is breaking this task down in multiple sets of files and transferring each set in parallel. This seems correct, however, your patch is also creating a new

Fault injection framework

2019-08-22 Thread Asim R P
Hello Fault injection was discussed a few months ago at PGCon in Ottawa. At least a few folks showed interest and so I would like to present what we have been using in Greenplum. The attached patch set contains the fault injector framework ported to PostgreSQL master. It provides ability to

Re: ERROR after writing PREPARE WAL record

2019-07-17 Thread Asim R P
On Wed, Jul 17, 2019 at 7:08 PM Tom Lane wrote: > > Asim R P writes: > > Cancel/terminate requests are held off during "PREPARE TRANSACTION" > > processing in function PrepareTransaction(). However, a subroutine invoked > > by PrepareTransaction() may

ERROR after writing PREPARE WAL record

2019-07-17 Thread Asim R P
Hello Cancel/terminate requests are held off during "PREPARE TRANSACTION" processing in function PrepareTransaction(). However, a subroutine invoked by PrepareTransaction() may perform elog(ERROR) or elog(FATAL). And if that happens after PREPARE WAL record is written and before transaction

Re: POC: Cleaning up orphaned files using undo logs

2019-06-10 Thread Asim R P
My understanding is smgr pendingDeletes infrastructure will be replaced by these patches. I still see CommitTransaction() calling smgrDoPendingDeletes() in the latest patch set. Am I missing something? Asim

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-04-18 Thread Asim R P
On Wed, Apr 17, 2019 at 1:27 PM Paul Guo wrote: > > create db with tablespace > drop database > drop tablespace. Essentially, that sequence of operations causes crash recovery to fail if the "drop tablespace" transaction was committed before crashing. This is a bug in crash recovery in general

Re: Pluggable Storage - Andres's take

2018-11-21 Thread Asim R P
Ashwin (copied) and I got a chance to go through the latest code from Andres' github repository. We would like to share some comments/quesitons: The TupleTableSlot argument is well suited for row-oriented storage. For a column-oriented storage engine, a projection list indicating the columns to

Re: Catalog corruption

2018-08-28 Thread Asim R P
On Tue, Aug 28, 2018 at 7:36 AM, Mariel Cherkassky wrote: > Afterwards I vacuumed all the databases but nothing helped. I tried to > reindex the databases but I got the next error : > > 2018-08-28 21:50:03 +08 db2 24360 ERROR: could not access status of > transaction 32212695 > 2018-08-28

Re: Postgres, fsync, and OSs (specifically linux)

2018-08-14 Thread Asim R P
I was looking at the commitfest entry for feature (https://commitfest.postgresql.org/19/1639/) for the most recent list of patches to try out. The list doesn't look correct/complete. Can someone please check? Asim

Re: Shared buffer access rule violations?

2018-08-08 Thread Asim R P
On Tue, Aug 7, 2018 at 7:00 PM, Peter Geoghegan wrote: > > I wonder if it would be a better idea to enable Valgrind's memcheck to > mark buffers as read-only or read-write. We've considered doing > something like that for years, but for whatever reason nobody followed > through. Basic question:

Re: Shared buffer access rule violations?

2018-08-07 Thread Asim R P
compile time flag. Asim From ed7dcf633600b3a527ed52ffacd1b779da8b0235 Mon Sep 17 00:00:00 2001 From: Asim R P Date: Wed, 18 Jul 2018 18:32:40 -0700 Subject: [PATCH 1/2] Facility to detect shared buffer access violations Using mprotect() to allow/disallow read/write access to one or more shared

Re: [HACKERS] possible self-deadlock window after bad ProcessStartupPacket

2018-07-18 Thread Asim R P
On Thu, Jun 22, 2017 at 10:50 AM, Andres Freund wrote: > > Or, probably more robust: Simply _exit(2) without further ado, and rely > on postmaster to output an appropriate error message. Arguably it's not > actually useful to see hundreds of "WARNING: terminating connection because of > crash of

Re: Shared buffer access rule violations?

2018-07-11 Thread Asim R P
On Tue, Jul 10, 2018 at 8:33 PM, Tom Lane wrote: > Asim R P writes: > >> One can find several PageInit() calls with no content lock held. See, >> for example: > >> fill_seq_with_data() > > That would be for a relation that no one else can even see yet, no?

Shared buffer access rule violations?

2018-07-10 Thread Asim R P
Hi, In order to make changes to a shared buffer, one must hold a pin on it and the content lock in exclusive mode. This rule seems to be followed in most of the places but there are a few exceptions. One can find several PageInit() calls with no content lock held. See, for example:

Column store in Greenplum

2018-06-07 Thread Asim R P
Hi, In the pluggable storage unconference session in Ottawa, column oriented storage was a key point of discussion. We would like to share an overview of Greenplum's column store. We hope that this will aid a discussion to carve out a pluggable storage interface. This is just an overview,