Closed (fixed)
Project:
http:BL
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 May 2010 at 12:19 UTC
Updated:
13 Jun 2015 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
praseodym commentedProblem is that fixing this bug by using two queries instead causes a conflict with #723358: PHP Warning: Duplicate entry <snip> for key 1\nquery: INSERT INTO httpbl (hostname, status, expire) VALUES <snip>. If you can come up with a solution that works on both PostgreSQL and MySQL, it'd be very helpful.
Comment #2
alpapan commenteduse db_lock_table
a
Comment #3
praseodym commentedThanks for the patch. Have you tested this in production? I'm afraid that table locking for common operations like this one will have a severe performance impact.
Comment #4
alpapan commentedMight be a bit better to be a bit slow than not working at all?
Comment #5
praseodym commentedSince this code is executed on every page view, we simply cannot afford waiting for locks. That's simply killing for performance.
Comment #6
bendiy commentedAttached is a new patch that should address this issue for both PostgreSQL and MySQL. It is based on this approach for a PostgreSQL REPLACE:
http://stackoverflow.com/questions/1109061/insert-on-duplicate-update-po...
I see no reason why this would be any slower as a REPLACE is basically doing the same thing.
Comment #7
ben coleman commentedI tested the patch from #6 on both MySQL 5 and PostgreSQL 9.1, and it works on both.
Comment #9
bryrock commentedThis has been committed. Should appear in next 6.x-2.x-dev.