Set max age for roomserver input stream to avoid excessive interior deletes (#3145)

If old messages build up in the input stream and do not get processed
successfully, this can create a significant drift between the stream
first sequence and the consumer ack floors, which results in a slow and
expensive start-up when interest-based retention is in use.

If a message is sat in the stream for 24 hours, it's probably not going
to get processed successfully, so let NATS drop them instead. Dendrite
can reconcile by fetching missing events later if it needs to.

---------

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
Neil 2023-07-07 18:59:34 +01:00 committed by GitHub
parent c08c7405db
commit e93bdd56fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View file

@ -48,6 +48,7 @@ var streams = []*nats.StreamConfig{
Name: InputRoomEvent,
Retention: nats.InterestPolicy,
Storage: nats.FileStorage,
MaxAge: time.Hour * 24,
},
{
Name: InputDeviceListUpdate,