pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: konstantin knizhnik <k.knizhnik@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: now() vs transaction_timestamp()
Date: Sun, 07 Oct 2018 01:06:39 -0400
Message-ID: <31310.1538888799@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA4eK1LOQs6mBUHi7dttD_cy3Rq4K7inQR1rhzKv_DGGvYHXVQ@mail.gmail.com>
References: <6406dbd2-5d37-4cb6-6eb2-9c44172c7e7c@postgrespro.ru>
	<4268.1538747795@sss.pgh.pa.us>
	<4911.1538774725@sss.pgh.pa.us>
	<9c78b24f-4ec9-e1dd-bdf6-e09e9b5f0e31@postgrespro.ru>
	<14825.1538842224@sss.pgh.pa.us>
	<CAA4eK1LOQs6mBUHi7dttD_cy3Rq4K7inQR1rhzKv_DGGvYHXVQ@mail.gmail.com>

Amit Kapila <amit.kapila16@gmail.com> writes:
> On Sat, Oct 6, 2018 at 9:40 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That's a bit too small ;-) ... one demonstrable problem with it is
>> that the parallel worker will report the wrong xactStartTimestamp
>> to pgstat_report_xact_timestamp(), since you aren't jamming the
>> transmitted value in soon enough.  Also, I found that ParallelWorkerMain
>> executes at least two transactions before it ever gets to the "main"
>> transaction that does real work, and I didn't much care for the fact
>> that those were running with worker-local values of xactStartTimestamp
>> and stmtStartTimestamp.  So I rearranged things a bit to ensure that
>> parallel workers wouldn't generate their own values for either
>> timestamp, and pushed it.

> Currently, we serialize the other transaction related stuff via
> PARALLEL_KEY_TRANSACTION_STATE.   However, this patch has serialized
> xact_ts via PARALLEL_KEY_FIXED which appears okay, but I think it
> would have been easier for future readers of the code if all the
> similar state variables have been serialized by using the same key.

That state is restored at least two transactions too late.

			regards, tom lane




view thread (14+ messages)  latest in thread

Message-ID: <31310.1538888799@sss.pgh.pa.us>
Permalink:  ../31310.1538888799@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31310.1538888799@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, amit.kapila16@gmail.com, k.knizhnik@postgrespro.ru, robertmhaas@gmail.com
  Subject: Re: now() vs transaction_timestamp()
  In-Reply-To: <31310.1538888799@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox