Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 1e9826d

Browse files
committed
Remove sent outbound device list pokes from the database
They just get in the way.
1 parent 60adcbe commit 1e9826d

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

changelog.d/7192.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove sent outbound device list pokes from the database.

synapse/storage/data_stores/main/devices.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ def _get_device_updates_by_remote_txn(
228228
# get the list of device updates that need to be sent
229229
sql = """
230230
SELECT user_id, device_id, stream_id, opentracing_context FROM device_lists_outbound_pokes
231-
WHERE destination = ? AND ? < stream_id AND stream_id <= ? AND sent = ?
231+
WHERE destination = ? AND ? < stream_id AND stream_id <= ?
232232
ORDER BY stream_id
233233
LIMIT ?
234234
"""
235-
txn.execute(sql, (destination, from_stream_id, now_stream_id, False, limit))
235+
txn.execute(sql, (destination, from_stream_id, now_stream_id, limit))
236236

237237
return list(txn)
238238

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Copyright 2020 The Matrix.org Foundation C.I.C
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
-- we no longer keep sent outbound device pokes in the db; clear them out
17+
-- so that we don't have to worry about them.
18+
--
19+
-- This is a sequence scan, but it doesn't take too long.
20+
21+
DELETE FROM device_lists_outbound_pokes WHERE sent;

0 commit comments

Comments
 (0)