exception caught: DB: update insert: : 1062: Duplicate entry

Hi, I'm using gps 1.004, with the following configuration:

mode=reverse
dbtype=mysql
db_host=localhost
db_username=root
db_password=
db_dbname=greylist

on Fedora Core 3.

I keep getting the exception:

exception caught: DB: update insert: : 1062: Duplicate entry 'email@domain.net-bounce-928-51309@rennlist.org-64-145-15-200' for key 1 INSERT INTO triplet VALUES ('rennlist.com','bounce-928-51309@rennlist.org','email@domain.net',64,145,15,2
00,0,1142264306), continuing with 'dunno'

This is because the reverse lookup of the client address randomly gives one of these names:

[~] phl| host 64.145.15.200
200.15.145.64.in-addr.arpa is an alias for 200.192-26.15.145.64.in-addr.arpa.
200.192-26.15.145.64.in-addr.arpa domain name pointer rennlist.rennlist.com.
200.192-26.15.145.64.in-addr.arpa domain name pointer rennlist.rennlist.org.
200.192-26.15.145.64.in-addr.arpa domain name pointer www.rennlist.com.
200.192-26.15.145.64.in-addr.arpa domain name pointer www.rennlist.org.
200.192-26.15.145.64.in-addr.arpa domain name pointer news.rennlist.org.
200.192-26.15.145.64.in-addr.arpa domain name pointer rennlist.com.

and I already have an entry in the triplet table for "rennlist.org".

Forums: 

Hi greg,
with phpmyadmin you can repair your table.
Operations --> repair table

Hi

I don't think it's about repairing the table. The primary key which must be unique consists of "sender-recipient-client_IP_address".

I have also noticed these on our systems, even in the new upcoming slightly improved gps version. So far I only have a theory that an email is sent twice pretty much at the same time. When the first gps process checks with the db, there is no entry yet. Meanwhile, a second gps process receives the same message (same key at least). It checks with the db. Still no record. The first gps process inserts the record into the db. Now, the second gps process tries also to insert the same record and that's where mysql complains.

If this is what actually happens - I still have to trace it through the logs - it would be almost correct behaviour. Or, at least I don't know how/what the second process should do better unless it checked with the first gps process somehow.

Let me know what you think

Correction that was wrong. I just traced one case through the logs. What happens is that (sorry to publish this on a public site):

# host 160.83.52.98
98.52.83.160.in-addr.arpa domain name pointer smtp3.uk.deuba.com.
98.52.83.160.in-addr.arpa domain name pointer loninmrp6.uk.db.com.

I always thought reverse DNS entries had to unique...

I ended up changing the format of the DB for reverse operation to fix this problem.
If I could figure out how to attach the diffs I would. If someone wants them let me know.

I want to see this diffs. I found some mail servers with several reverse DNS entries. And the error is the same.

Thank you.