G'day ...
I've got a script that runs on all the servers that dump's IP traffic
data to a 7.4 database ... they all run at the same time, but I'm starting
to get the following on a reasonably regular basis:
ERROR: deadlock detected at /usr/local/abin/ipaudit2ams.pl line 175.
The code that
Marc G. Fournier [EMAIL PROTECTED] writes:
Now, the scripts are wrap'd in a BEGIN/END ... if a file fails to be
loaded, I want the whole thing to rollback ... the deadlock itself, I'm
presuming, is because two servers are trying to update the same
$ip_id/$port/$company_id record, at the same
On Mon, 5 Apr 2004, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
Now, the scripts are wrap'd in a BEGIN/END ... if a file fails to be
loaded, I want the whole thing to rollback ... the deadlock itself, I'm
presuming, is because two servers are trying to update the same
On Mon, 5 Apr 2004, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
D'oh ... just tested my assumption, it was wrong ... *sigh* okay, back
to the drawing board on the code ...
Can't you just change
foreach $company_id ( keys %traffic ) {
to
foreach $company_id ( sort
Marc G. Fournier [EMAIL PROTECTED] writes:
D'oh ... just tested my assumption, it was wrong ... *sigh* okay, back
to the drawing board on the code ...
Can't you just change
foreach $company_id ( keys %traffic ) {
to
foreach $company_id ( sort keys %traffic ) {
etc.
1. a traffic table is read in, and loaded into a hash table that is
ordered by company_id, ip_id and port:
$traffic{$ip_rec{$ip}{'company_id'}}{$ip_id}{$port} += $bytes1 + $bytes2;
2. a foreach loop is run on that resultant list to do the updates to the
database:
foreach
D'oh ... just tested my assumption, it was wrong ... *sigh* okay, back
to the drawing board on the code ...
On Mon, 5 Apr 2004, Marc G. Fournier wrote:
On Mon, 5 Apr 2004, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
Now, the scripts are wrap'd in a BEGIN/END ... if a
That appears to have fixed it, thanks ... at least it hasn't happened in a
few hours, and it was happening at least once an hour previously ...
On Mon, 5 Apr 2004, Matt Clark wrote:
1. a traffic table is read in, and loaded into a hash table that is
ordered by company_id, ip_id and
Marc G. Fournier [EMAIL PROTECTED] wrote:
On Mon, 5 Apr 2004, Tom Lane wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
D'oh ... just tested my assumption, it was wrong ... *sigh* okay, back
to the drawing board on the code ...
Can't you just change
foreach $company_id (