IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2008, 2:19:34 PM (18 years ago)
Author:
jhoblitt
Message:

add neb-fsck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r16259 r16264  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.45 2008-01-28 19:48:08 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.46 2008-01-30 00:19:06 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    172172            storage_object.so_id,
    173173            uri,
    174             assigned_vol_id
     174            assigned_vol_id,
     175            available
    175176        FROM storage_object
    176177        JOIN instance
     
    242243        SET ext_id = ?
    243244        WHERE ext_id = ?
     245    },
     246    find_objects_with_unavailable_instances => qq{
     247        SELECT
     248            so_id,
     249            ext_id,
     250            count(ins_id) as instances,
     251            count(mountedvol.vol_id) as available_instances,
     252            count(mountedvol.vol_id) < count(ins_id) as need_recovery,
     253            count(mountedvol.vol_id) > 0 as recoverable
     254        FROM storage_object
     255        JOIN instance
     256            USING(so_id)
     257        LEFT JOIN mountedvol
     258            USING(vol_id)
     259        GROUP BY so_id
     260        HAVING need_recovery = 1
    244261    },
    245262);
Note: See TracChangeset for help on using the changeset viewer.