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

[BUG] Make memberlist use ips for routing #3405

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

Conversation

HammadB
Copy link
Collaborator

@HammadB HammadB commented Jan 3, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • The memberlist uses k8s dns based routing for the stateful set. However, this can result in delays when the routing updates. This propagates the ip in the memberlist which is much faster.
    • This change is backwards compatible
      • CRDs fields are optional by default, so not setting the ip is fine if CRD is updated
      • CRD fields can be set in the code without the CRD being updated
      • The python frontend will use the ip if present, otherwise it falls back to the id
      • The go code will read the ip to "" anywhere it expects it to be set if the old version of the CR is used
  • New functionality
    • ...

Test plan

How are these changes tested?
Added a test which adds data to a collection, kills the query service pods and waits for them to be ready, simulating a roll out of sorts. Then it issues another query and make sure the query succeeds with updated routing. Before this change, this test failed.

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

None

Copy link

github-actions bot commented Jan 3, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link

github-actions bot commented Jan 3, 2025

✅ The Helm chart's version was changed. Your changes to the chart will be published upon merge to main.

@HammadB HammadB marked this pull request as ready for review January 4, 2025 02:10
for member in self._curr_memberlist:
if member.id == assignment:
if member.ip is not None and member.ip != "":
print(f"[HAMMAD DEBUG] Using member ip: {member.ip}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo: remove

@@ -77,6 +78,8 @@ def prepare_segments_for_new_collection(

@override
def delete_segments(self, collection_id: UUID) -> Sequence[UUID]:
# TODO: this should be a pass, delete_collection is expected to delete segments in
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks, i will remove the get_segments() calls.

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