Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Allow agent connections to multiple RTCs (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
feymartynov authored May 19, 2021
1 parent 37038db commit 14b06b6
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 38 deletions.
Binary file modified docs/data/conference.schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/data/conference.schema.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile modified="2021-03-19T05:07:47.385Z" host="app.diagrams.net" agent="5.0 (Macintosh)" etag="O_ob6If4-mYaeSuaFBPp" version="14.4.3" type="device"><diagram id="oY3ui7ZUPCmgsgYIyXuZ" name="Page-1">7V1bc9s2E/01enRH4sWWHiPZTtM6qRvna+O+aCARluhQhEpCtuRf/4EkqIux1MUmCSLdTmZqQryAwMHh7uJg0bIHs+XHiMynn5lHg5bV9pYt+7JlWR2n64j/JSUrWdLuWVnJJPI9WbYpuPNfaH6iLF34Ho13TuSMBdyf7xaOWRjSMd8pI1HEnndPe2DB7lPnZEKVgrsxCdTSv32PT7PSrtvelP9K/ck0f3KnLX+ZkfxkWRBPiceet4rsq5Y9iBjj2V+z5YAGSevl7ZJdd13w67piEQ35MRdcDW5H7b/bd/aX6Punj7ckfLHuz2w7u80TCRbyjUWNZrLGfJU3Q/zszwISiqP+Awv5nfylLY7HUz/wbsiKLZJqxJyMf+RH/SmL/BdxPgnETx1RIH6OuOxl6zy5mx8EAxawKH2OPfboqDvaufIuuaN8VkRjce1t/s6dV0WfyXLnxBsS87yWLAjIPPZHab2TC2ckmvhhn3Eu3jc7KX/L691KPaT/id9J4E9CUTYWz6JR3hbZ23Sc9PUi9oNuXWqf2z1bdEBf7S3ZgU804nS5VSR77yNlM8qjlThF/mp1JZLkWHLav7hZwfMGmVaOv+kWKq1zOQyJHA2T9c03gBF/SMycgh9HwU9y/gdRtB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+uw6+2bEts5n/Spvp0LFqW8ysay3jwxv0VWMXnVprdOXivz6jmuPC5cLKNkiWm/AstJi2XEYcQY3z49IvPpZ+bR5Iz/Aw==</diagram></mxfile>
<mxfile modified="2021-05-17T08:46:47.011Z" host="app.diagrams.net" agent="5.0 (Macintosh)" etag="MNVKEZw1G5kleuLzEa0f" version="14.4.9" type="device"><diagram id="oY3ui7ZUPCmgsgYIyXuZ" name="Page-1">7V1bV9s4F/01PDLLlxiSxyZApzOUoaXftPQlS4lFYupYGVsBwq//ZEfOTcdJIPJFXWdW1xqsyLYsbW0dHW0dnbi9ycvHmEzHn5lPwxPH8l9O3IsTx7HP2ufif2nKXKZYHXeRMooDX6atEu6CV5pnlKmzwKfJRkbOWMiD6WbikEURHfKNNBLH7Hkz2wMLN986JSOqJNwNSaimfg98Pl6ktj1rlf4nDUbj/M22JX+ZkDyzTEjGxGfPa0nu5Ynbixnji78mLz0aprWX18vivquCX5cFi2nED7nhsnc7sL5bd+5N/OPTx1sSvTr3p65sjScSzuQXixJNZIn5PK+G5DmYhCQSV90HFvE7+YslrofjIPSvyZzN0mIknAx/5VfdMYuDV5GfhOInWySIn2MuW9k5S58WhGGPhSzO3uMOfTpoDzbuvEufKN8V00Tce5t/s72V9Jm8bGS8JgnPS8nCkEyTYJCVO71xQuJREHUZ5+J7F5nyr7zaLNRD9p/4nYTBKBJpQ/EuGud1sfgau5V9Xsx+0bVb3TO344oG6KqtJRvwicacvqwlydb7SNmE8ngusshfnbZEkuxLLesPb5HwvEKmk+NvvIZK56wle4TsDaPlw1eAEX9IzLwFPy0FP2n+DyJpJnquiqMxmaZ/iorgAQm/ii5LolH6a5ezqWyGkD7kzRbLj0j/HuRNZa81xSJvN63FQPTaDzJ5Evh+9tR1fEUsA3AyJcMgGl0v3uK2Vklf5dvSJCYe+RBmHXYsHkajtDSME04GS+hPWRDxrEq9rvgnar6XtoknvrQnru3VtfiXZo95j0UCJCTIUEAFPp9pitGuH7PpN4FImn/tejfztqDmgID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Dw==</diagram></mxfile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE agent_connection DROP CONSTRAINT agent_connection_pkey;
ALTER TABLE agent_connection ADD PRIMARY KEY (agent_id);
ALTER TABLE agent_connection DROP COLUMN rtc_id;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TRUNCATE agent_connection;
ALTER TABLE agent_connection ADD COLUMN rtc_id UUID NOT NULL;

ALTER TABLE agent_connection
ADD CONSTRAINT agent_conenction_rtc_id_fk
FOREIGN KEY (rtc_id) REFERENCES rtc (id) ON DELETE CASCADE;

ALTER TABLE agent_connection DROP CONSTRAINT agent_connection_pkey;
ALTER TABLE agent_connection ADD PRIMARY KEY (agent_id, rtc_id);
2 changes: 1 addition & 1 deletion src/app/endpoint/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ mod test {
assert_eq!(topic, expected_topic);
assert_eq!(reqp.method(), "subscription.create");
assert_eq!(payload.subject, agent.agent_id().to_owned());
assert_eq!(payload.object, vec!["rooms", &room_id]);
assert_eq!(payload.object, vec!["rooms", &room_id, "events"]);
});
}

Expand Down
104 changes: 88 additions & 16 deletions src/app/endpoint/rtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,22 +1010,40 @@ mod test {
let room1 =
shared_helpers::insert_room_with_backend_id(&conn, backend1.id());

let _rtc1 = shared_helpers::insert_rtc_with_room(&conn, &room1);
let rtc1 = shared_helpers::insert_rtc_with_room(&conn, &room1);

let s1a1 = TestAgent::new("web", "s1a1", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, s1a1.agent_id(), room1.id());

shared_helpers::insert_connected_agent(
&conn,
s1a1.agent_id(),
room1.id(),
rtc1.id(),
);

// The second backend has 2 agents.
let room2 =
shared_helpers::insert_room_with_backend_id(&conn, backend2.id());

let _rtc2 = shared_helpers::insert_rtc_with_room(&conn, &room2);
let rtc2 = shared_helpers::insert_rtc_with_room(&conn, &room2);

let s2a1 = TestAgent::new("web", "s2a1", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, s2a1.agent_id(), room2.id());

shared_helpers::insert_connected_agent(
&conn,
s2a1.agent_id(),
room2.id(),
rtc2.id(),
);

let s2a2 = TestAgent::new("web", "s2a2", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, s2a2.agent_id(), room2.id());

shared_helpers::insert_connected_agent(
&conn,
s2a2.agent_id(),
room2.id(),
rtc2.id(),
);

// The new rtc for which we will balance the stream.
let rtc3 = shared_helpers::insert_rtc(&conn);
Expand Down Expand Up @@ -1437,12 +1455,18 @@ mod test {
let rtc = shared_helpers::insert_rtc_with_room(&conn, &room);

// Insert active agents.
shared_helpers::insert_connected_agent(&conn, writer.agent_id(), room.id());
shared_helpers::insert_connected_agent(
&conn,
writer.agent_id(),
room.id(),
rtc.id(),
);

shared_helpers::insert_connected_agent(
&conn,
reader1.agent_id(),
room.id(),
rtc.id(),
);

factory::Agent::new()
Expand Down Expand Up @@ -1613,28 +1637,57 @@ mod test {
.insert(&conn);

// Insert rtcs for each room.
let _rtc1 = shared_helpers::insert_rtc_with_room(&conn, &room1);
let _rtc2 = shared_helpers::insert_rtc_with_room(&conn, &room2);
let rtc1 = shared_helpers::insert_rtc_with_room(&conn, &room1);
let rtc2 = shared_helpers::insert_rtc_with_room(&conn, &room2);
let rtc3 = shared_helpers::insert_rtc_with_room(&conn, &room3);

// Insert writer for room 1 @ backend 1
let agent = TestAgent::new("web", "writer1", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room1.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room1.id(),
rtc1.id(),
);

// Insert two readers for room 1 @ backend 1
let agent = TestAgent::new("web", "reader1-1", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room1.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room1.id(),
rtc1.id(),
);

let agent = TestAgent::new("web", "reader1-2", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room1.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room1.id(),
rtc1.id(),
);

// Insert writer for room 2 @ backend 2
let agent = TestAgent::new("web", "writer2", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room2.id());
shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room2.id(),
rtc2.id(),
);

// Insert reader for room 2 @ backend 2
let agent = TestAgent::new("web", "reader2", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room2.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room2.id(),
rtc2.id(),
);

(rtc3, backend2)
})
Expand Down Expand Up @@ -1743,7 +1796,13 @@ mod test {

// Insert writer for room 1
let agent = TestAgent::new("web", "writer1", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room1.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room1.id(),
rtc1.id(),
);

// Insert 450 readers for room 1
for i in 0..450 {
Expand All @@ -1754,16 +1813,29 @@ mod test {
&conn,
agent.agent_id(),
room1.id(),
rtc1.id(),
);
}

// Insert writer for room 3
let agent = TestAgent::new("web", "writer3", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room2.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room2.id(),
rtc3.id(),
);

// Insert reader for room 3
let agent = TestAgent::new("web", "reader3", USR_AUDIENCE);
shared_helpers::insert_connected_agent(&conn, agent.agent_id(), room3.id());

shared_helpers::insert_connected_agent(
&conn,
agent.agent_id(),
room3.id(),
rtc3.id(),
);

([rtc1, rtc2, rtc3], backend)
})
Expand Down
Loading

0 comments on commit 14b06b6

Please sign in to comment.