Changeset 1324

Show
Ignore:
Timestamp:
10/18/09 08:12:20 (6 weeks ago)
Author:
dormando
Message:

insert relative nexttry for file_to_queue

Used to insert 0, which caused could cause the INSERT to lock behind the
SELECT .. FOR UPDATE; UPDATE IN (etc); loop that the job masters do.

Idea from Clint Byrum.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/MogileFS/Store.pm

    r1323 r1324  
    11881188    my ($self, $fidid, $type, $in) = @_; 
    11891189 
    1190     my $nexttry = 0; 
    1191     if ($in) { 
    1192         $nexttry = $self->unix_timestamp . " + " . int($in); 
    1193     } 
     1190    my $nexttry = $self->unix_timestamp . " + " . int($in); 
    11941191 
    11951192    $self->insert_ignore("INTO file_to_queue (fid, type, nexttry) ". 
     
    12041201        return 1; 
    12051202    } 
    1206     my $nexttry = 0; 
    1207     if ($in) { 
    1208         $nexttry = $self->unix_timestamp . " + " . int($in); 
    1209     } 
     1203    my $nexttry = $self->unix_timestamp . " + " . int($in); 
    12101204 
    12111205    # TODO: convert to prepared statement?