pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: manoj.kumar.mbm@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14598: Duplicate values found when reindexing unique index
Date: Sat, 25 Mar 2017 08:22:12 +0000
Message-ID: <20170325082212.2694.43097@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


view thread (8+ messages)  latest in thread

Message-ID: <20170325082212.2694.43097@wrigleys.postgresql.org>
Permalink:  ../20170325082212.2694.43097@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170325082212.2694.43097@wrigleys.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: manoj.kumar.mbm@gmail.com
  Subject: Re: BUG #14598: Duplicate values found when reindexing unique index
  In-Reply-To: <20170325082212.2694.43097@wrigleys.postgresql.org>
  References: <20170325082212.2694.43097@wrigleys.postgresql.org>

* 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