Commit 0789a755 authored by Eric Cano's avatar Eric Cano
Browse files

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the...

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the triggers that populate it.

The testing scipt now runs reasonably well, delivering a system where copies can be migrated from scratch. Migration to
new schema fails for some reason...
parent 7cfa43bd
......@@ -670,6 +670,14 @@ sub executeSQLPlusScript ( $$$$$ )
print("\n");
print("$title RESULT\n");
print("===================\n");
my @result_array = split(/\n/, $result);
$result = "";
for (@result_array) {
# Pass on the boring "everything's fine" messages.
if (! /^((Package(| body)|Function|Table|Index|Trigger|Procedure|View|\d row(|s)) (created|altered|updated)\.|)$/) {
$result .= $_."\n";
}
}
print($result);
}
......@@ -759,24 +767,25 @@ sub wipeAndRecreateDefaultLxcastodev03 ()
print($rmGetNodesResult);
# Fill database with the standard set-up for a dev-box
`nslistclass | grep NAME | awk '{print \$2}' | xargs -i enterFileClass --Name {} --GetFromCns`;
print `nslistclass | grep NAME | awk '{print \$2}' | xargs -i enterFileClass --Name {} --GetFromCns`;
`enterSvcClass --Name default --DiskPools default --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes --NbDrives 1 --TapePool stager_dev04 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
`enterSvcClass --Name dev --DiskPools extra --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes`;
`enterSvcClass --Name diskonly --DiskPools extra --ForcedFileClass temp --DefaultFileSize 10485760 --Disk1Behavior yes --FailJobsWhenNoSpace yes`;
print `enterSvcClass --Name default --DiskPools default --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes --NbDrives 1 --TapePool stager_dev04 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
print `enterSvcClass --Name dev --DiskPools extra --DefaultFileSize 10485760 --FailJobsWhenNoSpace yes`;
print `enterSvcClass --Name diskonly --DiskPools extra --ForcedFileClass temp --DefaultFileSize 10485760 --Disk1Behavior yes --FailJobsWhenNoSpace yes`;
`moveDiskServer default lxc2disk05.cern.ch`;
`moveDiskServer extra lxc2disk06.cern.ch`;
print `moveDiskServer default lxc2disk05.cern.ch`;
print `moveDiskServer extra lxc2disk06.cern.ch`;
`rmAdminNode -r -R -n lxc2disk05.cern.ch`;
`rmAdminNode -r -R -n lxc2disk06.cern.ch`;
print `rmAdminNode -r -R -n lxc2disk05.cern.ch`;
print `rmAdminNode -r -R -n lxc2disk06.cern.ch`;
# Add a tape-pool to dev service-class ready for shared tape-pool tests
`modifySvcClass --Name dev --AddTapePool stager_dev03_2 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
print `modifySvcClass --Name dev --AddTapePool stager_dev03_2 --MigratorPolicy defaultMigrationPolicy --StreamPolicy streamPolicyAlwaysReturning1`;
# Set the number of drives on the default and dev service-classes to desired number for each
`modifySvcClass --Name default --NbDrives 1`;
`modifySvcClass --Name dev --NbDrives 2`;
print `modifySvcClass --Name default --NbDrives 1`;
print `modifySvcClass --Name dev --NbDrives 2`;
print `modifySvcClass --Name dev --AddTapePool stager_dev03_2`;
$dbh->disconnect();
undef $dbh;
......@@ -850,9 +859,7 @@ sub startDaemons ()
'stagerd',
'tapegatewayd') {
if (/tapegatewayd/) {
`( cd $checkout_location; LD_LIBRARY_PATH=\`find ./ -name "*.so*" \
| perl -p -e \'s|[^/]*\$|\n|\' | sort | uniq | tr \"\n\" \":\" \
| perl -p -e \'s/:\$/\n/\'\` ./castor/tape/tapegateway/tapegatewayd)`
`( cd $checkout_location; LD_LIBRARY_PATH=\`find ./ -name "*.so*" | perl -p -e \'s|[^/]*\$|\n|\' | sort | uniq | tr \"\n\" \":\" | perl -p -e \'s/:\$/\n/\'\` ./castor/tape/tapegateway/tapegatewayd)`
} else {
`service $_ start`
}
......@@ -872,7 +879,65 @@ sub goodDaySingleAndDualCopyTest ()
################################################################################
wipeAndRecreateDefaultLxcastodev03();
startDaemons();
open CMD, 'su canoc3 -c "( cd '.$checkout_location.'; pwd;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_single_tape_copy_files 100 2;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_dual_tape_copy_files 100 2; )" |';
while (<CMD>) {
print $_;
}
my $dbh=open_db();
my $timeout = 10*60;
my $start_time=`date +%s`;
while (check_leftovers($dbh)) {
if (`date +%s`> $start_time + $timeout) {
print "Timeout expired for migration of files.";
print_leftovers ($dbh);
die;
}
sleep(5);
}
migrateToNewTapeGatewaySchema ();
startDaemons ();
open CMD, 'su canoc3 -c "( cd '.$checkout_location.'; pwd;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_single_tape_copy_files 100 2;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_dual_tape_copy_files 100 2; )" |';
while (<CMD>) {
print $_;
}
$timeout = 10*60;
$start_time=`date +%s`;
while (check_leftovers($dbh)) {
if (`date +%s` > $start_time + $timeout) {
print "Timeout expired for migration of files.";
print_leftovers ($dbh);
die;
}
sleep(5);
}
stopAndSwitchToTapeGatewayd($dbh);
startDaemons ();
open CMD, 'su canoc3 -c "( cd '.$checkout_location.'; pwd;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_single_tape_copy_files 100 2;'.
'sh test/tapegateway_release_tests/createAndCopyFilesToCastor.sh lxcastordev03 dev lxcastorsrv101 /castor/cern.ch/dev/c/canoc3/migrate_and_recall_10_dual_tape_copy_files 100 2; )" |';
while (<CMD>) {
print $_;
}
$timeout = 10*60;
$start_time=`date +%s`;
while (check_leftovers($dbh)) {
if (`date +%s` > $start_time + $timeout) {
print "Timeout expired for migration of files.";
print_leftovers ($dbh);
die;
}
sleep(5);
}
$dbh->disconnect();
#END {
# `rm $tmpDropSchema` if(defined($tmpDropSchema));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment