RE: Log a sample of transactions
Kuroda, Hayato <kuroda.hayato@jp.fujitsu.com>
From: "Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>
To: 'Adrien NAYRAT' <adrien.nayrat@anayrat.info>, "'pgsql-hackers@lists.postgresql.org'" <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-28T01:53:51Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Tweak docs for log_statement_sample_rate
- d1f04b96b99d 12.0 landed
Dear Adrien, >> * 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. I think your point is also correct. You should inquire superior reviewers or committers because I cannot judge which one is better. BTW, I give you a suggestion about a test. This parameter enables users to log statements randomly, hence adding some tests is very difficult. Perhaps Only three cases are available: * When log_transaction_sample_rate is set to 1, all statements are logged. * When the parameter is set to 0, they are never logged. * When the parameter change to 0 inside the transaction, logging is immediately stopped. Best Regards, Hayato Kuroda Fujitsu LIMITED