Commit f55548f7 authored by Kirk Webb's avatar Kirk Webb

DB state for simultaneous read-only datasets site variable.

parent 8de1ff63
......@@ -149,6 +149,7 @@ INSERT INTO sitevariables VALUES ('storage/ltdataset/maxsize',NULL,'0','Max size
INSERT INTO sitevariables VALUES ('storage/ltdataset/graceperiod',NULL,'180','Time (days) before an expired dataset will be destroyed (0 == no grace period)',0);
INSERT INTO sitevariables VALUES ('storage/ltdataset/maxidle',NULL,'180','Max time (days) from last use before lease is marked expired (0 == unlimited)',0);
INSERT INTO sitevariables VALUES ('general/disk_trim_interval',NULL,'0','If non-zero, minimum interval (seconds) between attempts to TRIM boot disk during disk reloading. Zero disables all TRIM activity. Node must also have non-zero bootdisk_trim attribute.',0);
INSERT INTO sitevariables VALUES ('storage/simultaneous_ro_datasets',NULL,'0','If set, allow simultaneous read-only mounts of datasets',0);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
#
# Create site variable for simultaneous read-only dataset access.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $var = "storage/simultaneous_ro_datasets";
if (!TBSiteVarExists($var)) {
my $desc = "If set, allow simultaneous read-only mounts of datasets";
my $defval = "0";
DBQueryFatal("INSERT INTO sitevariables VALUES ".
"('$var',NULL,'$defval','$desc',0)");
}
return 0;
}
1;
......@@ -1651,8 +1651,8 @@ sub LoadVirtNodes($)
}
# If sitevar disables simultaneous use, catch it now.
if ((!SiteVarExists("storage/simultaneous_ro_datasets") ||
int(GetSiteVar("storage/simultaneous_ro_datasets")) != 1) &&
if ((!TBSiteVarExists("storage/simultaneous_ro_datasets") ||
int(TBGetSiteVar("storage/simultaneous_ro_datasets")) != 1) &&
$lease->InUse()) {
tberror("Dataset $lease is currently in use, so cannot be accessed at this time.\n");
return -1;
......
Markdown is supported
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