pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Deadlocks?  What happened to MVCC?
Date: Tue, 14 Aug 2001 16:46:45 -0400 (EDT)
Message-ID: <200108142046.f7EKkjc19066@jupiter.us.greatbridge.com> (raw)
In-Reply-To: <web-102047@davinci.ethosmedia.com>

Josh Berkus wrote:
> Folks:
>
> I'm getting deadlock errors on one of the operations on my web
> application.  It's a function which adds a large number of rows to a
> holding table, then updates that set of rows multiple times in order to
> present scoring information to the user.
>
> However, the function is deadlocking itself once it's in heavy use.  I
> though that MVCC was supposed to supercede deadlocks, unless I
> specifically set locks, which I'm not.
>
> Help, anyone?

    You   must   have  misunderstood  something.  MVCC  does  not
    supersede deadlocks, nor can it prevent them. All  MVCC  does
    is to help "readers" not beeing blocked by "writers" and vice
    versa, by avoiding the need for  shared  "read"  locks.   But
    writers  still  need  locks,  so  if  your  application  does
    something like

        Xact-1: Starts transaction
        Xact-2: Starts transaction
        Xact-1: Updates row A
        Xact-2: Updates row B
        Xact-1: Wants to update row B (blocks)
        Xact-2: Wants to update row A

    then it's a deadlock. A deadlock is a deadlock and remains to
    be a deadlock, no matter if you have versioning or not.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




view thread (4+ messages)  latest in thread

Message-ID: <200108142046.f7EKkjc19066@jupiter.us.greatbridge.com>
Permalink:  ../200108142046.f7EKkjc19066@jupiter.us.greatbridge.com/
Also on:    postgresql.org/message-id/200108142046.f7EKkjc19066@jupiter.us.greatbridge.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: JanWieck@Yahoo.com, josh@agliodbs.com
  Subject: Re: Deadlocks?  What happened to MVCC?
  In-Reply-To: <200108142046.f7EKkjc19066@jupiter.us.greatbridge.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox