Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@DavidLiu506
Copy link
Contributor

@DavidLiu506 DavidLiu506 commented Nov 5, 2021

This is for ip manager performance improvement.

1 Transaction on ipAddrRangeCache (not include vpcIpRangeCache.get(vpcId)), this can reduce distribute lock and improve concurrent cache operation.

2 Add retry logic code in port manager is for cocurrent operate on create subnet and allocate ip.

@DavidLiu506 DavidLiu506 requested review from cj-chung and xieus November 5, 2021 22:10
Comment on lines +199 to +200
public IpAddrAlloc allocateIpAddr(IpAddrRequest request) throws Exception {
IpAddrAlloc ipAddrAlloc = allocateIpAddrMethod(request);
Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidLiu506 Do we still need this function if we push all the process code into allocateIpAddrMethod?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It called by other functions.

Comment on lines 89 to 98
while(true) {
try {
IpAddrRequest result = restTemplate.postForObject(ipManagerUrl, request, IpAddrRequest.class);
verifyAllocatedIpAddr(result);
return result;
} catch (Exception e) {
// handle exception
if (++count == maxTries) throw e;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidLiu506 Should we use formal way to do the retry? such as RetryTemplate described in this link: https://www.baeldung.com/spring-retry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cj-chung fixed using spring framework.

@xieus xieus marked this pull request as draft November 19, 2021 00:46
@xieus xieus marked this pull request as ready for review November 19, 2021 00:46
@xieus xieus added the enhancement New feature or request label Nov 19, 2021
@xieus xieus added this to the Version 1.0.2021.12.30 milestone Nov 19, 2021
Copy link
Contributor

@cj-chung cj-chung left a comment

Choose a reason for hiding this comment

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

LGTM

@xieus
Copy link
Contributor

xieus commented Nov 24, 2021

@DavidLiu506 Please add a brief description on the PR as well.

@xieus xieus added the perf testing Performance Testing label Nov 24, 2021
@xieus xieus merged commit 7f19a4e into futurewei-cloud:master Nov 25, 2021
@DavidLiu506 DavidLiu506 deleted the ip_manager branch January 14, 2022 01:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request perf testing Performance Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants