On Tue, Mar 1, 2016 at 12:07 PM, Konstantin Knizhnik <k.knizh...@postgrespro.ru> wrote: > In the article them used anotion "wait": > > if T.SnapshotTime>GetClockTime() > then wait until T.SnapshotTime<GetClockTime() > > Originally we really do sleep here, but then we think that instead of > sleeping we can just adjust local time. > Sorry, I do not have format prove it is equivalent but... at least we have > not encountered any inconsistencies after this fix and performance is > improved.
I think that those things are probably not equivalent. They would be if you could cause the adjustment to advance in lock-step on every node at the same time, but you probably can't. And I think it is extremely unwise to assume that the fact that nothing obviously broke means that you got it right. This is the sort of work where formal proofs of correctness are, IMHO, extremely wise. > I fear that building a DTM that is fully reliable and also > well-performing is going to be really hard, and I think it would be > far better to have one such DTM that is 100% reliable than two or more > implementations each of which are 99% reliable. > > The question is not about it's reliability, but mostly about its > functionality and flexibility. Well, *my* concern is about reliability. A lot of code can be made faster at the price of less reliability, but that usually doesn't work out well in the end. Performance matters too, of course, but the way to get there is to start with a good algorithm, write reliable code to implement it, and then optimize. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers