pgsql: Repair problems occurring when multiple RI updates have to be

Lists: pgsql-committerspgsql-hackers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Repair problems occurring when multiple RI updates have to be
Date: 2007-08-15 19:15:47
Message-ID: 20070815191547.14D5A754259@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Repair problems occurring when multiple RI updates have to be done to the same
row within one query: we were firing check triggers before all the updates
were done, leading to bogus failures. Fix by making the triggers queued by
an RI update go at the end of the outer query's trigger event list, thereby
effectively making the processing "breadth-first". This was indeed how it
worked pre-8.0, so the bug does not occur in the 7.x branches.
Per report from Pavel Stehule.

Modified Files:
--------------
pgsql/src/backend/commands:
trigger.c (r1.216 -> r1.217)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.216&r2=1.217)
pgsql/src/backend/executor:
spi.c (r1.179 -> r1.180)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c?r1=1.179&r2=1.180)
pgsql/src/backend/utils/adt:
ri_triggers.c (r1.95 -> r1.96)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ri_triggers.c?r1=1.95&r2=1.96)
pgsql/src/include/executor:
spi.h (r1.62 -> r1.63)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/spi.h?r1=1.62&r2=1.63)
pgsql/src/test/regress/expected:
foreign_key.out (r1.44 -> r1.45)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/foreign_key.out?r1=1.44&r2=1.45)
pgsql/src/test/regress/sql:
foreign_key.sql (r1.20 -> r1.21)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/foreign_key.sql?r1=1.20&r2=1.21)


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Repair problems occurring when multiple RI updates have to be
Date: 2007-08-16 16:13:14
Message-ID: 20070816161314.GN21236@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:

There seems to be something wrong with this commit notification. This
file

> pgsql/src/test/regress/expected:
> foreign_key.out (r1.44 -> r1.45)
> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/foreign_key.out?r1=1.44&r2=1.45)

does not seem to have a 1.45 revision. Indeed, the changeset in this
patch for this file is in 1.44, not 1.45.

Any ideas what might have happened? Maybe this was changed when the
bogus REL7_4_STABLE tag was removed?

--
Alvaro Herrera http://www.PlanetPostgreSQL.org/
"I think my standards have lowered enough that now I think 'good design'
is when the page doesn't irritate the living f*ck out of me." (JWZ)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-committers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-16 16:25:29
Message-ID: 5678.1187281529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> There seems to be something wrong with this commit notification. This
> file

>> pgsql/src/test/regress/expected:
>> foreign_key.out (r1.44 -> r1.45)
>> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/foreign_key.out?r1=1.44&r2=1.45)

> does not seem to have a 1.45 revision. Indeed, the changeset in this
> patch for this file is in 1.44, not 1.45.

No, 1.44 was a month ago. 1.45 does exist in the master CVS repo
AFAICS.

It looks to me like cvsweb is showing a version that hasn't gotten
updated for a day or two. Some fallout of the master server move
no doubt.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-16 16:29:22
Message-ID: 46C47B62.5020009@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> There seems to be something wrong with this commit notification. This
>> file
>
>>> pgsql/src/test/regress/expected:
>>> foreign_key.out (r1.44 -> r1.45)
>>> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/foreign_key.out?r1=1.44&r2=1.45)
>
>> does not seem to have a 1.45 revision. Indeed, the changeset in this
>> patch for this file is in 1.44, not 1.45.
>
> No, 1.44 was a month ago. 1.45 does exist in the master CVS repo
> AFAICS.
>
> It looks to me like cvsweb is showing a version that hasn't gotten
> updated for a day or two. Some fallout of the master server move
> no doubt.

Yes, it seems to be caused by the bug in the rsync server on the old
machine. It gets fixed eventually by itself (I pushed it through now).

Marc - how much work to update that one on the old server? I know you
have a new one coming up, but as a stop-gap fix on the old one?

//Magnus


From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-16 20:43:39
Message-ID: 36CCD9D5BCF7C1C002C3D3AA@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- --On Thursday, August 16, 2007 18:29:22 +0200 Magnus Hagander
<magnus(at)hagander(dot)net> wrote:

> Marc - how much work to update that one on the old server? I know you
> have a new one coming up, but as a stop-gap fix on the old one?

The new one is just waiting on your time scheduale ... its there ready for you
though :)

- ----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFGxLb74QvfyHIvDvMRAp7KAKDna1ykPMPMKA7swknKg8aHnJ0d7QCg5T5A
yJKd0uDb7FBvm2EeZtS3ioA=
=DxVn
-----END PGP SIGNATURE-----


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-16 21:16:09
Message-ID: 46C4BE99.6020000@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Marc G. Fournier wrote:
>
>> Marc - how much work to update that one on the old server? I know you
>> have a new one coming up, but as a stop-gap fix on the old one?
>
> The new one is just waiting on your time scheduale ... its there ready for you
> though :)

No, that's still waiting on your documentation.

But my question still stands - how much work to stop-gap fix it on the
old one?

//Magnus


From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-16 23:59:57
Message-ID: CE1D8DA29F4FD1D923433CBA@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
<magnus(at)hagander(dot)net> wrote:

>
> But my question still stands - how much work to stop-gap fix it on the
> old one?

rsync should be upgraded now ...

- ----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFGxOT94QvfyHIvDvMRAvzDAJ99kLdDzyM9RsxeUi1aQOyoJLv+sQCgkq/e
tRC1QXW116gVX/30VZCJQGc=
=e7HB
-----END PGP SIGNATURE-----


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-17 06:40:11
Message-ID: 46C542CB.4040805@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Marc G. Fournier wrote:
>
>
> --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
> <magnus(at)hagander(dot)net> wrote:
>
>> But my question still stands - how much work to stop-gap fix it on the
>> old one?
>
> rsync should be upgraded now ...

Thanks!
Hopefully that should fix the short-term problem.

I'll try to take a look at the other one as soon as I can, hopefully
this weekend - if you have the docs by then.

//Magnus


From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-17 17:28:13
Message-ID: 7C715DF9314404BCF58EC493@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- --On Friday, August 17, 2007 08:40:11 +0200 Magnus Hagander
<magnus(at)hagander(dot)net> wrote:

> Marc G. Fournier wrote:
>>
>>
>> --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
>> <magnus(at)hagander(dot)net> wrote:
>>
>>> But my question still stands - how much work to stop-gap fix it on the
>>> old one?
>>
>> rsync should be upgraded now ...
>
> Thanks!
> Hopefully that should fix the short-term problem.
>
> I'll try to take a look at the other one as soon as I can, hopefully
> this weekend - if you have the docs by then.

If you need information, just ask for it ...

- ----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFGxdqt4QvfyHIvDvMRAps7AKCOeK/Nnl+QHP6s4dowwueVlJKCKgCgpdGV
mmvsY+qa7gszdye6ftAc++4=
=5WQB
-----END PGP SIGNATURE-----


From: Dave Page <dpage(at)postgresql(dot)org>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-17 18:01:33
Message-ID: 46C5E27D.6020507@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Marc G. Fournier wrote:
>> I'll try to take a look at the other one as soon as I can, hopefully
>> this weekend - if you have the docs by then.
>
> If you need information, just ask for it ...

Magnus has repeatedly asked you to document it on PMT as we have been
doing as a matter of course for everything for quite some time now.

We're not doing that to be a pita, but to help us run the kind of
professional infrastructure that the community has come to expect. That
means everything is documented, systems are built in standard ways
whereever possible, everything is monitored constantly, and backed up
left right and center.

So please help maintain that level of professionalism and document the
new VM you've built so it can be properly maintained in the future.

Regards, Dave.


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)
Date: 2007-08-17 19:59:34
Message-ID: 46C5FE26.5050708@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Page wrote:
> Marc G. Fournier wrote:
>>> I'll try to take a look at the other one as soon as I can, hopefully
>>> this weekend - if you have the docs by then.
>>
>> If you need information, just ask for it ...
>
> Magnus has repeatedly asked you to document it on PMT as we have been
> doing as a matter of course for everything for quite some time now.

+1, even I am following up with the team standard of trying to document
on PMT.

>
> We're not doing that to be a pita, but to help us run the kind of
> professional infrastructure that the community has come to expect. That
> means everything is documented, systems are built in standard ways
> whereever possible, everything is monitored constantly, and backed up
> left right and center.

+1

>
> So please help maintain that level of professionalism and document the
> new VM you've built so it can be properly maintained in the future.

As our infrastructure continues to grow this is going to be vital. We
keep getting bigger, and the only way to track this stuff appropriately
is through documentation.

Sincerely,

Joshua D. Drake

>
> Regards, Dave.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate
>

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxf4mATb/zqfZUUQRAsgQAJ4i/4j9a94WFHK2i1Xe/mA1yWi4gQCffQAI
AsOsgbdFuqvYjLpFZRpby34=
=FErs
-----END PGP SIGNATURE-----