pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14598: Duplicate values found when reindexing unique index
8+ messages / 6 participants
[nested] [flat]

* BUG #14598: Duplicate values found when reindexing unique index
@ 2017-03-25 08:22 manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: manoj.kumar.mbm@gmail.com @ 2017-03-25 08:22 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14598
Logged by:          Manoj  Kumar
Email address:      manoj.kumar.mbm@gmail.com
PostgreSQL version: Unsupported/Unknown
Operating system:   RHEL 5.8 
Description:        

I have encountered the same bug as mentioned at
:-https://www.postgresql.org/message-id/8bca3aa10712300802h1c34ce69j1a1ab8b730c002e9@mail.gmail.com

[Version]
Red Hat Enterprise Linux 5.8 (x86_64)
PostgreSQL
8.1.18

[Occurrence]
Rarely

[Impact]
Critical, partition on which pgdata lie become full and PostgreSQL server
shut down abruptly.

[Scenario in which this bug produced]

1) Reindex statement :- 

<127.0.0.1(58384)%2016-09-13 02:35:04 GMT> LOG:  duration: 47606.785 ms 
statement: REINDEX TABLE tb_node_performance_info;REINDEX TABLE tb_.........
(40-50 tables more)

2) Insert statement are triggering on cron basis.
##########################################
<169.254.136.51(54356)%2016-09-13 02:35:05 GMT> LOG:  duration: 2274.218 ms 
statement: INSERT INTO tb_node_performance_info (
node_id,timeflag,cpuusedrate,memorytotal,memoryfree,totalbandwidthread,totalbandwidthwrite
)VALUES( 'HN0801',1473733740,0.157,98806968,95408416,0.1,0 )
#############################################

#######################
<169.254.135.55(43842)%2016-09-13 02:35:06 GMT> LOG:  duration: 1679.948 ms 
statement: INSERT INTO tb_node_performance_info (
node_id,timeflag,cpuusedrate,memorytotal,memoryfree,totalbandwidthread,totalbandwidthwrite
)VALUES( 'HN0705',1473733980,0.146,98806968,95607020,0,0 )
###########################

3) Duplicate key violation is observed:-
###############################################################
<169.254.131.33(51484)%2016-09-13 02:35:08 GMT> ERROR:  duplicate key
violates unique constraint "tb_node_performance_info_pkey"
<169.254.131.33(51484)%2016-09-13 02:35:08 GMT> CONTEXT:  SQL statement
"INSERT INTO tb_node_performance_info (node_id,timeflag,cpuusedrate,
memorytotal,memoryfree)VALUES( $1 , $2 ,  $3 , $4 ,  $5 )"
###################################################################

4) suddenly the index file of tb_performance_info_pkey got deleted:-

<%2016-09-13 02:38:13 GMT> ERROR:  could not open relation
1663/16385/280951: No such file or directory

5) After that reindex fails and wall size keep on increasing.

Result partition full and PostgreSQL fails.

-----------------------------------
Faced two times in past year.

-----------------------------------

[queries] 
1) primary key is [Node_ID, timestamp] tb_node_performance_info. 
This insert statement always trigger on every minute by cron. primary key is
ale ways unique because timestamp(epoch) + node_id is always unique.

There is no point of duplicate data, then why we get duplicate key violation
msg ?

2) Is there any way to recover the data?
 (Currently I have pgdata which I cannot read because of missing relation
file. )

3) Is this bug related to BUG #11141: Duplicate primary key values
corruption.

Note:- we have analyzed complete partition and found that there is no
hardware related issue.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
@ 2017-03-26 13:11 ` Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Michael Paquier @ 2017-03-26 13:11 UTC (permalink / raw)
  To: manoj.kumar.mbm@gmail.com; +Cc: pgsql-bugs

On Sat, Mar 25, 2017 at 5:22 PM,  <manoj.kumar.mbm@gmail.com> wrote:
> [Version]
> Red Hat Enterprise Linux 5.8 (x86_64)
> PostgreSQL
> 8.1.18

The last minor version of 8.1.X was released in 2010 and has fallen
out of support since. Even this version is missing one year of bug
fixes, so you could do a minor update first. And at the end you will
need to upgrade.
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
@ 2017-03-26 14:48   ` Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 09:07     ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Manoj Verma @ 2017-03-26 14:48 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-bugs

Dear Michael,

I understand that upgrade is necessary.

But the question is upgradation of postgresql really fix this issue?

Until or unless the root cause is known, it's tough to accept that after
upgradation of postgresql this issue will never occur.

If it is possible for you, guide me how can I proceed to find the root
cause.

On Mar 26, 2017 6:41 PM, "Michael Paquier" <michael.paquier@gmail.com>
wrote:

> On Sat, Mar 25, 2017 at 5:22 PM,  <manoj.kumar.mbm@gmail.com> wrote:
> > [Version]
> > Red Hat Enterprise Linux 5.8 (x86_64)
> > PostgreSQL
> > 8.1.18
>
> The last minor version of 8.1.X was released in 2010 and has fallen
> out of support since. Even this version is missing one year of bug
> fixes, so you could do a minor update first. And at the end you will
> need to upgrade.
> --
> Michael
>

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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
@ 2017-03-27 09:07     ` hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 16:45       ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: hubert depesz lubaczewski @ 2017-03-27 09:07 UTC (permalink / raw)
  To: Manoj Verma <manoj.kumar.mbm@gmail.com>; +Cc: Michael Paquier <michael.paquier@gmail.com>; pgsql-bugs

On Sun, Mar 26, 2017 at 08:18:49PM +0530, Manoj Verma wrote:
> Dear Michael,
> 
> I understand that upgrade is necessary.
> 
> But the question is upgradation of postgresql really fix this issue?
> 
> Until or unless the root cause is known, it's tough to accept that after
> upgradation of postgresql this issue will never occur.
> 
> If it is possible for you, guide me how can I proceed to find the root
> cause.

It is also tough to accept that someone is requesting help with version
of PostgreSQL which is not supported for over 6 years, and has known
bugs. Spending time to support *unsupported* version to find that (in
most likely scenario) the bug has been fixed lont time ago, or (in
less likely scenario) it was hardware error - is just very unlikely to
happen.

Best regards,

depesz



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 09:07     ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
@ 2017-03-27 16:45       ` Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 17:20         ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Manoj Verma @ 2017-03-27 16:45 UTC (permalink / raw)
  To: depesz@depesz.com; +Cc: Michael Paquier <michael.paquier@gmail.com>; pgsql-bugs

Dear depesz,

I am currently on Rhel 5.8.

On which minor version should I upgrade/update, which include major bug
fixes like duplicate value issue.

On Mar 27, 2017 2:37 PM, "hubert depesz lubaczewski" <depesz@depesz.com>
wrote:

> On Sun, Mar 26, 2017 at 08:18:49PM +0530, Manoj Verma wrote:
> > Dear Michael,
> >
> > I understand that upgrade is necessary.
> >
> > But the question is upgradation of postgresql really fix this issue?
> >
> > Until or unless the root cause is known, it's tough to accept that after
> > upgradation of postgresql this issue will never occur.
> >
> > If it is possible for you, guide me how can I proceed to find the root
> > cause.
>
> It is also tough to accept that someone is requesting help with version
> of PostgreSQL which is not supported for over 6 years, and has known
> bugs. Spending time to support *unsupported* version to find that (in
> most likely scenario) the bug has been fixed lont time ago, or (in
> less likely scenario) it was hardware error - is just very unlikely to
> happen.
>
> Best regards,
>
> depesz
>
>

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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 09:07     ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 16:45       ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
@ 2017-03-27 17:20         ` hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 18:06           ` Re: BUG #14598: Duplicate values found when reindexing unique index John R Pierce <pierce@hogranch.com>
  0 siblings, 1 reply; 8+ messages in thread

From: hubert depesz lubaczewski @ 2017-03-27 17:20 UTC (permalink / raw)
  To: Manoj Verma <manoj.kumar.mbm@gmail.com>; +Cc: Michael Paquier <michael.paquier@gmail.com>; pgsql-bugs

On Mon, Mar 27, 2017 at 10:15:38PM +0530, Manoj Verma wrote:
> Dear depesz,
> 
> I am currently on Rhel 5.8.
> 
> On which minor version should I upgrade/update, which include major bug
> fixes like duplicate value issue.

If you want, for whatever reason, to stay to 8.2, then upgrade to newest
8.2 (no idea what it is - it's so ancient that I don't even have it).

Otherwise - upgrade to 9.6.2.

depesz


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 09:07     ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 16:45       ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 17:20         ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
@ 2017-03-27 18:06           ` John R Pierce <pierce@hogranch.com>
  2017-03-27 18:15             ` Re: BUG #14598: Duplicate values found when reindexing unique index Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: John R Pierce @ 2017-03-27 18:06 UTC (permalink / raw)
  To: pgsql-bugs

On 3/27/2017 10:20 AM, hubert depesz lubaczewski wrote:
> On Mon, Mar 27, 2017 at 10:15:38PM +0530, Manoj Verma wrote:
>> Dear depesz,
>>
>> I am currently on Rhel 5.8.
>>
>> On which minor version should I upgrade/update, which include major bug
>> fixes like duplicate value issue.
> If you want, for whatever reason, to stay to 8.2, then upgrade to newest
> 8.2 (no idea what it is - it's so ancient that I don't even have it).
>
> Otherwise - upgrade to 9.6.2.

per https://www.postgresql.org/docs/current/static/release.html the 
final release of 8.2 was 8.2.23, in December 2011

but, the OP was asking about 8.1, of which the final release was 8.1.23, 
in 2010.

However, running out of disk space in the disk volume holding pgdata is 
a catastrophic error, that can leave the database in an unknown state, 
depending on exactly what was allocating file space when it ran out.



-- 
john r pierce, recycling bits in santa cruz

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

* Re: BUG #14598: Duplicate values found when reindexing unique index
  2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
  2017-03-26 13:11 ` Re: BUG #14598: Duplicate values found when reindexing unique index Michael Paquier <michael.paquier@gmail.com>
  2017-03-26 14:48   ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 09:07     ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 16:45       ` Re: BUG #14598: Duplicate values found when reindexing unique index Manoj Verma <manoj.kumar.mbm@gmail.com>
  2017-03-27 17:20         ` Re: BUG #14598: Duplicate values found when reindexing unique index hubert depesz lubaczewski <depesz@depesz.com>
  2017-03-27 18:06           ` Re: BUG #14598: Duplicate values found when reindexing unique index John R Pierce <pierce@hogranch.com>
@ 2017-03-27 18:15             ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2017-03-27 18:15 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: pgsql-bugs

John R Pierce <pierce@hogranch.com> writes:
> However, running out of disk space in the disk volume holding pgdata is 
> a catastrophic error, that can leave the database in an unknown state, 
> depending on exactly what was allocating file space when it ran out.

It's not supposed to do that; the worst case ought to be a forced
database shutdown until you free up some space.  (And that should
be an unusual case -- ideally, you just get a normal query failure
from an INSERT or UPDATE.)  So there may in fact be a bug here,
if there were not any additional factors involved.  But, as was said
upthread, 8.1.x is long out of support and nobody in the community
is likely to investigate bug reports against it for free.

If the OP is sufficiently desperate, he could probably hire one of
the various PG support companies to investigate, or at least help
him with data recovery.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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


end of thread, other threads:[~2017-03-27 18:15 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-25 08:22 BUG #14598: Duplicate values found when reindexing unique index manoj.kumar.mbm@gmail.com
2017-03-26 13:11 ` Michael Paquier <michael.paquier@gmail.com>
2017-03-26 14:48   ` Manoj Verma <manoj.kumar.mbm@gmail.com>
2017-03-27 09:07     ` hubert depesz lubaczewski <depesz@depesz.com>
2017-03-27 16:45       ` Manoj Verma <manoj.kumar.mbm@gmail.com>
2017-03-27 17:20         ` hubert depesz lubaczewski <depesz@depesz.com>
2017-03-27 18:06           ` John R Pierce <pierce@hogranch.com>
2017-03-27 18:15             ` Tom Lane <tgl@sss.pgh.pa.us>

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