-
-
Couldn't load subscription status.
- Fork 417
Description
Plugin
Jobs driver
I have an idea!
Partitions in kafka are the key mechanism for guaranteeing message ordering. Some processing of topics are sensitive to this ordering, but unfortunately there are a couple implementation details in Roadrunner that are at odds with this.
Kafka clients push multiple messages into the jobs pipeline prior to the current offset being handled
My recommendation is to push events (per partition) serially into the jobs pipeline. This would be separate from whether the job is ack-ed or nack-ed for two reasons. A client may wish to skip over an event or field events from multiple drivers without blocking progress on the partition and if they wish to halt, they can always pause the pipeline.
Pollers fan out tasks from the pipeline to workers
This is not an issue if the clients push one topic message at a time. I'm noting it since all of num_pollers pipeline_size and pool.num_workers all must be 1 currently to achieve ordering (at the cost of throughput).
My initial though is changing this behaviour is not ideal as fan out is a generally useful characteristic of these pollers.
The priority queue implementation is not stable.
This can be patched with minimal changes and negligible performance overhead. Even with the first gap here in the clients addressed, this could remain problematic if a high throughput topic is being replayed and consuming many messages that are queued with equal priority. FIFO solves this at the priority level, which is a slightly different ask than this CFS enhancement