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

refactor: remove recon client/server and send empty ranges when we don't need anything #509

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

dav1do
Copy link
Contributor

@dav1do dav1do commented Aug 29, 2024

This has two main changes, the first is to remove the recon client/server and the second is to reply with empty ranges when possible.

  1. We no longer need exclusive access to recon so removing the client/server loop abstraction as it currently acts as an extra layer to update. I added Clone to a couple things and had to adjust generics.. I think it's okay but probably merits a close review. The tests now use worker threads instead of spawning the server in the background. This changed the order that things get sent, but it looks like all the same messages are exchanged.

  2. When the remote is missing a range, we now send an empty response when we don't want anything. We still have to send some ranges in these cases if we're missing the bounding key and need to discover it. This seems to have reduced the round trips in some cases. The tests for this change was updated in the second commit, so looking at each commit to see the test changes is probably wise (or I can split it into two PRs if preferred). The goal of this change is to remove the requirement that the peer "read their writes". Previously, we would send a bunch of values and a hash and they would have to persist them before they could reply to indicate we're in sync. Now we assume the range is done and move on, coming back in a future conversation if necessary.

We no longer need exclusive access to recon so removing the client/server loop abstraction as it currently acts as an extra layer to update. I added Clone to a couple things and had to adjust generics.. I think it's okay but probably merits a close review.

The tests now use worker threads instead of spawning the server in the background. This changed the order that things get sent, but it looks like all the same messages are exchanged.
Copy link

linear bot commented Aug 29, 2024

@dav1do dav1do requested a review from nathanielc August 29, 2024 21:02
@dav1do dav1do temporarily deployed to github-tests-2024 August 29, 2024 21:13 — with GitHub Actions Inactive
@dav1do dav1do changed the title refactor: remove recon client/server refactor: remove recon client/server and send empty ranges when we don't need anything Aug 29, 2024
@dav1do dav1do marked this pull request as ready for review August 29, 2024 21:49
@dav1do dav1do requested review from AaronGoldman, a team and stbrody as code owners August 29, 2024 21:49
@dav1do dav1do requested review from dbcfd and removed request for a team August 29, 2024 21:49
@dav1do dav1do temporarily deployed to github-tests-2024 August 29, 2024 21:56 — with GitHub Actions Inactive
… the remote was missing a range

this appears to have reduced round trips in tests without changing the synchronization result
@dav1do dav1do force-pushed the feat/aes-306-recon-no-read-writes branch from 925cd01 to 4ea371a Compare August 29, 2024 22:00
@dav1do dav1do temporarily deployed to github-tests-2024 August 29, 2024 22:10 — with GitHub Actions Inactive
this is a modification to the previous commit that actually batches writes until the conversation finishes, however, it changes the semantic a bit as we no longer send the entire hash range. We could probably recognize that range and persist to make sure we're in sync at the end, but if we're okay with this, we won't do that.

It does make the tests look a bit odd as we get values but our state isn't updated until the conversation finishes and we're in sync. I can change the batch size to 1 if we want this but would prefer to see the peer state updated in the expect output
@dav1do dav1do temporarily deployed to github-tests-2024 August 29, 2024 22:37 — with GitHub Actions Inactive
Copy link
Collaborator

@nathanielc nathanielc left a comment

Choose a reason for hiding this comment

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

This is great, happy to see the simplification here.

I was concerned about the new reply_with field in remote missing as it didn't quite fit in the Recon model. I played around with it and found a simple way to avoid having to change the SyncState enum.

Here is a PR to this branch that shows my thinking. #510

@dav1do
Copy link
Contributor Author

dav1do commented Aug 30, 2024

This is great, happy to see the simplification here.

I was concerned about the new reply_with field in remote missing as it didn't quite fit in the Recon model. I played around with it and found a simple way to avoid having to change the SyncState enum.

Here is a PR to this branch that shows my thinking. #510

Yeah, that's much better. I agree the reply_with felt off (read: like a hack) but I didn't think to use Unsynchronized. Thanks for the suggestion, merged ✅.

@dav1do dav1do temporarily deployed to github-tests-2024 August 30, 2024 16:06 — with GitHub Actions Inactive
@dav1do dav1do added this pull request to the merge queue Sep 3, 2024
Merged via the queue into main with commit 21577f1 Sep 3, 2024
5 checks passed
@dav1do dav1do deleted the feat/aes-306-recon-no-read-writes branch September 3, 2024 15:23
@smrz2001 smrz2001 mentioned this pull request Sep 9, 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