Re: Log a sample of transactions

From: Adrien NAYRAT <adrien(dot)nayrat(at)anayrat(dot)info>
To: "Kuroda, Hayato" <kuroda(dot)hayato(at)jp(dot)fujitsu(dot)com>, "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Log a sample of transactions
Date: 2019-01-26 10:44:58
Message-ID: fa577d4b-088c-8de9-a4f3-0aa63e3f2a37@anayrat.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/23/19 3:12 AM, Kuroda, Hayato wrote:
> Dear Adrien,

Hello Kuroda-san

>
>
> ---- config.sgml ----
> You must document the behavior when users change the parameter during a transaction.
> あやしい・・・

Agreed, I added a wording.

>
> ---- postgres.c ----
> I give you three comments.
>
>> /* flag for logging statements in this transaction */
> I think "a" or the plural form should be used instead of "this"

Fixed

>
> * xact_is_sampled is left at the end of a transaction.
> Should the parameter be set to false at the lowest layer of the transaction system?
> I understand it is unnecessary for the functionality, but it have more symmetry.

Yes, it is not necessary. I wonder what is more important : keep some
kind of symmetry or avoid unnecessary code (which can be source of mistake)?

>
> * check_log_duration should be used only when postgres check the duration.
> But I'm not sure a new function such as check_is_sampled is needed because A processing in new function will be as almost same as check_log_duration.

I agree, I asked myself the same question and I preferred to keep code
simple.

Here is 4th patch.

Thanks!

Attachment Content-Type Size
log_xact-4.patch text/x-patch 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2019-01-26 11:09:41 Re: [PATCH] Allow UNLISTEN during recovery
Previous Message Lætitia Avrot 2019-01-26 09:50:15 [Patch] Log10 and hyperbolic functions for SQL:2016 compliance