Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VStream API: add heartbeat for idle streams #8244

Merged
merged 9 commits into from
Jun 25, 2021

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Jun 2, 2021

Description

Currently if all source shards have 0 QPS the VStream API will not send any events. So if a client doesn't receive events it is not clear if the connection is broken or idle. This PR adds an optional heartbeat which is sent if there are no events within a specified time period.

Earlier streams used to just invoke the passed callback. Now they send events to a shared channel. We initiate an idle timer here to send heartbeats if no events are received in flags.HeartbeatInterval.

Misc

  • The test for "vstream * from" construct was removed. This construct was implemented as a POC and it no longer works due to recent vtgate refactoring
  • A sample client for streaming using the vstream API is added. It is setup to work with the local example.

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

@rohit-nayak-ps rohit-nayak-ps added Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Jun 2, 2021
…ds to be an option

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps requested review from sougou and a team June 21, 2021 14:54
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review June 21, 2021 14:55
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Copy link
Collaborator

@vmg vmg left a comment

Choose a reason for hiding this comment

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

neat!

@rohit-nayak-ps rohit-nayak-ps merged commit e49f910 into vitessio:main Jun 25, 2021
@rohit-nayak-ps rohit-nayak-ps deleted the rn-vstream-heartbeat branch June 25, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants