Show
Ignore:
Timestamp:
10/24/09 18:57:58 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1256410678 +0000
git-parent:

[698542882ef39bf51805101908d69d90b9a2291a]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1256410678 +0000
Message:

flag-day(stratcond,webconsole,database) get realtime graphs working on uuids

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/sprocs/stratcon.get_storage_node_for_sid.sql

    rb2014c0 r47a77d0  
    1 CREATE OR REPLACE FUNCTION stratcon.choose_storage_node_for_sid(in v_noit text, out o_storage_node_id int, out o_fqdn text, out o_dsn text)  
     1CREATE OR REPLACE FUNCTION stratcon.choose_storage_node_for_sid(in v_uuid uuid, in v_noit text, out o_storage_node_id int, out o_fqdn text, out o_dsn text)  
    22RETURNS RECORD  
    33AS $$ 
    44BEGIN 
    5     -- we could be smart with v_noit 
     5    -- we could be smart with v_uuid and/or v_noit 
    66    SELECT storage_node_id, fqdn, dsn from stratcon.storage_node order by random() limit 1 INTO o_storage_node_id, o_dsn;  
    77END 
     
    1010;  
    1111 
    12 GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid(text) TO stratcon; 
     12GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid(uuid, text) TO stratcon; 
  • sql/sprocs/stratcon.map_uuid_to_sid.sql

    r08e498f r47a77d0  
    1 CREATE OR REPLACE FUNCTION stratcon.map_uuid_to_sid(in v_uuid uuid, in v_noit text, out o_sid int, out o_storage_node_id int, out o_fqdn text, out o_dsn text)  
     1CREATE OR REPLACE FUNCTION stratcon.map_uuid_to_sid(in v_uuid uuid, in v_noit text, out o_sid int, out o_noit text, out o_storage_node_id int, out o_fqdn text, out o_dsn text)  
    22RETURNS RECORD  
    33AS $$ 
     
    66    -- but I think we had a reason to use it 
    77 
    8     SELECT sid, storage_node_id, fqdn, dsn 
     8    SELECT sid, storage_node_id, noit, fqdn, dsn 
    99      FROM stratcon.map_uuid_to_sid LEFT JOIN stratcon.storage_node USING (storage_node_id) 
    10      WHERE id = v_uuid INTO o_sid, o_storage_node_id, o_fqdn, o_dsn;  
     10     WHERE id = v_uuid INTO o_sid, o_storage_node_id, o_noit, o_fqdn, o_dsn;  
    1111    IF NOT FOUND THEN 
    1212 
    1313        SELECT nextval('stratcon.map_uuid_to_sid_sid_seq') INTO o_sid;   
    14         SELECT * FROM stratcon.choose_storage_node_for_sid(v_noit) INTO o_storage_node_id, o_fqdn, o_dsn;  
     14        SELECT * FROM stratcon.choose_storage_node_for_sid(v_uuid, v_noit) INTO o_storage_node_id, o_fqdn, o_dsn;  
    1515 
    16         INSERT INTO stratcon.map_uuid_to_sid(id,sid,storage_node_id) VALUES (v_uuid, o_sid, o_storage_node_id);  
     16        INSERT INTO stratcon.map_uuid_to_sid(id,sid,noit,storage_node_id) VALUES (v_uuid, o_sid, v_noit, o_storage_node_id);  
    1717 
    1818    END IF;