Changeset 16244
- Timestamp:
- Jan 25, 2008, 4:04:46 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
Nebulous-Server/Changes (modified) (1 diff)
-
Nebulous-Server/Todo (modified) (1 diff)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (3 diffs)
-
Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (8 diffs)
-
Nebulous/Changes (modified) (1 diff)
-
Nebulous/Todo (modified) (1 diff)
-
Nebulous/lib/Nebulous/Server.pm (modified) (3 diffs)
-
Nebulous/lib/Nebulous/Server/SQL.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r16238 r16244 2 2 3 3 0.07 4 - redo database schema with foreign keys 4 5 - add Nebulous::Keys pod 5 6 -
trunk/Nebulous-Server/Todo
r16243 r16244 7 7 - add support for SQL and/or Apache logging 8 8 - make copy replicate source attributes, implement as replicate/reparent? 9 - redo database schema with foreign keys10 9 - validation of URIs 11 10 - test that client->delete_instance removes the storage object too -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r16224 r16244 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1. 49 2008-01-25 02:11:23jhoblitt Exp $3 # $Id: Server.pm,v 1.50 2008-01-26 02:04:46 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 1004 1004 $query->finish; 1005 1005 1006 # if we affected something other then one rowsomething very bad1006 # if we affected something other then two rows something very bad 1007 1007 # has happened 1008 1008 unless ( $rows == 1 ) { … … 1019 1019 $query->finish; 1020 1020 1021 # if we affected something other then two rows something very bad 1022 # has happened 1023 # this will have to be changed in order to support hardlinks 1024 unless ( $rows == 2 ) { 1021 # TODO: this will have to be changed in order to support hardlinks 1022 unless ( $rows == 1 ) { 1025 1023 $log->logdie( "affected row count is $rows instead of 2" ); 1026 1024 } -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r16181 r16244 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1.4 3 2008-01-22 21:27:46 jhoblitt Exp $3 # $Id: SQL.pm,v 1.44 2008-01-26 02:04:46 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 35 35 }, 36 36 delete_object => qq{ 37 DELETE 38 storage_object, 39 storage_object_attr 40 FROM storage_object 41 JOIN storage_object_attr 42 USING (so_id) 37 DELETE FROM storage_object 43 38 WHERE storage_object.so_id = ? 44 39 }, … … 310 305 CREATE TABLE storage_object_attr ( 311 306 so_id BIGINT NOT NULL AUTO_INCREMENT, 307 FOREIGN KEY(so_id) REFERENCES storage_object(so_id) ON DELETE CASCADE, 312 308 read_lock TINYINT DEFAULT 0 NOT NULL, 313 309 write_lock ENUM( 'write' ), … … 321 317 CREATE TABLE storage_object_xattr ( 322 318 so_id BIGINT NOT NULL AUTO_INCREMENT, 319 FOREIGN KEY(so_id) REFERENCES storage_object(so_id) ON DELETE CASCADE, 323 320 name VARCHAR(255), 324 321 value BLOB, … … 331 328 ins_id BIGINT NOT NULL AUTO_INCREMENT, 332 329 so_id BIGINT NOT NULL, 330 FOREIGN KEY(so_id) REFERENCES storage_object(so_id), 333 331 vol_id INT NOT NULL, 334 332 uri VARCHAR(255) NOT NULL UNIQUE, … … 347 345 CREATE TABLE lock_record ( 348 346 so_id BIGINT NOT NULL, 347 FOREIGN KEY(so_id) REFERENCES storage_object(so_id), 349 348 type ENUM( 'read', 'write' ) NOT NULL, 350 349 epoch TIMESTAMP, … … 363 362 PRIMARY KEY(vol_id), 364 363 KEY(name(16)), 364 KEY(path(255)), 365 365 KEY(allocate), 366 366 KEY(available) … … 391 391 CREATE TABLE mountedvol( 392 392 mountpoint VARCHAR(255) NOT NULL, 393 FOREIGN KEY(mountpoint) REFERENCES mount(mountpoint), 393 394 total BIGINT NOT NULL, 394 395 used BIGINT NOT NULL, 395 396 vol_id INT NOT NULL, 397 FOREIGN KEY(vol_id) REFERENCES volume(vol_id), 396 398 name VARCHAR(255) NOT NULL, 397 399 path VARCHAR(255) NOT NULL, 400 FOREIGN KEY(path) REFERENCES volume(path), 398 401 allocate BOOLEAN DEFAULT FALSE, 399 402 available BOOLEAN DEFAULT FALSE, -
trunk/Nebulous/Changes
r16238 r16244 2 2 3 3 0.07 4 - redo database schema with foreign keys 4 5 - add Nebulous::Keys pod 5 6 -
trunk/Nebulous/Todo
r16243 r16244 7 7 - add support for SQL and/or Apache logging 8 8 - make copy replicate source attributes, implement as replicate/reparent? 9 - redo database schema with foreign keys10 9 - validation of URIs 11 10 - test that client->delete_instance removes the storage object too -
trunk/Nebulous/lib/Nebulous/Server.pm
r16224 r16244 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1. 49 2008-01-25 02:11:23jhoblitt Exp $3 # $Id: Server.pm,v 1.50 2008-01-26 02:04:46 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 1004 1004 $query->finish; 1005 1005 1006 # if we affected something other then one rowsomething very bad1006 # if we affected something other then two rows something very bad 1007 1007 # has happened 1008 1008 unless ( $rows == 1 ) { … … 1019 1019 $query->finish; 1020 1020 1021 # if we affected something other then two rows something very bad 1022 # has happened 1023 # this will have to be changed in order to support hardlinks 1024 unless ( $rows == 2 ) { 1021 # TODO: this will have to be changed in order to support hardlinks 1022 unless ( $rows == 1 ) { 1025 1023 $log->logdie( "affected row count is $rows instead of 2" ); 1026 1024 } -
trunk/Nebulous/lib/Nebulous/Server/SQL.pm
r16181 r16244 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1.4 3 2008-01-22 21:27:46 jhoblitt Exp $3 # $Id: SQL.pm,v 1.44 2008-01-26 02:04:46 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 35 35 }, 36 36 delete_object => qq{ 37 DELETE 38 storage_object, 39 storage_object_attr 40 FROM storage_object 41 JOIN storage_object_attr 42 USING (so_id) 37 DELETE FROM storage_object 43 38 WHERE storage_object.so_id = ? 44 39 }, … … 310 305 CREATE TABLE storage_object_attr ( 311 306 so_id BIGINT NOT NULL AUTO_INCREMENT, 307 FOREIGN KEY(so_id) REFERENCES storage_object(so_id) ON DELETE CASCADE, 312 308 read_lock TINYINT DEFAULT 0 NOT NULL, 313 309 write_lock ENUM( 'write' ), … … 321 317 CREATE TABLE storage_object_xattr ( 322 318 so_id BIGINT NOT NULL AUTO_INCREMENT, 319 FOREIGN KEY(so_id) REFERENCES storage_object(so_id) ON DELETE CASCADE, 323 320 name VARCHAR(255), 324 321 value BLOB, … … 331 328 ins_id BIGINT NOT NULL AUTO_INCREMENT, 332 329 so_id BIGINT NOT NULL, 330 FOREIGN KEY(so_id) REFERENCES storage_object(so_id), 333 331 vol_id INT NOT NULL, 334 332 uri VARCHAR(255) NOT NULL UNIQUE, … … 347 345 CREATE TABLE lock_record ( 348 346 so_id BIGINT NOT NULL, 347 FOREIGN KEY(so_id) REFERENCES storage_object(so_id), 349 348 type ENUM( 'read', 'write' ) NOT NULL, 350 349 epoch TIMESTAMP, … … 363 362 PRIMARY KEY(vol_id), 364 363 KEY(name(16)), 364 KEY(path(255)), 365 365 KEY(allocate), 366 366 KEY(available) … … 391 391 CREATE TABLE mountedvol( 392 392 mountpoint VARCHAR(255) NOT NULL, 393 FOREIGN KEY(mountpoint) REFERENCES mount(mountpoint), 393 394 total BIGINT NOT NULL, 394 395 used BIGINT NOT NULL, 395 396 vol_id INT NOT NULL, 397 FOREIGN KEY(vol_id) REFERENCES volume(vol_id), 396 398 name VARCHAR(255) NOT NULL, 397 399 path VARCHAR(255) NOT NULL, 400 FOREIGN KEY(path) REFERENCES volume(path), 398 401 allocate BOOLEAN DEFAULT FALSE, 399 402 available BOOLEAN DEFAULT FALSE,
Note:
See TracChangeset
for help on using the changeset viewer.
