Re: weird hang while running in HS mode - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: weird hang while running in HS mode
Date
Msg-id AANLkTimENYn2TwTcbVOSam8FKxSj--RlCbTT4Ero93Ef@mail.gmail.com
Whole thread Raw
In response to Re: weird hang while running in HS mode  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: weird hang while running in HS mode
List pgsql-hackers
On Thu, May 13, 2010 at 6:47 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Rollbacks are always flushed to disk, so this explanation doesn't work.
> Even if it were it would take no longer than ~1 sec if everything were
> working correctly on the test system.

Yeah, rollbacks are always flushed sooner or later, but not *immediately*,
since RecordTransactionAbort() calls only XLogInsert() but not XLogFlush().
Until XLogFlush() is executed by another process, the WAL record of rollback
would stay in wal_buffers.

On the other hand, RecordTransactionCommit() calls XLogFlush(),
so commits are always flushed to the disk immediately.

> The "weird hang" is a lock wait and is perfectly normal in database
> systems. Robert says he hasn't checked whether it is reproduceable, so
> there is no evidence to show there is anything other than pilot error,
> at this point.

I was able to reproduce such a hang by not executing another transaction
after rollback. In this case, walsender cannot replicate the rollback
since it's not in the disk.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: weird hang while running in HS mode
Next
From: Magnus Hagander
Date:
Subject: Re: pg_upgrade code questions