-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
One time key counts differ between /sync and /keys/upload #10766
Comments
The count of OTKs retrieved by Are you making use of Synapse worker mode? Perhaps the cache is different across multiple workers. |
I do indeed use synapse in worker mode. And sync is forwarded to a different worker than |
Indeed, that is a valid configuration. The storage method I'm talking about in particular is Incremental |
I don't have any logs for that time period anymore, but this happened across multiple restarts in between of which I received messages. One possible cause I could think of, was that I sent a message in a large, encrypted room. I got around 20 key requests at least at the same time and started uploading keys after the first received ones. So there could potentially have been a race there, where the invalidation happened, a new count was calculated, the invalidation was cleared, but in the mean time the count changed again. |
I haven't heard of many races involving cache invalidation before in Synapse, but it's certainly a possibility. I think the first step towards solving this would be for someone to replicate the behaviour in either a Synapse unit test or via Sytest or Complement test. Given it's potentially a race (and possibly one between workers), Sytest or Complement would probably be best for having the behaviour emerge. Note that worker support in Complement is still in progress. |
Description
I noticed that after sending an encrypted in a large E2EE room (#e2ee-test:grin.hu) my key count responses got out of sync (might have happened earlier). On sync I got a count of 55, while when doing an empty key upload request returned a count of 33. Does synapse cache the key count for /sync somehow and that got out of sync?
After uploading some keys, the counts synchronized themselves to 50, so I am assuming the ones in /sync were wrong.
Steps to reproduce
Version information
If not matrix.org:
Version: 1.42.0rc1
Install method: ebuild
The text was updated successfully, but these errors were encountered: