Skip to content

TestMessage: account for jitter#6283

Merged
sougou merged 2 commits intovitessio:masterfrom
planetscale:rn-testmessage-jitter
Jun 12, 2020
Merged

TestMessage: account for jitter#6283
sougou merged 2 commits intovitessio:masterfrom
planetscale:rn-testmessage-jitter

Conversation

@rohit-nayak-ps
Copy link
Copy Markdown
Member

Signed-off-by: Rohit Nayak rohit@planetscale.com

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Comment on lines +145 to +146
if !(start+2e9 < next && next < (start+jitter)+6e9) {
t.Errorf("next: %d. must be about 3s after start: %d", next/1e9, (start+jitter)/1e9)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Jitter would have happened twice here, so maxJitter would be epoch * 1.333

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, made the change to use epoch*maxJitter. There will no jitter in Epoch 0: is that correct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// have backoff be +/- 33%, whenever this is injected, append (:min_backoff, :jitter)
jitteredBackoff := "FLOOR((%a<<ifnull(epoch, 0)) * %a)"

Correct, no jitter. By default, the jitter is also windowed around the min/max backoff. If there are no settings, minBackoff is the same as ackWaitTimeout and no limit on maxBackoff.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review June 9, 2020 09:42
@rohit-nayak-ps rohit-nayak-ps requested a review from sougou as a code owner June 9, 2020 09:42
@sougou sougou merged commit abda066 into vitessio:master Jun 12, 2020
This was referenced Jun 18, 2020
@deepthi deepthi added this to the v7.0 milestone Jul 17, 2020
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.

4 participants