| From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
|---|---|
| To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tv(at)fuzzy(dot)cz>, Thom Brown <thom(at)linux(dot)com>, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: change in LOCK behavior |
| Date: | 2012-10-11 18:36:00 |
| Message-ID: | CA+TgmoYjRaX8tqb9+phOTfRFK4ZwVs50qMds1DtsZ-6APr2QpQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Oct 11, 2012 at 2:23 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> So where's the race?
>
> AFAICS it either waits or it doesn't - the code isn't vague on that
> point. If we wait we set the flag.
>
> The point is that lock waits are pretty rare since most locks are
> compatible, so triggering a second snap if we waited is not any kind
> of problem, even if we waited for a very short time.
That actually wouldn't fix the problem, because we might have this scenario:
1. We take a snapshot.
2. Some other process commits, clearing its XID from its PGPROC and
releasing locks.
3. We take a lock.
:-(
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2012-10-11 18:41:58 | Re: change in LOCK behavior |
| Previous Message | Simon Riggs | 2012-10-11 18:23:56 | Re: change in LOCK behavior |