pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_authid has duplicated rows
7+ messages / 4 participants
[nested] [flat]

* pg_authid has duplicated rows
@ 2018-07-23 18:03  Mariel Cherkassky <mariel.cherkassky@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Mariel Cherkassky @ 2018-07-23 18:03 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi,
Today I faced a situation where I saw a postgresql 9.2 database that had
duplicated rows in pg_autid. I saw 6 roles while 3 of them were duplicated
(3 uniques rolenames in total). I checked and the oid of the duplicates
were the same oid as the originals. The solution was running vacuum on the
table but I wanted to understand how this situation was created ? Why even
with unique index on the rolname I saw duplicated values for rolname ?

Thanks , Mariel.

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-23 20:26  Andres Freund <andres@anarazel.de>
  parent: Mariel Cherkassky <mariel.cherkassky@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Andres Freund @ 2018-07-23 20:26 UTC (permalink / raw)
  To: Mariel Cherkassky <mariel.cherkassky@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

Hi,

On 2018-07-23 21:03:32 +0300, Mariel Cherkassky wrote:
> Today I faced a situation where I saw a postgresql 9.2 database that had
> duplicated rows in pg_autid. I saw 6 roles while 3 of them were duplicated
> (3 uniques rolenames in total). I checked and the oid of the duplicates
> were the same oid as the originals. The solution was running vacuum on the
> table but I wanted to understand how this situation was created ? Why even
> with unique index on the rolname I saw duplicated values for rolname ?

That suggests some form of corruption. Which version of 9.2 did this
occur on? Did you have any OS level crashes? Ran with fsync=off?

Please note that 9.2 is not supported anymore.

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-23 20:33  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Alvaro Herrera @ 2018-07-23 20:33 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Mariel Cherkassky <mariel.cherkassky@gmail.com>; pgsql-admin@lists.postgresql.org

On 2018-Jul-23, Andres Freund wrote:

> Hi,
> 
> On 2018-07-23 21:03:32 +0300, Mariel Cherkassky wrote:
> > Today I faced a situation where I saw a postgresql 9.2 database that had
> > duplicated rows in pg_autid. I saw 6 roles while 3 of them were duplicated
> > (3 uniques rolenames in total). I checked and the oid of the duplicates
> > were the same oid as the originals. The solution was running vacuum on the
> > table but I wanted to understand how this situation was created ? Why even
> > with unique index on the rolname I saw duplicated values for rolname ?
> 
> That suggests some form of corruption. Which version of 9.2 did this
> occur on? Did you have any OS level crashes? Ran with fsync=off?

I have vague memories of seeing this recently.  Can you please show 

select xmin, xmax, ctid, oid, rolname from pg_authid

And the output of pg_controldata.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-23 20:43  Andres Freund <andres@anarazel.de>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Andres Freund @ 2018-07-23 20:43 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Mariel Cherkassky <mariel.cherkassky@gmail.com>; pgsql-admin@lists.postgresql.org



On July 23, 2018 1:33:11 PM PDT, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>On 2018-Jul-23, Andres Freund wrote:
>
>> Hi,
>> 
>> On 2018-07-23 21:03:32 +0300, Mariel Cherkassky wrote:
>> > Today I faced a situation where I saw a postgresql 9.2 database
>that had
>> > duplicated rows in pg_autid. I saw 6 roles while 3 of them were
>duplicated
>> > (3 uniques rolenames in total). I checked and the oid of the
>duplicates
>> > were the same oid as the originals. The solution was running vacuum
>on the
>> > table but I wanted to understand how this situation was created ?
>Why even
>> > with unique index on the rolname I saw duplicated values for
>rolname ?
>> 
>> That suggests some form of corruption. Which version of 9.2 did this
>> occur on? Did you have any OS level crashes? Ran with fsync=off?
>
>I have vague memories of seeing this recently.  Can you please show 

It's at least one of the potential effects of the out-of-date shared relcache bug I recently fixed (but wasn't backpatched to 9.2, as it's unsupported).

Andres

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-24 09:26  Mariel Cherkassky <mariel.cherkassky@gmail.com>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Mariel Cherkassky @ 2018-07-24 09:26 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-admin@lists.postgresql.org

Hi,
I checked it also in version 9.6, and in this version I can edit the
pg_authid table. I'm suppose to get an error that the table is a system
catalog or am I wrong ?






2018-07-23 23:43 GMT+03:00 Andres Freund <andres@anarazel.de>:

>
>
> On July 23, 2018 1:33:11 PM PDT, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:
> >On 2018-Jul-23, Andres Freund wrote:
> >
> >> Hi,
> >>
> >> On 2018-07-23 21:03:32 +0300, Mariel Cherkassky wrote:
> >> > Today I faced a situation where I saw a postgresql 9.2 database
> >that had
> >> > duplicated rows in pg_autid. I saw 6 roles while 3 of them were
> >duplicated
> >> > (3 uniques rolenames in total). I checked and the oid of the
> >duplicates
> >> > were the same oid as the originals. The solution was running vacuum
> >on the
> >> > table but I wanted to understand how this situation was created ?
> >Why even
> >> > with unique index on the rolname I saw duplicated values for
> >rolname ?
> >>
> >> That suggests some form of corruption. Which version of 9.2 did this
> >> occur on? Did you have any OS level crashes? Ran with fsync=off?
> >
> >I have vague memories of seeing this recently.  Can you please show
>
> It's at least one of the potential effects of the out-of-date shared
> relcache bug I recently fixed (but wasn't backpatched to 9.2, as it's
> unsupported).
>
> Andres
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>

Attachments:

image.png (image/png, 10.5K) download view image
image.png (image/png, 4.9K) download view image
^ permalink raw reply [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-24 13:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mariel Cherkassky <mariel.cherkassky@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2018-07-24 13:57 UTC (permalink / raw)
  To: Mariel Cherkassky <mariel.cherkassky@gmail.com>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-admin@lists.postgresql.org

Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:
> I checked it also in version 9.6, and in this version I can edit the
> pg_authid table. I'm suppose to get an error that the table is a system
> catalog or am I wrong ?

No, the "system catalog modification" restriction only applies to DDL
on the system catalogs --- for instance, adding/removing a column, which
our C code couldn't cope with.  You're free to change their contents by
hand if you're a superuser.  (And if you break something that way, you
get to keep both pieces.  But sometimes it's necessary.)

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_authid has duplicated rows
@ 2018-07-24 13:58  Mariel Cherkassky <mariel.cherkassky@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Mariel Cherkassky @ 2018-07-24 13:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-admin@lists.postgresql.org

Ok, thanks for the clarification.

On Tue, Jul 24, 2018, 4:57 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:
> > I checked it also in version 9.6, and in this version I can edit the
> > pg_authid table. I'm suppose to get an error that the table is a system
> > catalog or am I wrong ?
>
> No, the "system catalog modification" restriction only applies to DDL
> on the system catalogs --- for instance, adding/removing a column, which
> our C code couldn't cope with.  You're free to change their contents by
> hand if you're a superuser.  (And if you break something that way, you
> get to keep both pieces.  But sometimes it's necessary.)
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-07-24 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 18:03 pg_authid has duplicated rows Mariel Cherkassky <mariel.cherkassky@gmail.com>
2018-07-23 20:26 ` Andres Freund <andres@anarazel.de>
2018-07-23 20:33   ` Alvaro Herrera <alvherre@2ndquadrant.com>
2018-07-23 20:43     ` Andres Freund <andres@anarazel.de>
2018-07-24 09:26       ` Mariel Cherkassky <mariel.cherkassky@gmail.com>
2018-07-24 13:57         ` Tom Lane <tgl@sss.pgh.pa.us>
2018-07-24 13:58           ` Mariel Cherkassky <mariel.cherkassky@gmail.com>

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