Changeset 24363 for trunk/Nebulous-Server
- Timestamp:
- Jun 9, 2009, 2:57:48 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r24362 r24363 427 427 $query->finish; 428 428 } 429 $log->logdie("failed to get LAST_INSERT_ID()")429 die("failed to get LAST_INSERT_ID()") 430 430 unless $parent_id; 431 431 … … 504 504 unless ($rows == 1) { 505 505 $query->finish; 506 $log->logdie("affected row count is $rows instead of 1");506 die("affected row count is $rows instead of 1"); 507 507 } 508 508 … … 591 591 unless ($rows == 1) { 592 592 $query->finish; 593 $log->logdie("affected row count is $rows instead of 1");593 die("affected row count is $rows instead of 1"); 594 594 } 595 595 } … … 604 604 unless ($rows == 1) { 605 605 $query->finish; 606 $log->logdie("affected row count is $rows instead of 1");606 die("affected row count is $rows instead of 1"); 607 607 } 608 608 } … … 617 617 unless ($rows == 1) { 618 618 $query->finish; 619 $log->logdie("affected row count is $rows instead of 1");619 die("affected row count is $rows instead of 1"); 620 620 } 621 621 } … … 733 733 unless ( $rows > 0 ) { 734 734 $query->finish; 735 $log->logdie( "storage object does not exist" );735 die( "storage object does not exist" ); 736 736 } 737 737 … … 854 854 unless ( $rows == 1 ) { 855 855 $query->finish; 856 $log->logdie( "storage object does not exist" );856 die( "storage object does not exist" ); 857 857 } 858 858 … … 869 869 # can't set a write lock if there are read locks 870 870 if ($write_lock) { 871 $log->logdie("can not write lock twice -- retry");871 die("can not write lock twice -- retry"); 872 872 } 873 873 874 874 if ($read_lock > 0) { 875 $log->logdie("can not write lock after read lock -- retry");875 die("can not write lock after read lock -- retry"); 876 876 } 877 877 … … 882 882 # if we affected more then one row something very bad has happened. 883 883 unless ($rows == 1) { 884 $log->logdie("affected row count is $rows instead of 1");884 die("affected row count is $rows instead of 1"); 885 885 } 886 886 … … 889 889 # can't set a read lock if there's a write lock 890 890 if ($write_lock) { 891 $log->logdie("can not read lock after write lock -- retry");891 die("can not read lock after write lock -- retry"); 892 892 } 893 893 … … 898 898 # if we affected more then one row something very bad has happened. 899 899 unless ($rows == 1) { 900 $log->logdie("affected row count is $rows instead of 1");900 die("affected row count is $rows instead of 1"); 901 901 } 902 902 } … … 968 968 unless ($rows == 1) { 969 969 $query->finish; 970 $log->logdie("storage object does not exist");970 die("storage object does not exist"); 971 971 } 972 972 … … 982 982 # can't remove a write lock if it doesn't exist 983 983 if ($read_lock) { 984 $log->logdie("can not have a write lock under a read lock");984 die("can not have a write lock under a read lock"); 985 985 } 986 986 987 987 unless ($write_lock) { 988 $log->logdie("can not remove non-existant write lock");988 die("can not remove non-existant write lock"); 989 989 } 990 990 … … 995 995 # if we affected more then one row something very bad has happened. 996 996 unless ($rows == 1) { 997 $log->logdie("affected row count is $rows instead of 1");997 die("affected row count is $rows instead of 1"); 998 998 } 999 999 } … … 1002 1002 # can't remove a read lock if there aren't any 1003 1003 if ($write_lock) { 1004 $log->logdie("can not have a read lock under a write lock");1004 die("can not have a read lock under a write lock"); 1005 1005 } 1006 1006 1007 1007 if ($read_lock == 0) { 1008 $log->logdie("can not remove non-existant read lock");1008 die("can not remove non-existant read lock"); 1009 1009 } 1010 1010 … … 1015 1015 # if we affected more then one row something very bad has happened. 1016 1016 unless ($rows == 1) { 1017 $log->logdie("affected row count is $rows instead of 1");1017 die("affected row count is $rows instead of 1"); 1018 1018 } 1019 1019 … … 1101 1101 if ($flags eq 'create') { 1102 1102 unless ($rows == 1) { 1103 $log->logdie( "affected row count is $rows instead of 1" );1103 die( "affected row count is $rows instead of 1" ); 1104 1104 } 1105 1105 } else { … … 1107 1107 # the case of a replace and 1 if the xattr didn't already exist. 1108 1108 unless ($rows == 1 or $rows == 2) { 1109 $log->logdie( "affected row count is $rows instead of 2" );1109 die( "affected row count is $rows instead of 2" ); 1110 1110 } 1111 1111 } … … 1174 1174 if ($rows == 0) { 1175 1175 $query->finish; 1176 $log->logdie( "xattr $key:$name does not exist" );1176 die( "xattr $key:$name does not exist" ); 1177 1177 } 1178 1178 # if we go more then one row bad something very bad has happened. 1179 1179 unless ($rows == 1) { 1180 1180 $query->finish; 1181 $log->logdie( "affected row count is $rows instead of 1" );1181 die( "affected row count is $rows instead of 1" ); 1182 1182 } 1183 1183 … … 1282 1282 # no rows affected means the xattr did not exist 1283 1283 if ($rows == 0) { 1284 $log->logdie( "xattr $key:$name does not exist" );1284 die( "xattr $key:$name does not exist" ); 1285 1285 } 1286 1286 1287 1287 # if we affected more then one row something very bad has happened. 1288 1288 if ($rows > 1) { 1289 $log->logdie( "affected row count is $rows instead of 1" );1289 die( "affected row count is $rows instead of 1" ); 1290 1290 } 1291 1291 … … 1481 1481 unless ($rows > 0) { 1482 1482 $query->finish; 1483 $log->logdie("no instances on storage volume or volume is not avaiable for key: $key volume: $vol_name");1483 die("no instances on storage volume or volume is not avaiable for key: $key volume: $vol_name"); 1484 1484 } 1485 1485 } else { … … 1489 1489 unless ($rows > 0) { 1490 1490 $query->finish; 1491 $log->logdie("no instances available for key: $key");1491 die("no instances available for key: $key"); 1492 1492 } 1493 1493 } … … 1559 1559 unless ( $rows > 0 ) { 1560 1560 $query->finish; 1561 $log->logdie( "no instance is associated with uri" );1561 die( "no instance is associated with uri" ); 1562 1562 } 1563 1563 … … 1584 1584 # has happened 1585 1585 unless ( $rows == 1 ) { 1586 $log->logdie( "affected row count is $rows instead of 1" );1586 die( "affected row count is $rows instead of 1" ); 1587 1587 } 1588 1588 } … … 1601 1601 # TODO: this will have to be changed in order to support hardlinks 1602 1602 unless ( $rows == 1 ) { 1603 $log->logdie( "affected row count is $rows instead of 2" );1603 die( "affected row count is $rows instead of 2" ); 1604 1604 } 1605 1605 } … … 1658 1658 1659 1659 unless ($rows == 1) { 1660 $log->logdie("no storage object found");1660 die("no storage object found"); 1661 1661 } 1662 1662 … … 1817 1817 return; # this just returns out of the eval not from the subroutine 1818 1818 } 1819 $log->logdie("storage volume: $name is not available");1819 die("storage volume: $name is not available"); 1820 1820 } 1821 1821 # when matching by name we shouldn't ever match more than once 1822 1822 if ($rows > 1) { 1823 1823 $query->finish; 1824 $log->logdie("affected row count is $rows instead of 1");1824 die("affected row count is $rows instead of 1"); 1825 1825 } 1826 1826 } else { … … 1831 1831 unless ($rows > 0) { 1832 1832 $query->finish; 1833 $log->logdie("no storage volume is available for key: $key volume: $name hard_volume: $hard_volume");1833 die("no storage volume is available for key: $key volume: $name hard_volume: $hard_volume"); 1834 1834 } 1835 1835 } … … 1873 1873 unless ($rows > 0) { 1874 1874 $query->finish; 1875 $log->logdie("can't find a suitable storage volume to replicate $key to");1875 die("can't find a suitable storage volume to replicate $key to"); 1876 1876 } 1877 1877 # when matching by name we shouldn't ever match more than once 1878 1878 if ($rows > 1) { 1879 1879 $query->finish; 1880 $log->logdie("affected row count is $rows instead of 1");1880 die("affected row count is $rows instead of 1"); 1881 1881 } 1882 1882 … … 2022 2022 unless (-d $storage_path) { 2023 2023 $self->_retry(sub { mkpath([$storage_path], 0, 0775) }) 2024 or $log->logdie("can't create storage path: $storage_path");2024 or die("can't create storage path: $storage_path"); 2025 2025 } 2026 2026 # check to make sure at least the parent directory has the proper … … 2030 2030 $log->error("$storage_path has the wrong permissions of: 0", sprintf("%o", $mode)); 2031 2031 $self->_retry(sub { chmod(0775, $storage_path) }) 2032 or $log->logdie("can not chmod() $storage_path: $!");2032 or die("can not chmod() $storage_path: $!"); 2033 2033 } 2034 2034
Note:
See TracChangeset
for help on using the changeset viewer.
