Hi,

On 03/15/2016 03:04 AM, Noah Misch wrote:
On Mon, Mar 14, 2016 at 01:33:08PM +0100, Tomas Vondra wrote:
On 03/14/2016 07:14 AM, Noah Misch wrote:
On Mon, Mar 14, 2016 at 02:00:03AM +0100, Tomas Vondra wrote:
+        * XXX Maybe this should also care about the clock skew, just like the
+        *     block a few lines down.

Yes, it should.  (The problem is large (>~100s), backward clock resets, not
skew.)  A clock reset causing "msg->clock_time < dbentry->stats_timestamp"
will usually also cause "msg->cutoff_time < dbentry->stats_timestamp".  Such
cases need the correction a few lines down.

I'll look into that. I have to admit I have a hard time reasoning about the
code handling clock skew, so it might take some time, though.

No hurry; it would be no problem to delay this several months.

Attached is a patch that should fix the coalescing, including the clock skew detection. In the end I reorganized the code a bit, moving the check at the end, after the clock skew detection. Otherwise I'd have to do the clock skew detection on multiple places, and that seemed ugly.

regards

--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment: pgstat-coalesce-v3.patch
Description: binary/octet-stream

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to