yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #01685
[Bug 1133235] Re: downgrading baremetal db (sqlite) from 004 to 003 does not drop a column added by upgrade
** Changed in: nova
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1133235
Title:
downgrading baremetal db (sqlite) from 004 to 003 does not drop a
column added by upgrade
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
How to reproduce:
In nova.conf, specify sqlite for baremetal db
[baremetal]
sql_connection = sqlite:////tmp/b.db
Ensure the db file is newly created
$ rm /tmp/b.db
Upgrade to version 4
$ nova-baremetal-manage db sync --version 4
instance_name was added to bm_nodes by upgradeing
$ sqlite3 /tmp/b.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema bm_nodes
CREATE TABLE bm_nodes (
created_at DATETIME,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOLEAN,
id INTEGER NOT NULL,
cpus INTEGER,
memory_mb INTEGER,
local_gb INTEGER,
pm_address VARCHAR(255),
pm_user VARCHAR(255),
pm_password VARCHAR(255),
service_host VARCHAR(255),
prov_mac_address VARCHAR(255),
instance_uuid VARCHAR(36),
registration_status VARCHAR(16),
task_state VARCHAR(255),
prov_vlan_id INTEGER,
terminal_port INTEGER, image_path VARCHAR(255), pxe_config_path VARCHAR(255), deploy_key VARCHAR(255), root_mb INTEGER, swap_mb INTEGER, uuid VARCHAR(36), instance_name VARCHAR(255),
PRIMARY KEY (id),
CHECK (deleted IN (0, 1))
);
CREATE INDEX deploy_key_idx ON bm_nodes (deploy_key);
CREATE INDEX idx_bm_nodes_hmcld ON bm_nodes (service_host, memory_mb, cpus, local_gb, deleted);
CREATE INDEX idx_bm_nodes_instance_uuid_deleted ON bm_nodes (instance_uuid, deleted);
CREATE INDEX idx_bm_nodes_service_host_deleted ON bm_nodes (service_host, deleted);
CREATE UNIQUE INDEX uuid_ux ON bm_nodes (uuid);
sqlite>
Downgrade to version 3
$ nova-baremetal-manage db sync --version 3
instance_name should be dropped, but it still exists
$ sqlite3 /tmp/b.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema bm_nodes
CREATE TABLE bm_nodes (
created_at DATETIME,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOLEAN,
id INTEGER NOT NULL,
cpus INTEGER,
memory_mb INTEGER,
local_gb INTEGER,
pm_address VARCHAR(255),
pm_user VARCHAR(255),
pm_password VARCHAR(255),
service_host VARCHAR(255),
prov_mac_address VARCHAR(255),
instance_uuid VARCHAR(36),
registration_status VARCHAR(16),
task_state VARCHAR(255),
prov_vlan_id INTEGER,
terminal_port INTEGER,
image_path VARCHAR(255),
pxe_config_path VARCHAR(255),
deploy_key VARCHAR(255),
root_mb INTEGER,
swap_mb INTEGER,
uuid VARCHAR(36),
instance_name VARCHAR(255),
PRIMARY KEY (id),
CHECK (deleted IN (0, 1))
);
CREATE INDEX deploy_key_idx ON bm_nodes (deploy_key);
CREATE INDEX idx_bm_nodes_hmcld ON bm_nodes (service_host, memory_mb, cpus, local_gb, deleted);
CREATE INDEX idx_bm_nodes_instance_uuid_deleted ON bm_nodes (instance_uuid, deleted);
CREATE INDEX idx_bm_nodes_service_host_deleted ON bm_nodes (service_host, deleted);
CREATE UNIQUE INDEX uuid_ux ON bm_nodes (uuid);
sqlite>
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1133235/+subscriptions