Changeset 32953
- Timestamp:
- Dec 13, 2011, 3:41:45 PM (15 years ago)
- Location:
- tags/ipp-20111110/Nebulous-Server/bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20111110/Nebulous-Server/bin
- Property svn:mergeinfo changed
/trunk/Nebulous-Server/bin merged: 32919,32952
- Property svn:mergeinfo changed
-
tags/ipp-20111110/Nebulous-Server/bin/neb-admin
r32861 r32953 601 601 602 602 # Determine a list of first instances 603 # my $query = $dbh->prepare( 604 # " 605 # SELECT S.so_id,ext_id,ins_id,uri,substr(uri,-10,5) AS class_id,vol_id,name AS vol_name,host AS vol_host FROM ( 606 # select * FROM ( 607 # select MAX(ins_id) AS MAXins_id, MIN(ins_id) AS MINins_id, so_id,ext_id,value AS user_copies FROM storage_object 608 # JOIN storage_object_xattr USING(so_id) 609 # RIGHT JOIN instance USING(so_id) 610 # WHERE name = 'user.copies' 611 # AND value >= 2 612 # AND ext_id LIKE '%ota%fits' 613 # AND so_id >= $so_id_start 614 # AND so_id < $so_id_end 615 # GROUP BY so_id 616 # ) AS V 617 # WHERE MAXins_id != MINins_id 618 # ) AS S 619 # JOIN instance ON (S.MINins_id = instance.ins_id AND S.so_id = instance.so_id) 620 # JOIN volume USING(vol_id) WHERE volume.available = 1 621 # LIMIT $limit 622 # OFFSET $offset 623 # "); 603 624 my $query = $dbh->prepare( 604 625 " 605 SELECT S.so_id,ext_id,ins_id,uri,substr(uri,-10,5) AS class_id,vol_id,name AS vol_name,host AS vol_host FROM ( 606 select * FROM ( 607 select MAX(ins_id) AS MAXins_id, MIN(ins_id) AS MINins_id, so_id,ext_id,value AS user_copies FROM storage_object 608 JOIN storage_object_xattr USING(so_id) 609 RIGHT JOIN instance USING(so_id) 610 WHERE name = 'user.copies' 611 AND value >= 2 612 AND ext_id LIKE '%ota%fits' 613 AND so_id >= $so_id_start 614 AND so_id < $so_id_end 615 GROUP BY so_id 616 ) AS V 617 WHERE MAXins_id != MINins_id 618 ) AS S 619 JOIN instance ON (S.MINins_id = instance.ins_id AND S.so_id = instance.so_id) JOIN volume USING(vol_id) WHERE volume.available = 1 620 LIMIT $limit 621 OFFSET $offset 626 SELECT Z.so_id,ext_id,Z.ins_id,Z.uri,substr(Z.uri,-10,5) AS class_id,Z.vol_id,vol_name,vol_host, 627 instance.vol_id AS second_vol_id,volume.name AS second_name,volume.host AS second_host FROM ( 628 SELECT S.so_id,ext_id,ins_id,uri,substr(uri,-10,5) AS class_id,vol_id,name AS vol_name,host AS vol_host,MAXins_id FROM ( 629 select * FROM ( 630 select MAX(ins_id) AS MAXins_id, MIN(ins_id) AS MINins_id, so_id,ext_id,value AS user_copies FROM storage_object 631 JOIN storage_object_xattr USING(so_id) 632 RIGHT JOIN instance USING(so_id) 633 WHERE name = 'user.copies' 634 AND value >= 2 635 AND ext_id LIKE '%ota%fits' 636 AND so_id >= $so_id_start 637 AND so_id < $so_id_end 638 GROUP BY so_id 639 ) AS V 640 WHERE MAXins_id != MINins_id 641 ) AS S 642 JOIN instance ON (S.MINins_id = instance.ins_id AND S.so_id = instance.so_id) 643 JOIN volume USING(vol_id) WHERE volume.available = 1 644 ) AS Z 645 JOIN instance ON (MAXins_id = instance.ins_id AND Z.so_id = instance.so_id) 646 JOIN volume ON(instance.vol_id = volume.vol_id) WHERE volume.available = 1 647 LIMIT $limit 648 OFFSET $offset 622 649 "); 650 623 651 $query->execute(); 624 652 … … 654 682 my $source_host = $obj->{vol_host}; 655 683 684 my $second_vol_id = $obj->{second_vol_id}; 685 my $second_vol_name = $obj->{second_name}; 686 my $second_vol_host = $obj->{second_host}; 656 687 657 688 my $destination_vol_id = $destination{VOL}{$class_id}; … … 664 695 next; 665 696 } 666 if (defined($blocked_volume{$destination_host})) { 667 next; 668 } 697 669 698 $destination_uri =~ s/$source_name/$destination_name/; 670 699 … … 684 713 destination_host => $destination_host, 685 714 destination_uri => $destination_uri, 715 second_host => $second_vol_host, 716 second_vol_id => $second_vol_id, 717 blocked_host_bool => defined($blocked_volume{$destination_host}) 686 718 ); 719 720 if ((defined($blocked_volume{$destination_host}))|| 721 ($source_vol_id == $destination_vol_id)|| 722 ($second_vol_id == $destination_vol_id)|| 723 ($source_name eq $destination_name)|| 724 ($second_vol_name eq $destination_name)) { 725 # print_metadata("targetFailed", \%md); 726 next; 727 } 728 687 729 if ($source_vol_id != $destination_vol_id) { 688 730 print_metadata("targetPending", \%md); -
tags/ipp-20111110/Nebulous-Server/bin/neb-host
r28526 r32953 18 18 my ($host, $state, $note, 19 19 $db, $dbhost, $dbpass, $dbuser, 20 $allocate, $available, $debug );20 $allocate, $available, $debug,$volume); 21 21 22 22 # $db = $ENV{'NEB_DB'} unless $db; … … 56 56 'dbuser=s' => \$dbuser, 57 57 'dbpass=s' => \$dbpass, 58 58 'volume' => \$volume, 59 59 60 60 ) || pod2usage( 2 ); … … 98 98 99 99 my %constraint; 100 $constraint{'v.host'} = $host; 100 if (defined($volume)) { 101 $constraint{'v.name'} = $host; 102 } 103 else { 104 $constraint{'v.host'} = $host; 105 } 101 106 my %set; 102 107 $set{'v.allocate'} = $allocate if defined $allocate;
Note:
See TracChangeset
for help on using the changeset viewer.
