Обсуждение: pgsql: Repair problems occurring when multiple RI updates have to be

Поиск
Список
Период
Сортировка

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

От
tgl@postgresql.org (Tom Lane)
Дата:
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)

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

От
Alvaro Herrera
Дата:
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)

cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@commandprompt.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

Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
Magnus Hagander
Дата:
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.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


Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
"Marc G. Fournier"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- --On Thursday, August 16, 2007 18:29:22 +0200 Magnus Hagander
<magnus@hagander.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@hub.org                              MSN . scrappy@hub.org
Yahoo . yscrappy               Skype: hub.org        ICQ . 7615664
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

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


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

Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
"Marc G. Fournier"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
<magnus@hagander.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@hub.org                              MSN . scrappy@hub.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-----


Marc G. Fournier wrote:
>
>
> --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
> <magnus@hagander.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

Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
"Marc G. Fournier"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- --On Friday, August 17, 2007 08:40:11 +0200 Magnus Hagander
<magnus@hagander.net> wrote:

> Marc G. Fournier wrote:
>>
>>
>> --On Thursday, August 16, 2007 23:16:09 +0200 Magnus Hagander
>> <magnus@hagander.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@hub.org                              MSN . scrappy@hub.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-----


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.

Re: [HACKERS] Re: cvsweb busted (was Re: pgsql: Repair problems occurring when multiple RI updates have to be)

От
"Joshua D. Drake"
Дата:
-----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-----