Re: temporal support patch
От
Kevin Grittner
Тема
Re: temporal support patch
Дата
Msg-id
503351DA0200002500049981@gw.wicourts.gov
Ответ на
Re: temporal support patch (Jeff Davis)
Список
Дерево обсуждения
temporal support patch Miroslav Šimulčík <simulcik.miro@gmail.com>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Vlad Arkhipov <arhipov@dc.baikal.ru>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Robert Haas <robertmhaas@gmail.com>
Re: temporal support patch "David Johnston" <polobo@yahoo.com>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch David Fetter <david@fetter.org>
Re: temporal support patch Josh Berkus <josh@agliodbs.com>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Craig Ringer <ringerc@ringerc.id.au>
Re: temporal support patch Craig Ringer <ringerc@ringerc.id.au>
Re: temporal support patch Vlad Arkhipov <arhipov@dc.baikal.ru>
Re: Audit Logs WAS: temporal support patch Josh Berkus <josh@agliodbs.com>
Re: Audit Logs WAS: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Audit Logs WAS: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: Audit Logs WAS: temporal support patch Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: Audit Logs WAS: temporal support patch Vlad Arkhipov <arhipov@dc.baikal.ru>
Re: Audit Logs WAS: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: Audit Logs WAS: temporal support patch Jim Nasby <jim@nasby.net>
Re: Audit Logs WAS: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: Audit Logs WAS: temporal support patch Jim Nasby <jim@nasby.net>
Re: Audit Logs WAS: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: Audit Logs WAS: temporal support patch Christopher Browne <cbbrowne@gmail.com>
Re: Audit Logs WAS: temporal support patch Josh Berkus <josh@agliodbs.com>
Re: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: temporal support patch Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: temporal support patch Alvaro Herrera <alvherre@2ndquadrant.com>
Re: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: temporal support patch Robert Haas <robertmhaas@gmail.com>
Re: temporal support patch "David Johnston" <polobo@yahoo.com>
Re: temporal support patch Robert Haas <robertmhaas@gmail.com>
Re: temporal support patch Jim Nasby <jim@nasby.net>
Re: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: temporal support patch Robert Haas <robertmhaas@gmail.com>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: temporal support patch Miroslav Šimulčík <simulcik.miro@gmail.com>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Vlad Arkhipov <arhipov@dc.baikal.ru>
Re: temporal support patch Jeff Davis <pgsql@j-davis.com>
Re: temporal support patch Merlin Moncure <mmoncure@gmail.com>
Re: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: temporal support patch Miroslav Šimulčík <simulcik.miro@gmail.com>
Re: temporal support patch Pavel Stehule <pavel.stehule@gmail.com>
Re: temporal support patch Miroslav Šimulčík <simulcik.miro@gmail.com>
Re: temporal support patch Jaime Casanova <jaime@2ndquadrant.com>
Re: temporal support patch "Albe Laurenz" <laurenz.albe@wien.gv.at>
Re: temporal support patch Miroslav Šimulčík <simulcik.miro@gmail.com>
Jeff Davis wrote: > On Mon, 2012-08-20 at 19:32 -0500, Kevin Grittner wrote: >> Josh Berkus wrote: >> >>> This is sounding like a completely runaway spec on what should >>> be a simple feature. >> >> I hate to contribute to scope creep (or in this case scope >> screaming down the tracks at full steam), but I've been watching >> this with a queasy feeling about interaction with Serializable >> Snapshot Isolation (SSI). > > There are all kinds of challenges here, and I'm glad you're > thinking about them. I alluded to some problems here: > > http://archives.postgresql.org/message-id/1345415312.20987.56.camel@jdavis > > But those might be a subset of the problems you're talking about. > > It sounds like, at a high level, there are two problems: > > 1. capturing the apparent order of execution in the audit log > 2. assigning meaningful times to the changes that are consistent > with the apparent order of execution As far as I can see, transactions which execute DML at any transaction isolation level other than serializable can be considered to have occurred in commit order. Transactions which don't write to the database don't need to be considered as part of the history, at least in terms of viewing prior state. Same with transactions which roll back. (Now, failed transactions and reads might be of interest for some audit reports, but that seems to me like a different issue than a temporal database.) The funny bit is for a serializable transaction (TN) which commits after writing to the database -- you can't know the apparent order of execution as long as there are any serializable transactions active which can't see the work of TN (i.e., the transactions overlap). If such a transaction (TX) executes a read which conflicts with a TN write, TX appears to have executed first, since it doesn't see the work of TN, so I think the sequence number or timestamp for TN has to follow that for TX even though TN committed first. On the other hand, TX might write something that conflicts with a TN read, in which case TN will appear to have executed first and must get a sequence number or timestamp before TX. If there is a cycle, SSI will cancel one of the transactions involved, so that can't occur anywhere in the time line. So, if you want to allow serializable temporal queries, the timing of a read-write serializable transaction can't be locked down until all overlapping read-write serializable transactions complete; and the apparent order of execution must be based on read-write conflicts, which are tracked within SSI. I think that if we can generate a list of committed transactions in order based on this logic, it could feed into replication system -- hot standby as well as trigger-based systems. I think we could generate snapshots which exclude the transactions for which the order of execution has not yet been determined, and avoid the delays involved in other possible solutions. There's a lot of detail missing here in terms of what the API would be, and how we handle the summarization that can occur within SSI so that it can continue to function within bounded memory even in pessimal circumstances, but that's the general outline of my concerns and suggested solution. -Kevin
В списке pgsql-hackers по дате отправления
От: Boszormenyi Zoltan
Дата: