-
-
Notifications
You must be signed in to change notification settings - Fork 674
Conversation
Keep typing events for at least one minute
Fantastic work on this, thanks @S7evinK for all of your contributions thus far! I'll try to block out some time to look at this, but it'll take a while to migrate fully to NATS. We still need to sketch out and profile whether the swap would be net positive for large deployments. The main drivers for wanting to swap away from Kafka/Naffka are:
|
…add-nats-support
…add-nats-support
…add-nats-support
…add-nats-support
Even after some more testing and trying to fix things, still the same issue with receipts not coming through. Looks like, at least that's what i guess, that only After a few days in #dendrite:
|
…ntly this is upsetting tests that don't expect that" This reverts commit 3686752.
Squashed commit of the following: commit 13f9028 Author: Neil Alexander <[email protected]> Date: Tue Jan 4 15:47:14 2022 +0000 Do the same for leave commit e6be7f0 Author: Neil Alexander <[email protected]> Date: Tue Jan 4 15:33:42 2022 +0000 Enforce state key matches sender commit 85ede6d Author: Neil Alexander <[email protected]> Date: Tue Jan 4 14:07:04 2022 +0000 Fix panics on closed channel sends commit 9755494 Author: Neil Alexander <[email protected]> Date: Tue Jan 4 13:38:22 2022 +0000 Don't report any errors on `/send` to see what fun that creates commit 3bb4f87 Author: Neil Alexander <[email protected]> Date: Tue Jan 4 13:00:26 2022 +0000 Revert "Don't report event rejection errors via `/send`, since apparently this is upsetting tests that don't expect that" This reverts commit 3686752. commit fe2673e Author: Neil Alexander <[email protected]> Date: Tue Jan 4 12:09:34 2022 +0000 Go 1.16 instead of Go 1.13 for upgrade tests and Complement commit 3686752 Author: Neil Alexander <[email protected]> Date: Tue Jan 4 11:51:45 2022 +0000 Don't report event rejection errors via `/send`, since apparently this is upsetting tests that don't expect that commit b028dfc Author: Neil Alexander <[email protected]> Date: Tue Jan 4 10:29:08 2022 +0000 Send final event in `processEvent` synchronously (since this might stop Sytest from being so upset)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two main complaints:
- Phony changes are an unwelcome addition to this already enormous PR.
- Scattered
Ack()
calls throughout consumer code makes me extremely nervous that we will forget to ACK in places and I don't know what happens then? I guess it will get stuck on that event which is obviously not ideal.
roomserver/internal/input/input.go
Outdated
} | ||
inbox, _ := r.workers.LoadOrStore(roomID, &phony.Inbox{}) | ||
inbox.(*phony.Inbox).Act(nil, func() { | ||
_ = msg.InProgress() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we call InProgress
twice for the same message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because of the fact that the inbox might not process the task until later, so we reset the delivery timer when we start working on the event as well. As above though in the other comment, I don't think we actually need these at all, so I will remove them.
defer roomserverInputBackpressure.With(prometheus.Labels{"room_id": roomID}).Dec() | ||
var inputRoomEvent api.InputRoomEvent | ||
if err := json.Unmarshal(msg.Data, &inputRoomEvent); err != nil { | ||
_ = msg.Term() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we do this here but in other cases we just Ack()
or Nack()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to do with trying to queue things up using request-reply, rather than putting things straight onto the inboxes themselves for synchronous requests. I never finished it and decided it would be better to do that in a separate PR later, but the Term
here is pretty much equivalent here to an Ack
.
…use process context in consumers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Let's do it!
Awesome! how do we change our current server/setup to test this? |
Take a look at the |
This adds experimental support for NATS JetStream by implementing the required interfaces for sarama.
Currently uses my experimental NATS JetStream sarama implementation, seems like there are still a few issues in there, as e.g. receipts/read markers don't seem to always come through.
On a side note, I was able to join #dendrite-dev and still receive messages in other rooms.
Kafka (with 3 nodes, 1 zookeeper) is using about ~4G of memory.. NATS on the other side (also 3 nodes, no manager needed) - 120M. (As reported by Prometheus) Kafka/NATS are both idle.
Some screenshots from NATS:
![image](https://user-images.githubusercontent.com/2353100/120851892-c282d180-c579-11eb-820b-edc777bc453e.png)
Pull Request Checklist
sytest-whitelist
as specified in docs/sytest.md