Re: Proposal: Commit timestamp - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Proposal: Commit timestamp
Date
Msg-id E1539E0ED7043848906A8FF995BDA57901B7D76A@m0143.s-mxs.net
Whole thread Raw
In response to Re: Proposal: Commit timestamp  (Theo Schlossnagle <jesus@omniti.com>)
Responses Re: Proposal: Commit timestamp  (Jim Nasby <decibel@decibel.org>)
List pgsql-hackers
> One concept is to have a univeral clock that ticks forward (like
> every second) and each node orders all their transactions inside the
> second-granular tick.  Then each commit would be like: {node,
> clocksecond, txn#} and each time the clock ticks forward, txn# is
> reset to zero.  This gives you ordered txns that windowed in some
> cluster-wide acceptable window (1 second).  However, this is totally
> broken as NTP is entirely insufficient for this purpose because of a
> variety of forms of clock skew.  As such, the timestamp should be
> incremented via cluster consensus (one token ring or the pulse
> generated by the leader of the current cluster membership quorom).

I think you are completely ignoring practicability. Or are you saying,
that such a system exists and works for e.g. a loosly connected group of
laptop field agents that only sporadically have a connection to the
cluster.

I think Jan's definition gives a pragmatic solution to the problem,
and will be able to give "good" automatic conflict resolution.

It has downsides he stated, and cannot guarantee 100% correct automatic
conflict
resolution in case of connection loss, but I am quite sure you are not
able to do
better, without loosing yourself in theory.

e.g. assume all clocks vary by no more than 30 seconds when
disconnected, you can
require manual (or rule based) resolution to all conflicts that vary by
less than
1 minute.

Andreas


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Performance penalty of visibility info in indexes?
Next
From: "Simon Riggs"
Date:
Subject: Re: [PATCHES] Fix "database is ready" race condition