root/sql/sprocs/stratcon.get_storage_node_for_sid.sql

Revision 003566b519017539659f61ab68d038cb3218e43b, 377 bytes (checked in by Robert Treat <robert@omniti.com>, 5 years ago)

give me a uuid and it's noit, i'll give you a sid and which node to put it on

  • Property mode set to 100644
Line 
1 CREATE OR REPLACE FUNCTION stratcon.choose_storage_node_for_sid(out o_storage_node_id int, out o_dsn text)
2 RETURNS RECORD
3 AS $$
4 BEGIN
5     SELECT storage_node_id, dsn from stratcon.storage_node order by random() limit 1 INTO o_storage_node_id, o_dsn;
6 END
7 $$ LANGUAGE plpgsql
8 SECURITY DEFINER
9 ;
10
11 GRANT EXECUTE ON FUNCTION stratcon.choose_storage_node_for_sid() TO stratcon;
Note: See TracBrowser for help on using the browser.