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

kvserver/rangefeed: remove future package for server rangefeed #125782

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wenyihu6
Copy link
Contributor

@wenyihu6 wenyihu6 commented Jun 17, 2024

Epic: None

Copy link

blathers-crl bot commented Jun 17, 2024

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@wenyihu6 wenyihu6 force-pushed the addmuxer branch 3 times, most recently from e961b8a to 3c02358 Compare June 18, 2024 18:32
Copy link

blathers-crl bot commented Jun 18, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@wenyihu6 wenyihu6 force-pushed the addmuxer branch 24 times, most recently from 7d49f2a to 58e61d6 Compare June 23, 2024 21:48
After the output loop completes, 2 cleanup steps are performed:

1) The registration is removed from the processors registry
2) The process is potentially stopped and removed from the replica.

Before this change, both of these happened syncronously after the
output loop finished.

With this change, step (1) happens asyncronously. To facilitate this,
an overflow mechanism is provided. This overflow mechanism potentially
allocates. Note that we expect that the number of requests is
relatively small and should be O(rangefeeds_on_range) so hopefully
this mechanism won't be used often.

Step (2) is now handled by the processor itself. After processing an
unregister request, if the set of registrations falls to zero, we
enqueue a Stop event for ourselves. Then, when processing the Stop, we
unregister ourselves from the replica.

Note that this may look like a small semantics change since the
previous unregister callback called Stop() which processes all events.
However, note that a Stopped event is processed after all other
events, so any events in the queue at the point of processing the
unregistration that enqueued the stop will be processed.

The motivation for this change is to eventually allow cleanup step (1)
to be run as part of registration.disconnect(), which needs to be
non-blocking. This is desired for a future change in which there is
not a dedicated goroutine to perform this cleanup.

Epic: none
Release note: None
Rather than a dynamic overflow queue, we now set a flag indicating
that an overflow happened and then scan all registrations in the case
of overflow.

Release note: None
Epic: none
For the ScheduledProcess, we now enqueue the unregister as part of the
first disconnect call.

Epic: none
Release note: None
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