Commit 0886d353 authored by Leigh B Stoller's avatar Leigh B Stoller

Changes to support recording virtual nodes in the node_history table.

Add cnet_ip and phys_nodeid slots, and change the type field enum
adding create and destroy.
parent 57c56278
......@@ -2368,11 +2368,13 @@ DROP TABLE IF EXISTS `node_history`;
CREATE TABLE `node_history` (
`history_id` int(10) unsigned NOT NULL auto_increment,
`node_id` varchar(32) NOT NULL default '',
`op` enum('alloc','free','move') NOT NULL default 'alloc',
`op` enum('alloc','free','move','create','destroy') NOT NULL default 'alloc',
`uid` varchar(8) NOT NULL default '',
`uid_idx` mediumint(8) unsigned NOT NULL default '0',
`exptidx` int(10) unsigned default NULL,
`stamp` int(10) unsigned default NULL,
`cnet_IP` varchar(15) default NULL,
`phys_nodeid` varchar(32) default NULL,
PRIMARY KEY (`history_id`),
KEY `node_id` (`node_id`,`history_id`)
# Add more slots to node_history to allow recording dynamic virtual nodes.
use strict;
use libdb;
sub DoUpdate($$$)
my ($dbhandle, $dbname, $version) = @_;
my $type = DBSlotType("node_history", "op");
if (!$type) {
Fatal("No 'op' slot in 'node_history' table");
if (! ($type =~ /create/)) {
DBQueryFatal("alter table node_history change `op` `op` ".
" enum('alloc','free','move','create','destroy') ".
" NOT NULL default 'alloc'");
if (!DBSlotExists("node_history", "cnet_IP")) {
print " *** Updating a big table ... please be very patient.\n";
DBQueryFatal("alter table node_history ".
" add `cnet_IP` varchar(15) default NULL, ".
" add `phys_nodeid` varchar(32) default NULL");
return 0;
# 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