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

opt: optimize cluster identification #3309

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tediou5
Copy link
Contributor

@tediou5 tediou5 commented Dec 11, 2024

Second attempt to close #2900

The first commit is meaningless; it simply renames cache_id to piece_cache_id

For the cache, everything is straightforward; it's just a matter of recording the corresponding relationships in the controller. However, things are a litter bit more complicated for the farmer. First, we check the identify message to see if the farmer is newly discovered and whether the fingerprint has changed. Based on the results, we decide whether to use the stream to fetch details.

The final commit is to ensure compatibility with previous approaches.

(I’m really sorry, actually, I finished it a long time ago, but I forgot about it and left it in a corner.)

Code contributor checklist:

@tediou5 tediou5 changed the title Tmp/opt/optimize cluster identification opt: optimize cluster identification Dec 11, 2024
@tediou5
Copy link
Contributor Author

tediou5 commented Dec 16, 2024

@nazar-pc additionally, during my actual development, this part of the code is not easy to test, and some scenarios are hard to cover(like farm FingerprintUpdated). At the very least, I need to start 3 components: nats, controller, and farmer/cache to do so. I was thinking maybe I could first submit a PR to extract the update logic for caches and farms and cover enough test cases?

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.

Optimize farm and cache identification
1 participant