On Wed, Oct 10, 2012 at 10:26 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> How does Slony write its changes without causing serialization replay
It uses a sequence to break any ordering conflicts at the time that
data is inserted into its log tables.
If there are two transactions, A and B, that were "fighting" over a
tuple on the origin, then either:
a) A went first, B went second, and the ordering in the log makes that
b) A succeeds, then B fails, so there's no conflict;
c) A is doing its thing, and B is blocked behind it for a while, then
A fails, and B gets to go through, and there's no conflict.
Switch A and B as needed.
The sequence that is used establishes what is termed a "compatible
ordering." There are multiple possible compatible orderings; ours
happen to interleave transactions together, with the sequence
guaranteeing absence of conflict.
If we could get commit orderings, then a different but still
"compatible ordering" would be to have each transaction establish its
own internal sequence, and apply things in order based on
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"
In response to
pgsql-hackers by date
|Next:||From: Simon Riggs||Date: 2012-10-11 22:46:46|
|Subject: Re: [PATCH 8/8] Introduce wal decoding via catalog timetravel|
|Previous:||From: Simon Riggs||Date: 2012-10-11 22:39:00|
|Subject: Re: Deprecating RULES|