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

libovsdb: fix race condition in OVN LB operations #2625

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Apr 9, 2023

What type of this PR

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at f8647c8

This pull request refactors the LoadBalancer interface in the ovs package and updates the controller and test packages to use the new methods. The new interface simplifies the arguments and calls for adding and deleting load balancer vips and backends, and avoids unnecessary map operations. It also fixes a typo in the logical router transaction name.

🤖 Generated by Copilot at f8647c8

Sing, O Muse, of the mighty refactor of the LoadBalancer interface
That the skilled programmers wrought with their nimble fingers and minds
They simplified the arguments and the calls to the OVN-NB client
And avoided the needless map operations that caused much delay and strife

HOW

🤖 Generated by Copilot at f8647c8

  • Refactor the LoadBalancer interface to use a single vip and a variadic list of backends as parameters instead of a map of vips and backends (link, link, link)
  • Update the endpoint controller to use the new LoadBalancer interface and pass the vip and backends as separate arguments (link, link, link)
  • Update the gc controller to use the new LoadBalancer interface and pass the vip as a single argument (link)
  • Update the ovn_dnat controller to use the new LoadBalancer interface and pass the vip and backend as separate arguments (link, link)
  • Update the service controller to use the new LoadBalancer interface and pass the vip as a single argument (link, link, link, link)
  • Implement the new LoadBalancer interface methods using the OVN-NB client and remove the old LoadBalancer interface methods (link, link, link)
  • Update the test functions to use the new LoadBalancer interface methods and test each vip and backends individually (link, link, link, link, link, link, link)
  • Fix a typo in the logical router transaction name (link)
  • Remove an unused import of "strings" in the endpoint controller (link)
  • Add the "sort" and "strings" packages and remove the "reflect" package in the ovn-nb-load_balancer.go file (link)

@zhangzujian zhangzujian added the bug Something isn't working label Apr 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2023

  • The commit message should be more descriptive and informative. It should clearly state what changes were made and why.
  • There are no potential bugs or format errors in the patch diff.
  • It is difficult to assess performance issues without further context on the codebase and the changes made.
  • Ways to improve could include adding comments to explain complex logic, using more descriptive variable names, and following consistent coding conventions throughout the codebase.

@zhangzujian zhangzujian marked this pull request as ready for review April 9, 2023 02:12
@zhangzujian
Copy link
Member Author

@gugulee Please review.

@zhangzujian zhangzujian merged commit 1fc5d85 into kubeovn:master Apr 10, 2023
@zhangzujian zhangzujian deleted the fix-lb branch April 10, 2023 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants