Re: Using non-sequential timelines in order to help with possible collisions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Brian Faherty <anothergenericuser(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using non-sequential timelines in order to help with possible collisions
Date: 2017-07-19 18:05:39
Message-ID: 7175.1500487539@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Wed, Jul 19, 2017 at 7:00 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> It's interesting that you bring this up. I've also wondered why we
>> don't use random TLIs. I suppose I'm internally assuming that it's
>> because the people who wrote the code are far more brilliant and
>> knowledgeable of this area than I could ever be and that doing
>> anything else would create some kind of awful problem, but maybe
>> that's not so.

> I am not the only who worked on that, but the result code is a tad
> more simple, as it is possible to guess more easily some hierarchy for
> the timelines, of course with the history files at hand.

Yeah, right now you have the ability to guess that, say, timeline 42
is a descendant of 41, which you couldn't assume with random TLIs.
Also, the values are only 32 bits, which is not wide enough to allow
imagining that random() could be relied on to produce non-duplicate
values.

If we had separate database identifiers for slave installations, which
AFAIR we don't, it'd be possible to consider incorporating part of
the server ID into timeline IDs it creates, which would alleviate
Brian's issue I think. That is, instead of 1, 2, 3, ..., a server
might create 1xyz, 2xyz, 3xyz, ... where "xyz" are random digits
associated with the particular installation. This is obviously
not bulletproof since you could have collisions of the xyz's, but
it would help. Also you could imagine allowing DBAs to assign
distinct xyz codes to every slave in a given community.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-07-19 18:09:22 Re: pl/perl extension fails on Windows
Previous Message Robert Haas 2017-07-19 17:56:49 Re: Pluggable storage