Primary key duplicated: NUMBER OF INDEX' TUPLES (21539) IS NOT THE SAME AS HEAP (18607)'

Lists: pgsql-bugs
From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Primary key duplicated: NUMBER OF INDEX' TUPLES (21539) IS NOT THE SAME AS HEAP (18607)'
Date: 2003-05-21 11:08:19
Message-ID: bafmqr$2ftj$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi all,
I'm getting the "duplication primary key" error
since 2 months ( happen 4 times ), the table affected
is always the same, no power down, no db shutdown, no
strange situation.
This is the scenario:

All morning at 7:10 AM this commands are scheduled:

/usr/bin/vacuumdb -v -f --table=jobs ${DATABASE}
/usr/bin/vacuumdb -v -f --table=programs ${DATABASE}
/usr/bin/psql -t -c "reindex table jobs" ${DATABASE} 2>&1

/usr/bin/psql -t -c "reindex table ua_user_data_exp" ${DATABASE} 2>&1
/usr/bin/psql -t -c "reindex table user_traffic" ${DATABASE} 2>&1
/usr/bin/psql -t -c "reindex table user_logs" ${DATABASE} 2>&1
/usr/bin/psql -t -c "reindex table current_connection" ${DATABASE} 2>&1
/usr/bin/vacuumdb -v -f --table=last_connection ${DATABASE}
/usr/bin/vacuumdb -v -f --table=user_traffic ${DATABASE}
/usr/bin/vacuumdb -v -f --table=transaction_history ${DATABASE}
/usr/bin/vacuumdb -v -f --table=user_logs ${DATABASE}
/usr/bin/vacuumdb -v -f --table=current_connection ${DATABASE}

all these commands are completed in 27 minutes.
In the attachment you can find these rows:

WARNING: Index idx_user_user_traffic: NUMBER OF INDEX' TUPLES (21539) IS
NOT
THE SAME AS HEAP' (18607). Recreate the index.
INFO: Index idx_sdr_contract_user_traffic: Pages 66; Tuples 18617: Deleted
2532. CPU 0.00s/0.03u sec elapsed 0.02 sec.
WARNING: Index idx_sdr_contract_user_traffic: NUMBER OF INDEX' TUPLES
(21539) IS NOT THE SAME AS HEAP' (18607). Recreate the index.
INFO: Index user_traffic_pkey: Pages 64; Tuples 18617: Deleted 2532.
CPU 0.00s/0.02u sec elapsed 0.02 sec.
WARNING: Index user_traffic_pkey: NUMBER OF INDEX' TUPLES (21539) IS NOT
THE
SAME AS HEAP' (18607). Recreate the index.

De manage a service 24/24 7/7 and is very annoing
shutdown the DB, adjust manualy the
dump, drop the db recreate a new one, fill it again....

What can I do in order to avoid this ?

:-(

Gaetano


From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Primary key duplicated: NUMBER OF INDEX' TUPLES (21539) IS NOT THE SAME AS HEAP (18607)'
Date: 2003-05-21 11:20:27
Message-ID: bafnhj$2hvr$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

I forgot to say that the version is Postgres 7.3.2 on Linux box

"Gaetano Mendola" <mendola(at)bigfoot(dot)com> wrote in message
news:bafmqr$2ftj$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> Hi all,
> I'm getting the "duplication primary key" error
> since 2 months ( happen 4 times ), the table affected
> is always the same, no power down, no db shutdown, no
> strange situation.
> This is the scenario:
>
> All morning at 7:10 AM this commands are scheduled:
>
> /usr/bin/vacuumdb -v -f --table=jobs ${DATABASE}
> /usr/bin/vacuumdb -v -f --table=programs ${DATABASE}
> /usr/bin/psql -t -c "reindex table jobs" ${DATABASE} 2>&1
>
> /usr/bin/psql -t -c "reindex table ua_user_data_exp" ${DATABASE} 2>&1
> /usr/bin/psql -t -c "reindex table user_traffic" ${DATABASE} 2>&1
> /usr/bin/psql -t -c "reindex table user_logs" ${DATABASE} 2>&1
> /usr/bin/psql -t -c "reindex table current_connection" ${DATABASE} 2>&1
> /usr/bin/vacuumdb -v -f --table=last_connection ${DATABASE}
> /usr/bin/vacuumdb -v -f --table=user_traffic ${DATABASE}
> /usr/bin/vacuumdb -v -f --table=transaction_history ${DATABASE}
> /usr/bin/vacuumdb -v -f --table=user_logs ${DATABASE}
> /usr/bin/vacuumdb -v -f --table=current_connection ${DATABASE}
>
> all these commands are completed in 27 minutes.
> In the attachment you can find these rows:
>
> WARNING: Index idx_user_user_traffic: NUMBER OF INDEX' TUPLES (21539) IS
> NOT
> THE SAME AS HEAP' (18607). Recreate the index.
> INFO: Index idx_sdr_contract_user_traffic: Pages 66; Tuples 18617:
Deleted
> 2532. CPU 0.00s/0.03u sec elapsed 0.02 sec.
> WARNING: Index idx_sdr_contract_user_traffic: NUMBER OF INDEX' TUPLES
> (21539) IS NOT THE SAME AS HEAP' (18607). Recreate the index.
> INFO: Index user_traffic_pkey: Pages 64; Tuples 18617: Deleted 2532.
> CPU 0.00s/0.02u sec elapsed 0.02 sec.
> WARNING: Index user_traffic_pkey: NUMBER OF INDEX' TUPLES (21539) IS NOT
> THE
> SAME AS HEAP' (18607). Recreate the index.
>
>
> De manage a service 24/24 7/7 and is very annoing
> shutdown the DB, adjust manualy the
> dump, drop the db recreate a new one, fill it again....
>
> What can I do in order to avoid this ?
>
>
> :-(
>
>
> Gaetano
>
>
>
>
>
>