Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-18 Thread Michael Paquier
On Tue, Dec 19, 2017 at 5:11 AM, Masahiko Sawada wrote: > On Tue, Dec 19, 2017 at 3:52 AM, Fujii Masao wrote: >> Committed. Thanks! > > Thank you! Thanks all. I can see that I have been credited as author as well, though it seems to me that I played mainly a reviewer role. -- Michael

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-18 Thread Masahiko Sawada
On Tue, Dec 19, 2017 at 3:52 AM, Fujii Masao wrote: > On Fri, Dec 15, 2017 at 9:51 AM, Masahiko Sawada > wrote: >> On Fri, Dec 15, 2017 at 6:46 AM, Michael Paquier >> wrote: >>> On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier wrot

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-18 Thread Fujii Masao
On Fri, Dec 15, 2017 at 9:51 AM, Masahiko Sawada wrote: > On Fri, Dec 15, 2017 at 6:46 AM, Michael Paquier > wrote: >> On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: >>> On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier >>> wrote: On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-17 Thread Michael Paquier
On Mon, Dec 18, 2017 at 12:14 PM, Robert Haas wrote: > On Thu, Dec 14, 2017 at 7:51 PM, Masahiko Sawada > wrote: >> +1 from me. > > Works for me, too, although I still don't really follow how it's > happening in the present coding. Craig has mentioned at least one way upthread: https://www.post

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-17 Thread Robert Haas
On Thu, Dec 14, 2017 at 7:51 PM, Masahiko Sawada wrote: > +1 from me. Works for me, too, although I still don't really follow how it's happening in the present coding. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Masahiko Sawada
On Fri, Dec 15, 2017 at 6:46 AM, Michael Paquier wrote: > On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: >> On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier >> wrote: >>> On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada >>> wrote: On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: >

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Michael Paquier
On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: > On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier > wrote: >> On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada >> wrote: >>> On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier wrote:

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Fujii Masao
On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier wrote: > On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada > wrote: >> On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: >>> On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier >>> wrote: I would just write "To avoid calling CHECK_FOR_INTE

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-10 Thread Michael Paquier
On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada wrote: > On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: >> On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier >> wrote: >>> I would just write "To >>> avoid calling CHECK_FOR_INTERRUPTS which can happen when releasing a >>> LWLock" and be done wi

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-10 Thread Masahiko Sawada
On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: > On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier > wrote: >> On Fri, Dec 8, 2017 at 5:38 PM, Masahiko Sawada >> wrote: >>> After off-discussion with Fujii-san, I've updated the comment of why >>> we should disallow interrupts before setting/cl

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Robert Haas
On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier wrote: > On Fri, Dec 8, 2017 at 5:38 PM, Masahiko Sawada wrote: >> After off-discussion with Fujii-san, I've updated the comment of why >> we should disallow interrupts before setting/cleanup the session-level >> lock. Please review it. > > +

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Michael Paquier
On Fri, Dec 8, 2017 at 5:38 PM, Masahiko Sawada wrote: > After off-discussion with Fujii-san, I've updated the comment of why > we should disallow interrupts before setting/cleanup the session-level > lock. Please review it. + /* +* Set session-level lock. If we allow interrupts bef

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-08 Thread Masahiko Sawada
On Fri, Dec 1, 2017 at 11:51 AM, Michael Paquier wrote: > On Wed, Nov 29, 2017 at 7:36 AM, Michael Paquier > wrote: >> On Wed, Nov 29, 2017 at 6:44 AM, Robert Haas wrote: >>> On Tue, Nov 21, 2017 at 4:32 AM, Masahiko Sawada >>> wrote: Thank you for comments. Attached updated patch. >>> >>

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-30 Thread Michael Paquier
On Wed, Nov 29, 2017 at 7:36 AM, Michael Paquier wrote: > On Wed, Nov 29, 2017 at 6:44 AM, Robert Haas wrote: >> On Tue, Nov 21, 2017 at 4:32 AM, Masahiko Sawada >> wrote: >>> Thank you for comments. Attached updated patch. >> >> I see that Michael has marked this Ready for Committer, but also

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-28 Thread Michael Paquier
On Wed, Nov 29, 2017 at 6:44 AM, Robert Haas wrote: > On Tue, Nov 21, 2017 at 4:32 AM, Masahiko Sawada > wrote: >> Thank you for comments. Attached updated patch. > > I see that Michael has marked this Ready for Committer, but also that > he didn't update the thread, so perhaps some interested c

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-28 Thread Robert Haas
On Tue, Nov 21, 2017 at 4:32 AM, Masahiko Sawada wrote: > Thank you for comments. Attached updated patch. I see that Michael has marked this Ready for Committer, but also that he didn't update the thread, so perhaps some interested committer (Fujii Masao?) might have missed the fact that Michael

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-21 Thread Masahiko Sawada
On Tue, Nov 21, 2017 at 10:01 AM, Michael Paquier wrote: > On Tue, Nov 21, 2017 at 9:37 AM, Masahiko Sawada > wrote: >> On Tue, Nov 21, 2017 at 8:03 AM, Michael Paquier >> wrote: >>> You could just add "as this allows to keep backup counters kept in >>> shared memory consistent with the state o

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-20 Thread Michael Paquier
On Tue, Nov 21, 2017 at 9:37 AM, Masahiko Sawada wrote: > On Tue, Nov 21, 2017 at 8:03 AM, Michael Paquier > wrote: >> You could just add "as this allows to keep backup counters kept in >> shared memory consistent with the state of the session starting or >> stopping a backup.". > > Thank you for

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-20 Thread Masahiko Sawada
On Tue, Nov 21, 2017 at 8:03 AM, Michael Paquier wrote: > On Tue, Nov 21, 2017 at 3:11 AM, Fujii Masao wrote: >> On Mon, Nov 20, 2017 at 4:12 PM, Masahiko Sawada >> wrote: >>> I agree with your approach. It makes sense to me. >>> >>> Attached updated patch. Please review it. >> >> Thanks for up

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-20 Thread Michael Paquier
On Tue, Nov 21, 2017 at 3:11 AM, Fujii Masao wrote: > On Mon, Nov 20, 2017 at 4:12 PM, Masahiko Sawada > wrote: >> I agree with your approach. It makes sense to me. >> >> Attached updated patch. Please review it. > > Thanks for updating the patch! The patch basically looks good to me. I am not

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-20 Thread Fujii Masao
On Mon, Nov 20, 2017 at 4:12 PM, Masahiko Sawada wrote: > On Fri, Nov 17, 2017 at 11:00 AM, Michael Paquier > wrote: >> On Thu, Nov 16, 2017 at 8:17 PM, Masahiko Sawada >> wrote: >>> On Thu, Nov 16, 2017 at 1:11 PM, Michael Paquier >>> wrote: + /* +* Quick exit if session is no

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-19 Thread Masahiko Sawada
On Fri, Nov 17, 2017 at 11:00 AM, Michael Paquier wrote: > On Thu, Nov 16, 2017 at 8:17 PM, Masahiko Sawada > wrote: >> On Thu, Nov 16, 2017 at 1:11 PM, Michael Paquier >> wrote: >>> + /* >>> +* Quick exit if session is not keeping around a non-exclusive backup >>> +* already started.

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-16 Thread Michael Paquier
On Thu, Nov 16, 2017 at 8:17 PM, Masahiko Sawada wrote: > On Thu, Nov 16, 2017 at 1:11 PM, Michael Paquier > wrote: >> + /* >> +* Quick exit if session is not keeping around a non-exclusive backup >> +* already started. >> +*/ >> + if (sessionBackupState != SESSION_BACKUP_NON_EXCL

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-16 Thread Masahiko Sawada
On Thu, Nov 16, 2017 at 1:11 PM, Michael Paquier wrote: > On Thu, Nov 16, 2017 at 10:57 AM, Masahiko Sawada > wrote: >> Agreed. Attached the updated patch, please review it. Thank you for the comment. > + /* > +* Quick exit if session is not keeping around a non-exclusive backup > +*

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-15 Thread Michael Paquier
On Thu, Nov 16, 2017 at 10:57 AM, Masahiko Sawada wrote: > Agreed. Attached the updated patch, please review it. + /* +* Quick exit if session is not keeping around a non-exclusive backup +* already started. +*/ + if (sessionBackupState != SESSION_BACKUP_NON_EXCLUSIVE) + ret

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-15 Thread Masahiko Sawada
On Wed, Nov 15, 2017 at 5:39 PM, Michael Paquier wrote: > On Wed, Nov 15, 2017 at 5:21 PM, Masahiko Sawada > wrote: >> On Wed, Nov 15, 2017 at 2:38 PM, Michael Paquier >> wrote: >>> On Wed, Nov 15, 2017 at 12:12 PM, Masahiko Sawada >>> wrote: I think we need to check only sessionBackupSt

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-15 Thread Michael Paquier
On Wed, Nov 15, 2017 at 5:21 PM, Masahiko Sawada wrote: > On Wed, Nov 15, 2017 at 2:38 PM, Michael Paquier > wrote: >> On Wed, Nov 15, 2017 at 12:12 PM, Masahiko Sawada >> wrote: >>> I think we need to check only sessionBackupState and don't need to >>> check XLogCtl->Insert.exclusiveBackupStat

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-15 Thread Masahiko Sawada
On Wed, Nov 15, 2017 at 2:38 PM, Michael Paquier wrote: > On Wed, Nov 15, 2017 at 12:12 PM, Masahiko Sawada > wrote: >> I think we need to check only sessionBackupState and don't need to >> check XLogCtl->Insert.exclusiveBackupState in do_pg_abort_backup(). We >> can quickly return if sessionBac

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-14 Thread Michael Paquier
On Wed, Nov 15, 2017 at 12:12 PM, Masahiko Sawada wrote: > I think we need to check only sessionBackupState and don't need to > check XLogCtl->Insert.exclusiveBackupState in do_pg_abort_backup(). We > can quickly return if sessionBackupState != > SESSION_BACKUP_NON_EXCLUSIVE. In your suggestion, I

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-14 Thread Masahiko Sawada
On Wed, Nov 15, 2017 at 10:05 AM, Michael Paquier wrote: > On Wed, Nov 15, 2017 at 9:06 AM, Masahiko Sawada > wrote: >>> On Nov 15, 2017 2:59 AM, "Fujii Masao" wrote: >>> + /* Quick exit if we have done the backup */ >>> + if (XLogCtl->Insert.exclusiveBackupState == EXCLUSIVE_BACKUP_NONE) >>> +

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-14 Thread Michael Paquier
On Wed, Nov 15, 2017 at 9:06 AM, Masahiko Sawada wrote: >> On Nov 15, 2017 2:59 AM, "Fujii Masao" wrote: >> + /* Quick exit if we have done the backup */ >> + if (XLogCtl->Insert.exclusiveBackupState == EXCLUSIVE_BACKUP_NONE) >> + return; >> >> This quick exit seems to cause another problem. Plea

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-14 Thread Masahiko Sawada
Thank you for the reviewing! On Nov 15, 2017 2:59 AM, "Fujii Masao" wrote: On Fri, Sep 22, 2017 at 4:42 PM, Masahiko Sawada wrote: > On Fri, Sep 22, 2017 at 3:46 PM, Michael Paquier > wrote: >> On Fri, Sep 22, 2017 at 3:24 PM, Masahiko Sawada wrote: >>> I have a question. Since WALInsertLockR

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-11-14 Thread Fujii Masao
On Fri, Sep 22, 2017 at 4:42 PM, Masahiko Sawada wrote: > On Fri, Sep 22, 2017 at 3:46 PM, Michael Paquier > wrote: >> On Fri, Sep 22, 2017 at 3:24 PM, Masahiko Sawada >> wrote: >>> I have a question. Since WALInsertLockRelease seems not to call >>> LWLockWaitForVar I thought you wanted to mean