Commit c86aa1b1 authored by Kirk Webb's avatar Kirk Webb

Merge branch 'stordev'

parents c441e137 605df852
......@@ -134,6 +134,51 @@ CREATE TABLE `blobs` (
PRIMARY KEY (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `blockstore_state`
--
DROP TABLE IF EXISTS `blockstore_state`;
CREATE TABLE `blockstore_state` (
`bsidx` int(10) unsigned NOT NULL,
`node_id` varchar(32) NOT NULL default '',
`bs_id` varchar(32) NOT NULL default '',
`remaining_capacity` int(10) unsigned NOT NULL default '0',
`ready` tinyint(4) unsigned NOT NULL default '0',
PRIMARY KEY (`bsidx`),
UNIQUE KEY nidbid (`node_id`,`bs_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `blockstore_type_attributes`
--
DROP TABLE IF EXISTS `blockstore_type_attributes`;
CREATE TABLE `blockstore_type_attributes` (
`type` varchar(30) NOT NULL default '',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`type`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `blockstores`
--
DROP TABLE IF EXISTS `blockstores`;
CREATE TABLE `blockstores` (
`bsidx` int(10) unsigned NOT NULL,
`node_id` varchar(32) NOT NULL default '',
`bs_id` varchar(32) NOT NULL default '',
`type` varchar(30) NOT NULL default '',
`role` enum('infra','unused') NOT NULL default 'unused',
`total_size` int(10) unsigned NOT NULL default '0',
`inception` datetime default NULL,
PRIMARY KEY (`bsidx`),
UNIQUE KEY nidbid (`node_id`,`bs_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `bridges`
--
......@@ -3536,8 +3581,28 @@ CREATE TABLE `reserved` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `scheduled_reloads`
-- Table structure for table `reserved_blockstores`
--
DROP TABLE IF EXISTS `reserved_blockstores`;
CREATE TABLE `reserved_blockstores` (
`bsidx` int(10) unsigned NOT NULL,
`node_id` varchar(32) NOT NULL default '',
`bs_id` varchar(32) NOT NULL default '',
`vname` varchar(32) NOT NULL default '',
`pid` varchar(48) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`exptidx` int(11) NOT NULL default '0',
`rsrv_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`exptidx`,`bsidx`,`vname`),
UNIQUE KEY `vname` (`exptidx`,`vname`),
KEY `nidbid` (`node_id`,`bs_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `reserved_vlantags`
--
DROP TABLE IF EXISTS `reserved_vlantags`;
CREATE TABLE `reserved_vlantags` (
`pid` varchar(48) NOT NULL default '',
......@@ -4269,6 +4334,38 @@ CREATE TABLE `virt_blobs` (
PRIMARY KEY (`exptidx`,`vblob_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `virt_blockstore_attributes`
--
DROP TABLE IF EXISTS `virt_blockstore_attributes`;
CREATE TABLE `virt_blockstore_attributes` (
`pid` varchar(48) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`exptidx` int(11) NOT NULL default '0',
`vname` varchar(32) NOT NULL default '',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`exptidx`,`vname`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `virt_blockstores`
--
DROP TABLE IF EXISTS `virt_blockstores`;
CREATE TABLE `virt_blockstores` (
`pid` varchar(48) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`exptidx` int(11) NOT NULL default '0',
`vname` varchar(32) NOT NULL default '',
`type` varchar(30) default NULL,
`role` enum('remote','local','unknown') NOT NULL default 'unknown',
`size` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`exptidx`,`vname`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `virt_bridges`
--
......
......@@ -1213,6 +1213,18 @@ REPLACE INTO table_regex VALUES ('virt_client_service_hooks','service_idx','int'
REPLACE INTO table_regex VALUES ('virt_client_service_hooks','vnode','text','redirect','virt_nodes:vname',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_client_service_hooks','whence','text','regex','^(first|every)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','vname','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','type','text','regex','^[-\\w]*$',0,30,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','role','text','regex','^(remote|local|unknown)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstores','size','int','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','vname','text','redirect','virt_blockstores:vname',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','attrkey','text','regex','^[-\\w]+$',1,64,NULL);
REPLACE INTO table_regex VALUES ('virt_blockstore_attributes','attrvalue','text','regex','^[-\\w\\.\\+,\\s\\/:]+$',0,255,NULL);
REPLACE INTO table_regex VALUES ('default','fulltext','text','regex','^[\\040-\\073\\075\\077-\\176\\012\\015\\011]*$',0,20000,NULL);
REPLACE INTO table_regex VALUES ('default','html_fulltext','text','regex','^[\\040-\\176\\012\\015\\011]*$',0,20000,NULL);
......
#
# Introduce blockstore storage objects.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBTableExists("blockstores")) {
DBQueryFatal("CREATE TABLE `blockstores` ( ".
" `bsidx` int(10) unsigned NOT NULL,".
" `node_id` varchar(32) NOT NULL default '',".
" `bs_id` varchar(32) NOT NULL default '',".
" `type` varchar(30) NOT NULL default '',".
" `role` enum('infra','unused') NOT NULL default 'unused',".
" `total_size` int(10) unsigned NOT NULL default '0',".
" `inception` datetime default NULL,".
" PRIMARY KEY (`bsidx`),".
" UNIQUE KEY nidbid (`node_id`,`bs_id`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("blockstore_type_attributes")) {
DBQueryFatal("CREATE TABLE `blockstore_type_attributes` (".
" `type` varchar(30) NOT NULL default '',".
" `attrkey` varchar(32) NOT NULL default '',".
" `attrvalue` tinytext NOT NULL,".
" `attrtype` enum('integer','float','boolean','string') default 'string',".
" PRIMARY KEY (`type`,`attrkey`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("blockstore_state")) {
DBQueryFatal("CREATE TABLE `blockstore_state` (".
" `bsidx` int(10) unsigned NOT NULL,".
" `node_id` varchar(32) NOT NULL default '',".
" `bs_id` varchar(32) NOT NULL default '',".
" `remaining_capacity` int(10) unsigned NOT NULL default '0',".
" `ready` tinyint(4) unsigned NOT NULL default '0',".
" PRIMARY KEY (`bsidx`),".
" UNIQUE KEY nidbid (`node_id`,`bs_id`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("virt_blockstores")) {
DBQueryFatal("CREATE TABLE `virt_blockstores` (".
" `pid` varchar(48) NOT NULL default '',".
" `eid` varchar(32) NOT NULL default '',".
" `exptidx` int(11) NOT NULL default '0',".
" `vname` varchar(32) NOT NULL default '',".
" `type` varchar(30) default NULL,".
" `role` enum('remote','local','unknown') NOT NULL default 'unknown',".
" `size` int(10) unsigned NOT NULL default '0',".
" PRIMARY KEY (`exptidx`,`vname`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("virt_blockstore_attributes")) {
DBQueryFatal("CREATE TABLE `virt_blockstore_attributes` (".
" `pid` varchar(48) NOT NULL default '',".
" `eid` varchar(32) NOT NULL default '',".
" `exptidx` int(11) NOT NULL default '0',".
" `vname` varchar(32) NOT NULL default '',".
" `attrkey` varchar(32) NOT NULL default '',".
" `attrvalue` tinytext NOT NULL,".
" `attrtype` enum('integer','float','boolean','string') default 'string',".
" PRIMARY KEY (`exptidx`,`vname`,`attrkey`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (!DBTableExists("reserved_blockstores")) {
DBQueryFatal("CREATE TABLE `reserved_blockstores` (".
" `bsidx` int(10) unsigned NOT NULL,".
" `node_id` varchar(32) NOT NULL default '',".
" `bs_id` varchar(32) NOT NULL default '',".
" `vname` varchar(32) NOT NULL default '',".
" `pid` varchar(48) NOT NULL default '',".
" `eid` varchar(32) NOT NULL default '',".
" `exptidx` int(11) NOT NULL default '0',".
" `rsrv_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,".
" PRIMARY KEY (`exptidx`,`bsidx`,`vname`),".
" UNIQUE KEY `vname` (`exptidx`,`vname`),".
" KEY `nidbid` (`node_id`,`bs_id`)".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','pid','text','redirect',".
"'projects:pid',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','eid','text','redirect',".
"'experiments:eid',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','vname','text','regex',".
"'^[-\\\\w]+\$',1,32,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','type','text','regex',".
"'^[-\\\\w]*\$',0,30,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','role','text','regex',".
"'^(remote|local|unknown)\$',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstores','size','int','redirect',".
"'default:int',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstore_attributes','pid','text','redirect',".
"'projects:pid',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstore_attributes','eid','text','redirect',".
"'experiments:eid',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstore_attributes','vname','text','redirect',".
"'virt_blockstores:vname',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstore_attributes','attrkey','text','regex',".
"'^[-\\\\w]+\$',1,64,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('virt_blockstore_attributes','attrvalue','text','regex',".
"'^[-\\\\w\\\\.\\\\+,\\\\s\\\\/:]+\$',0,255,NULL)");
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
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