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

New log effect type: log_ext that allows entries residing in segment files to be read by another process. #477

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

kjnilsson
Copy link
Contributor

@kjnilsson kjnilsson commented Nov 19, 2024

Introduce a new version of the log effect (log_ext) that allows any indexes referring to a command stored in a segment (rather than in the memtable) to be read by another process on the same node.

Any indexes requested that are stored in the memtable are read by the ra server process but the remainder of entries are
provided as a "read plan" that another process could execute.

This feature is useful for offloading segment read work to RabbitMQ session/channel processes during consumption.

@kjnilsson kjnilsson changed the title Partial read api New log effect type: log_ext that allows entries residing in segment files to be read by another process. Nov 25, 2024
@kjnilsson kjnilsson marked this pull request as ready for review November 25, 2024 15:51
@kjnilsson kjnilsson force-pushed the partial-read-api branch 2 times, most recently from df18788 to 80b9d81 Compare November 25, 2024 16:19
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

This looks great, I just have some minor nits and typo fixes

src/ra_log.erl Show resolved Hide resolved
src/ra_log.erl Show resolved Hide resolved
src/ra_log_reader.erl Outdated Show resolved Hide resolved
src/ra_log_reader.erl Show resolved Hide resolved
src/ra_server.erl Outdated Show resolved Hide resolved
… that

exists in the mem table and returns an opaque "read plan" that can be
executed by any process on the same node by using the `ra_log_read_plan:execute/2`
function.

This PR also refactors follower effect filtering to be done in the ra_server_proc
only in order to keep this logic in one place.

Other minor refactorings and fixes and some improvements to effect documentation.
@kjnilsson kjnilsson merged commit eaa2094 into main Nov 26, 2024
7 checks passed
@kjnilsson kjnilsson added this to the 2.16.0 milestone Nov 27, 2024
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.

2 participants