-
Notifications
You must be signed in to change notification settings - Fork 34
[DPM] Refactor db/cache codes to support GoalStateV2 design #713
[DPM] Refactor db/cache codes to support GoalStateV2 design #713
Conversation
DavidLiu506
commented
Dec 9, 2021
•
edited by xieus
Loading
edited by xieus
- Implement data plane manager cache design for GoalStateV2.
- Move neighbor functionality from PM to DPM.
This pull request introduces 1 alert and fixes 3 when merging 43c0c7c into 97fc7b8 - view on LGTM.com new alerts:
fixed alerts:
|
There was a problem hiding this 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.
.../data_plane_manager/src/main/java/com/futurewei/alcor/dataplane/cache/PortHostInfoCache.java
Show resolved
Hide resolved
.../data_plane_manager/src/main/java/com/futurewei/alcor/dataplane/cache/PortHostInfoCache.java
Outdated
Show resolved
Hide resolved
.../data_plane_manager/src/main/java/com/futurewei/alcor/dataplane/cache/PortHostInfoCache.java
Show resolved
Hide resolved
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update doc.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
...s/data_plane_manager/src/main/java/com/futurewei/alcor/dataplane/cache/SubnetPortsCache.java
Outdated
Show resolved
Hide resolved
...lane_manager/src/main/java/com/futurewei/alcor/dataplane/entity/InternalSubnetRouterMap.java
Show resolved
Hide resolved
private List<String> vpcIds; | ||
private List<String> topics; | ||
private List<String> subTopics; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :-)
...plane_manager/src/main/java/com/futurewei/alcor/dataplane/service/impl/DpmServiceImplV2.java
Show resolved
Hide resolved
.../port_manager/src/main/java/com/futurewei/alcor/portmanager/processor/NeighborProcessor.java
Show resolved
Hide resolved
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
This pull request introduces 1 alert and fixes 3 when merging f5b7f75 into d3354de - view on LGTM.com new alerts:
fixed alerts:
|
@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. |
This pull request introduces 1 alert and fixes 3 when merging d996559 into 42a6edc - view on LGTM.com new alerts:
fixed alerts:
|
There was a problem hiding this 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.