Re: typos in HS source code comment

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: typos in HS source code comment
Date: 2010-08-12 09:02:32
Message-ID: AANLkTincu8k9dVYGgUKyYB0h6aPVU9GT0-dcQ-7rrsc8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

When I was enjoying reading the HS source code,
I found some typos. Attached patch fixes them.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
hs_typo_v1.patch application/octet-stream 10.9 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typos in HS source code comment
Date: 2010-08-12 23:28:27
Message-ID: AANLkTim+=EbZPac55FR0WJ6LXykiwcwDu0rUzc3cpXB1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 12, 2010 at 5:02 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> When I was enjoying reading the HS source code,
> I found some typos. Attached patch fixes them.

I've committed all of this except for the following, which I'm not
certain is correct:

--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -355,10 +355,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus sta
/*
* Update the group LSN if the transaction completion LSN is higher.
*
- * Note: lsn will be invalid when supplied during InRecovery processing,
- * so we don't need to do anything special to avoid LSN updates during
- * recovery. After recovery completes the next clog change will set the
- * LSN correctly.
+ * Note: lsn will be invalid when supplied while we're performing
+ * recovery but hot standby is disabled, so we don't need to do
+ * anything special to avoid LSN updates in that case. After recovery
+ * completes the next clog change will set the LSN correctly.
*/
if (!XLogRecPtrIsInvalid(lsn))
{

TransactionIdSetStatusBit is called from TransactionIdSetPageStatus,
which seems to think that the validity of lsn is based on whether
we're doing an async commit. Your change may be correct, but I'm not
certain of it...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typos in HS source code comment
Date: 2010-08-13 01:37:11
Message-ID: AANLkTi=vAoZHmENwD8pDsks5+vSCP4M_MmCQCvTScM+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 13, 2010 at 8:28 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I've committed all of this except for the following, which I'm not
> certain is correct:

Thanks for the commit.

> --- a/src/backend/access/transam/clog.c
> +++ b/src/backend/access/transam/clog.c
> @@ -355,10 +355,10 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus sta
>        /*
>         * Update the group LSN if the transaction completion LSN is higher.
>         *
> -        * Note: lsn will be invalid when supplied during InRecovery processing,
> -        * so we don't need to do anything special to avoid LSN updates during
> -        * recovery. After recovery completes the next clog change will set the
> -        * LSN correctly.
> +        * Note: lsn will be invalid when supplied while we're performing
> +        * recovery but hot standby is disabled, so we don't need to do
> +        * anything special to avoid LSN updates in that case. After recovery
> +        * completes the next clog change will set the LSN correctly.
>         */
>        if (!XLogRecPtrIsInvalid(lsn))
>        {
>
> TransactionIdSetStatusBit is called from TransactionIdSetPageStatus,
> which seems to think that the validity of lsn is based on whether
> we're doing an async commit.  Your change may be correct, but I'm not
> certain of it...

Before 9.0, since xact_redo_commit always calls TransactionIdCommitTree,
TransactionIdSetStatusBit always receives InvalidXLogRecPtr. In 9.0,
xact_redo_commit calls TransactionIdCommitTree only when hot standby is
disabled. OTOH, when hot standby is enabled, xact_redo_commit calls
TransactionIdAsyncCommitTree, so TransactionIdSetStatusBit receives the
valid lsn.

Regards,

PS. I'll be unable to read hackers from Aug 13th to 20th because of
a vacation.

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typos in HS source code comment
Date: 2010-08-13 15:10:23
Message-ID: AANLkTikUAFMBcbEPskZOXR=Wy4jFCObgEyXxCOO4F=E2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 12, 2010 at 9:37 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> Before 9.0, since xact_redo_commit always calls TransactionIdCommitTree,
> TransactionIdSetStatusBit always receives InvalidXLogRecPtr. In 9.0,
> xact_redo_commit calls TransactionIdCommitTree only when hot standby is
> disabled. OTOH, when hot standby is enabled, xact_redo_commit calls
> TransactionIdAsyncCommitTree, so TransactionIdSetStatusBit receives the
> valid lsn.

Hmm. Maybe that should be spelled out a little more explicitly in the comment.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company