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

[DPM] Refactor db/cache codes to support GoalStateV2 design #713

Merged
merged 49 commits into from
Dec 11, 2021

Conversation

DavidLiu506
Copy link
Contributor

@DavidLiu506 DavidLiu506 commented Dec 9, 2021

  1. Implement data plane manager cache design for GoalStateV2.
  2. Move neighbor functionality from PM to DPM.

@DavidLiu506 DavidLiu506 requested review from xieus and cj-chung December 9, 2021 00:30
@lgtm-com
Copy link

lgtm-com bot commented Dec 9, 2021

This pull request introduces 1 alert and fixes 3 when merging 43c0c7c into 97fc7b8 - view on LGTM.com

new alerts:

  • 1 for Self assignment

fixed alerts:

  • 3 for Useless null check

@xieus xieus added enhancement New feature or request feature feature development labels Dec 9, 2021
@xieus xieus added this to the Version 1.0.2021.12.30 milestone Dec 9, 2021
Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

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

Overall looks pretty good. Just a few minor comments.

public InternalSubnets findItem(String id) throws CacheException {
return routerSubnetsCache.get(id);
public void deleteVpcGatewayInfo(String routerId, String subnetId) throws CacheException {
routerSubnetsCache.remove(routerId + cacheFactory.KEY_DELIMITER + subnetId);
Copy link
Contributor

Choose a reason for hiding this comment

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

We have some key change in the key-value store to improve performance in multiple caches in this PR.

Since DPM design doc is quite outdated, we should update the design doc by putting major design points and gathering optimization techniques applied to DPM cache. @DavidLiu506 @cj-chung

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, we need to rewrite the DPM design doc and including the new cache design into the doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update doc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Create an issue #715 for tracking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 29 to 31
private List<String> vpcIds;
private List<String> topics;
private List<String> subTopics;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a good change. Could we also apply it to other lists? If the change is too huge, we could create an issue and then do it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do it in next PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool. Issue #716 created so that we don't forget :-)

@@ -275,7 +275,7 @@ public synchronized void createPortBulk(List<PortEntity> portEntities, Map<Strin
.stream()
.collect(Collectors.toMap(PortEntity::getId, Function.identity()));
portCache.putAll(portEntityMap);
neighborRepository.createNeighbors(portEntities.get(0).getProjectId(), neighbors);
//neighborRepository.createNeighbors(portEntities.get(0).getProjectId(), neighbors);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let us remove those commented lines when the change is confirmed. Also can we get rid of neighbor repository completely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will get rid of neighbor repository, NeighborProcessor.java and FetchPortNeighborRequest.java in next PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool!

@lgtm-com
Copy link

lgtm-com bot commented Dec 10, 2021

This pull request introduces 1 alert and fixes 3 when merging f5b7f75 into d3354de - view on LGTM.com

new alerts:

  • 1 for Self assignment

fixed alerts:

  • 3 for Useless null check

@xieus
Copy link
Contributor

xieus commented Dec 11, 2021

@DavidLiu506 All looks good. There is a merge conflict for the file services/network_config_manager/src/main/java/com/futurewei/alcor/netwconfigmanager/client/gRPC/GoalStateClientImpl.java likely due to merging other PRs to master. Could you resolve the conflict quickly so that I could push this PR to master.

@lgtm-com
Copy link

lgtm-com bot commented Dec 11, 2021

This pull request introduces 1 alert and fixes 3 when merging d996559 into 42a6edc - view on LGTM.com

new alerts:

  • 1 for Self assignment

fixed alerts:

  • 3 for Useless null check

@xieus xieus changed the title Implement DPM GoalStateV2 design [DPM] Refactor db/cache codes to support GoalStateV2 design Dec 11, 2021
@xieus xieus self-requested a review December 11, 2021 06:02
Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

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

Verified by Jenkins. LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feature feature development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants