Show
Ignore:
Timestamp:
10/18/09 02:15:30 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1255832130 +0000
git-parent:

[4bd41daf5972011000e2f08b921a9809998bd036]

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

fix these up to take th noit through

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/scaffolding.sql

    r4bd41da rb2014c0  
    33create user stratcon with unencrypted password 'stratcon'; 
    44create user prism with unencrypted password 'prism'; 
    5 grant usage on schema stratcon to stratcon; 
    6 grant usage on schema stratcon to prism; 
    7 grant usage on schema prism to prism; 
    85\c reconnoiter reconnoiter; 
    96begin; 
     
    1310create schema stratcon; 
    1411create schema prism; 
     12grant usage on schema stratcon to stratcon; 
     13grant usage on schema stratcon to prism; 
     14grant usage on schema noit to stratcon; 
     15grant usage on schema noit to prism; 
     16grant usage on schema prism to prism; 
    1517 
    1618\i sprocs/noit.date_hour.sql 
  • sql/sprocs/stratcon.get_storage_node_for_sid.sql

    r003566b rb2014c0  
    1 CREATE OR REPLACE FUNCTION stratcon.choose_storage_node_for_sid(out o_storage_node_id int, out o_dsn text)  
     1CREATE 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)  
    22RETURNS RECORD  
    33AS $$ 
    44BEGIN 
    5     SELECT storage_node_id, dsn from stratcon.storage_node order by random() limit 1 INTO o_storage_node_id, o_dsn;  
     5    -- we could be smart with v_noit 
     6    SELECT storage_node_id, fqdn, dsn from stratcon.storage_node order by random() limit 1 INTO o_storage_node_id, o_dsn;  
    67END 
    78$$ LANGUAGE plpgsql  
     
    910;  
    1011 
    11 GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid() TO stratcon; 
     12GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid(text) TO stratcon; 
  • sql/sprocs/stratcon.map_uuid_to_sid.sql

    r003566b rb2014c0  
    1 CREATE OR REPLACE FUNCTION stratcon.map_uuid_to_sid(in v_uuid uuid, in v_noit text, out o_sid int, 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_fqdn text, out o_dsn text)  
    22RETURNS RECORD  
    33AS $$ 
     
    88    -- but I think we had a reason to use it 
    99 
    10     SELECT sid, dsn FROM stratcon.map_uuid_to_sid LEFT JOIN stratcon.storage_node USING (storage_node_id) WHERE id = v_uuid INTO o_sid, o_dsn;  
     10    SELECT sid, fqdn, dsn FROM stratcon.map_uuid_to_sid LEFT JOIN stratcon.storage_node USING (storage_node_id) WHERE id = v_uuid INTO o_sid, 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() INTO v_new_storage_node_id, o_dsn;  
     14        SELECT * FROM stratcon.choose_storage_node_for_sid(v_noit) INTO v_new_storage_node_id, o_fqdn, o_dsn;  
    1515 
    1616        INSERT INTO stratcon.map_uuid_to_sid(id,sid,storage_node_id) VALUES (v_uuid, o_sid, v_new_storage_node_id);