Fix clearing out old device list outbound pokes #1864

Merged
merged 3 commits into from Jan 31, 2017

Projects

None yet

2 participants

@erikjohnston
Member

No description provided.

@erikjohnston erikjohnston Fix clearing out old device list outbound pokes
05b9f48
synapse/storage/devices.py
@@ -557,6 +557,9 @@ def _prune_txn(txn):
txn.execute(select_sql)
rows = txn.fetchall()
+ if not rows:
+ return
@NegativeMjark
NegativeMjark Jan 31, 2017 Contributor

Should we chuck a min(ts) into the SELECT so that we can filter out destinations that don't have anything to delete in them? I'm slightly worried at the number of deletes that we are spamming here.

@erikjohnston
erikjohnston Jan 31, 2017 Member

I wouldn't expect min(ts) < ? to filter out many rows though, as most users won't update particularly frequently.

@NegativeMjark
NegativeMjark Jan 31, 2017 Contributor

If you throw in a count then you could probably discard all the destination, user_id pairs that only have a single row in them.

erikjohnston added some commits Jan 31, 2017
@erikjohnston erikjohnston Only fetch with row ts and count > 1
d3169e8
@erikjohnston erikjohnston Fix deletion of old sent devices correctly
ab55794
@NegativeMjark

LGTM

@erikjohnston erikjohnston merged commit ac001da into develop Jan 31, 2017

6 of 8 checks passed

Sytest Dendron (Commit) Build #1447 origin/erikj/device_list_fixes in progress...
Details
Sytest SQLite (Commit) Build #2332 origin/erikj/device_list_fixes in progress...
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #2263 origin/erikj/device_list_fixes succeeded in 7 min 8 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment