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

Coalesce requests to KV #712

Merged
merged 4 commits into from
Nov 13, 2024
Merged

Coalesce requests to KV #712

merged 4 commits into from
Nov 13, 2024

Conversation

mendess
Copy link
Collaborator

@mendess mendess commented Nov 8, 2024

This PR is best viewed commit by commit.

  • Add get or insert method to kv (this commit is setup, this method will later being coalesced)
  • Abstract away the internals of kv connection
  • rename get_impl to get_internal
  • Add request coalescer to kv (this is the important commit to review)

@mendess mendess self-assigned this Nov 8, 2024
@mendess mendess force-pushed the mendess/coalesce branch 2 times, most recently from 98b51be to 62bfaab Compare November 8, 2024 14:13
@mendess mendess marked this pull request as draft November 8, 2024 14:19
@mendess mendess force-pushed the mendess/coalesce branch 2 times, most recently from cfd31c4 to 3138c92 Compare November 8, 2024 14:51
@mendess mendess marked this pull request as ready for review November 8, 2024 15:06
@mendess mendess force-pushed the mendess/coalesce branch 3 times, most recently from ca3c9e4 to 65e2f29 Compare November 8, 2024 16:04
@mendess mendess marked this pull request as draft November 8, 2024 16:19
@mendess mendess marked this pull request as ready for review November 11, 2024 14:21
@mendess mendess force-pushed the mendess/coalesce branch 4 times, most recently from ab6d381 to 1750d54 Compare November 12, 2024 10:45
Copy link
Contributor

@armfazh armfazh left a comment

Choose a reason for hiding this comment

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

Nice functionality, changes are ok.

Comment on lines +95 to +98
let op_key = OperationKey {
op_id: operation_id::of::<F, Fut, R, E>(),
key: key.clone(),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

can the op_key variable be defined before the loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That results in an additional clone when passing it to the ResponseSender

type CoalescedValue =
Result<Option<Marc<dyn Any + Send + Sync>>, CoalesceError<dyn Any + Send + Sync>>;

/// The send half to be used by the `executor` to send the result of it's computation to the
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// The send half to be used by the `executor` to send the result of it's computation to the
/// The send have to be used by the `executor` to send the result of it's computation to the

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually correct. A channel has two parts, the sending part and the receiving part, commonly referred to as the sending and receiving halves

@mendess mendess requested a review from jhoyla as a code owner November 13, 2024 09:20
@mendess mendess merged commit 2da37f6 into main Nov 13, 2024
3 checks passed
@mendess mendess deleted the mendess/coalesce branch November 13, 2024 10:40
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