Changeset 372
- Timestamp:
- 08/24/06 22:54:07 (2 years ago)
- Files:
-
- branches/server-newrepl/mogilefsd (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/server-newrepl/mogilefsd
r370 r372 239 239 my %opts = ( @_ ); 240 240 241 # validate we're getting called with known parameters 242 my %valid_keys = map { $_ => 1 } qw( random min_free_space weight_by_free max_disk_age not_on_hosts must_be_writeable must_be_readable ); 243 warn "invalid key $_ in call to find_deviceid\n" 244 foreach grep { ! $valid_keys{$_} } keys %opts; 245 241 246 # copy down global minimum free space if not specified 242 247 $opts{min_free_space} ||= MogileFS->config("min_free_space"); … … 245 250 $opts{max_disk_age} = time() - ($opts{max_disk_age} * 60); 246 251 } 247 $opts{must_be_alive} = 1 unless defined $opts{must_be_alive};252 $opts{must_be_alive} = 1 unless defined $opts{must_be_alive}; 248 253 249 254 # setup for iterating over devices … … 268 273 next if $opts{min_free_space} && $dev->{mb_total} && 269 274 $dev->{mb_free} < $opts{min_free_space}; 270 next if $opts{must_be_ alive} &&275 next if $opts{must_be_writeable} && 271 276 (MogileFS->observed_state("host", $dev->{hostid}) ne "reachable" || 272 277 MogileFS->observed_state("device", $dev->{devid}) ne "writeable"); 278 next if $opts{must_be_readable} && 279 (MogileFS->observed_state("host", $dev->{hostid}) ne "reachable" || 280 MogileFS->observed_state("device", $dev->{devid}) ne "readable"); 273 281 274 282 # we get here, this is a suitable device
