Changeset 20966
- Timestamp:
- Dec 12, 2008, 11:41:07 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r20965 r20966 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1.7 6 2008-12-12 21:13:41jhoblitt Exp $3 # $Id: SQL.pm,v 1.77 2008-12-12 21:41:07 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 328 328 HAVING available_instances < instances OR instances < copies 329 329 }, 330 find_objects_with_extra_instances => qq{331 SELECT 332 s torage_object.so_id,333 ext_id,330 find_objects_with_extra_instances_by_xattr => qq{ 331 SELECT 332 so.so_id, 333 so.ext_id, 334 334 count(ins_id) as instances, 335 volume.name as volume_name, 336 volume.host as volume_host, 337 count(mymountedvol.vol_id) as available_instances, 338 count(mymountedvol.vol_id) > 0 as recoverable, 339 storage_object_xattr.value as copies 340 FROM storage_object 341 JOIN instance 342 USING(so_id) 343 JOIN volume 344 USING(vol_id) 345 LEFT JOIN storage_object_xattr 346 ON storage_object.so_id = storage_object_xattr.so_id 347 JOIN mymountedvol 335 mv.name as volume_name, 336 mv.host as volume_host, 337 count(mv.vol_id) as available_instances, 338 xattr.value as copies 339 FROM storage_object AS so 340 JOIN storage_object_xattr as xattr 341 ON so.so_id = xattr.so_id 342 AND xattr.name = 'user.copies' 343 JOIN instance AS i 344 ON so.so_id = i.so_id 345 JOIN mountedvol AS mv 348 346 USING(vol_id) 349 347 WHERE 350 mymountedvol.available = 1 351 AND storage_object_xattr.name = 'user.copies' 348 mv.available = 1 352 349 GROUP BY so_id 353 350 HAVING available_instances > copies 351 limit 5; 354 352 }, 355 353 get_mounted_volumes => qq{
Note:
See TracChangeset
for help on using the changeset viewer.
