Skip to content

implement a new configuration for read fan-out delay#7929

Merged
timvisee merged 3 commits intodevfrom
read-fan-out-delay
Jan 19, 2026
Merged

implement a new configuration for read fan-out delay#7929
timvisee merged 3 commits intodevfrom
read-fan-out-delay

Conversation

@generall
Copy link
Member

There are cases, where we might want to smooth out tail latencies of read requests.
One of the typical exmples might be intecation happening in one replica but not another.

If we have an estimation of how long a certain request should take, we we can configure read-fan-out-delay to fire another request to another replica, to prevent one slow replica slowing down whole service.

Unlike read-fan-out-factor this configuration doesn't always require executing both requests, therefore it is more resource friendly at a cost of backed-in minimal delay.

@generall generall requested a review from ffuugoo January 18, 2026 22:57
@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Comment on lines +7068 to +7074
"read_fan_out_delay_ms": {
"description": "Define number of milliseconds to wait before attempting to read from another replica. This setting can help to reduce latency spikes in case of occasional slow replicas. Default is 0, which means, that no additional request is sent.",
"type": "integer",
"format": "uint64",
"minimum": 0,
"nullable": true
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means we cannot configure a delay of 0ms. Is that desired behavior?

How about using -1 as default to disable fan-out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0ms fan-out doesn't make sense. It is essentially the same as just read-fan-out-factor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment gave me the impression setting 0m would completely disable fan-out.

Looking at the code reveals that it doesn't. It only disables fan out based on delay, and the fan-out triggered on a busy shard still applies.

I suggest to update the comment to make it a bit more clear.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it to the following

Default is 0, which means delayed fan out request is disabled.

If you don't like it we can drop the commit 👍

Copy link
Member

@timvisee timvisee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experimented with some artificial delays. Works perfectly 👌

@timvisee timvisee merged commit b94a13f into dev Jan 19, 2026
15 checks passed
@timvisee timvisee deleted the read-fan-out-delay branch January 19, 2026 13:38
generall added a commit that referenced this pull request Feb 9, 2026
* implement a new configuration for read fan-out delay

* upd schema

* Update read_fan_out_delay_ms comment

---------

Co-authored-by: timvisee <tim@visee.me>
@timvisee timvisee mentioned this pull request Feb 17, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants