Skip to content

Delete old transport property updates

akwizgran requested to merge 482-delete-old-transport-property-updates into master

This branch aims to reduce the DB load caused by polling for connections.

Initially I thought it would help if we stored the transport properties in metadata (see #482 (closed)). But when I started to look into how that would work, I realised it wouldn't be much of an improvement. If we were to store the properties in the group metadata, we'd have a complicated metadata structure with local and remote version numbers and remote properties for each transport, which would have to be parsed and re-encoded whenever part of the structure changed. Storing the properties in the message metadata would simply duplicate the information in the message bodies without making lookups any cheaper.

Thanks to @goapunk's DB measurements I realised a large part of the load was caused by querying unexpectedly large numbers of metadata keys. By deleting obsolete updates and their metadata we should be able to make these queries much cheaper.

Some of the code is only needed for backward compatibility with existing databases. When we're ready to break compatibility we can simplify that code. This should further improve performance by allowing some transactions to be read-only, so they can share the DB lock.

Closes #482 (closed)

Merge request reports