Re: Logical decoding of sequence advances, part II
От | Robert Haas |
---|---|
Тема | Re: Logical decoding of sequence advances, part II |
Дата | |
Msg-id | CA+TgmoYAL0BOCNoPQMDNpwbLe+t8qfuwBsqJOs8uVxQu8xywcA@mail.gmail.com обсуждение исходный текст |
Ответ на | Logical decoding of sequence advances, part II (Craig Ringer <craig@2ndquadrant.com>) |
Ответы |
Re: Logical decoding of sequence advances, part II
Re: Logical decoding of sequence advances, part II |
Список | pgsql-hackers |
On Sun, Aug 21, 2016 at 11:13 PM, Craig Ringer <craig@2ndquadrant.com> wrote: > If the sequence is created in the current xact (i.e. uncommitted) we have to > add the sequence updates to that xact to be replayed only if it commits. The > sequence is visible only to the toplevel xact that created the sequence so > advances of it can only come from that xact and its children. The actual > CREATE SEQUENCE is presumed to be handled separately by an event trigger or > similar. > > If the new sequence is committed we must replay sequence advances > immediately and non-transactionally to ensure they're not lost due to xact > rollback or replayed in the wrong order due to xact commit order. So, I wish I could give you some better advice on this topic, but sadly I am not an expert in this area. However, it seems to me that this is just one facet of a much more general problem: given two transactions T1 and T2, the order of replay must match the order of commit unless you can prove that there are no dependencies between them. I don't see why it matters whether the operations are sequence operations or data operations; it's just a question of whether they're modifying the same "stuff". Of course, it's possible I'm missing something important here... -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: