Re: Transaction Snapshots and Hot Standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transaction Snapshots and Hot Standby
Date: 2008-09-12 10:13:28
Message-ID: 1221214408.3913.994.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Thu, 2008-09-11 at 17:04 +0300, Heikki Linnakangas wrote:
> Csaba Nagy wrote:
> > and that means in fact that if you have
> > continuously overlapping small transactions, the "blocking horizon"
> > could be even blocked forever, as there'll always be a query running,
> > and the new queries will always have the snapshot of the currently
> > running ones because WAL recovery is stalled...
>
> Hmm, no I don't think the WAL recovery can become completely stalled. To
> completely stop progressing, we'd need to take a new snapshot that
> includes transaction X, and at the same time be blocked on a vacuum
> record that vacuums a tuple that's visible to transaction X. I don't
> think that can happen, because for such a scenario to arise, in the
> corresponding point in time in the master, there would've been a
> scenario where the vacuum would've removed a tuple that would have been
> visible to a newly starting transaction. Which can't happen. I think..

ISTM Csaba is correct. If WAL blocks the xids don't change and so the
snapshots never change, so wal is blocked.

The only way out of that is to store up removals for particular blocks,
but that's complicated.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-09-12 10:19:30 Re: Transaction Snapshots and Hot Standby
Previous Message Simon Riggs 2008-09-12 10:00:09 Re: Transaction Snapshots and Hot Standby