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

Conversation

@xieus
Copy link
Contributor

@xieus xieus commented May 3, 2021

This PR adds the following features:

  • Add new interface of on-demand service and its implementation in the new Network Configuration Manager
  • Add new interface of GS persistence service and its implementation in NCM
  • Improve the GS caching layer in NCM
  • Based on on-demand request from the host, implement on-demand algorithm to retrieve from NCM cache and send down GoalState to ACA, as well as to respond to ACA's request

Note that this PR passes integration test with Test Controller (PR #560) and ACA.

@xieus xieus added enhancement New feature or request feature feature development labels May 3, 2021
@xieus xieus added this to the Version 0.12.2021.04.30 milestone May 3, 2021
@xieus xieus self-assigned this May 3, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2021

Codecov Report

Merging #607 (179979f) into master (1639de4) will decrease coverage by 0.64%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #607      +/-   ##
============================================
- Coverage     32.65%   32.01%   -0.65%     
- Complexity     1248     1255       +7     
============================================
  Files           522      525       +3     
  Lines         13156    13439     +283     
  Branches       1610     1657      +47     
============================================
+ Hits           4296     4302       +6     
- Misses         8275     8556     +281     
+ Partials        585      581       -4     
Impacted Files Coverage Δ Complexity Δ
...configmanager/NetworkConfigManagerApplication.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...configmanager/cache/HostResourceMetadataCache.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...or/netwconfigmanager/cache/ResourceStateCache.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...lcor/netwconfigmanager/cache/VpcResourceCache.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...configmanager/client/gRPC/GoalStateClientImpl.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ei/alcor/netwconfigmanager/constant/Constants.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...figmanager/controller/NetworkConfigController.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...i/alcor/netwconfigmanager/entity/ResourceMeta.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...lcor/netwconfigmanager/entity/VpcResourceMeta.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...anager/server/grpc/GoalStateProvisionerServer.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1639de4...179979f. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request fixes 4 alerts when merging e748285 into 0777179 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request fixes 4 alerts when merging 3ad0cf6 into 0777179 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request fixes 4 alerts when merging c7e9849 into 0777179 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request fixes 4 alerts when merging ddac42a into 0777179 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2021

This pull request fixes 4 alerts when merging 937c3f0 into 0777179 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2021

This pull request introduces 1 alert and fixes 4 when merging cc6edaf into a78e1d4 - view on LGTM.com

new alerts:

  • 1 for Dereferenced variable may be null

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2021

This pull request introduces 1 alert and fixes 4 when merging 7f67ae2 into a78e1d4 - view on LGTM.com

new alerts:

  • 1 for Dereferenced variable may be null

fixed alerts:

  • 4 for Container contents are never accessed

@xieus xieus requested a review from pkommoju May 5, 2021 23:33
public class VpcResourceCache {

// Map <VNI, Map<PIP, List<ResoruceIDType>>
// Map <VNI, Map<PIP, ResourceMetadata>
Copy link
Contributor

@pkommoju pkommoju May 5, 2021

Choose a reason for hiding this comment

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

TXN:
Need a "CacheFactory cacheFactory" member which will be assigned the cacheFactory param passed into the Constructor.

The following method is also needed:
public Transaction getTransaction() {
return cacheFactory.getTransaction();
}

The same change is needed in HostResourceMetadataCache and, ResourceCacheManager classes.

Futhermore, the following method is needed in lib/src/main/java/com/futurewei/alcor/common/db/CacheFactory.java

public Transaction getTransaction() {
return iCacheFactory.getTransaction();
}

} catch (Exception e) {
e.printStackTrace();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

TXN:
This entire loop can be pushed into goalStatePersistenceService.updateGoalState() and the call it self invoked after grpcGoalStateClient.sendGoalStates(filteredGoalStates); in the try{} block below.

The abouve loop inside goalStatePersistenceService.updateGoalState() will have to be modified as follows:
goalStatePersistenceService.updateGoalState() {
try {
Transaction txn = getTransaction();
txn.start();

txn.commit();
} cartch () {}

This way, if the send fails we don't have to do any rollbacks.

I have added
public Transaction getTransaction() {
if(hrmCache != null)
return hrmCache.getTransaction();
if (rssCache != null)
return rssCache.getTransaction();

    if (vpcCache != null)
        return vpcCache.getTransaction();

    return null;
}

In my equivalent of service/impl/GoalStatePersistenceServiceImpl.java.

There is the issue of capturing changes from updates to ACA into NCM caches, which, I don't think is handled by this code. I might be wrong, in which case a clear comment to that effect will help a lot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. As discussed, we will merge the current NCM implementation for non-transactional perf test. Meanwhile please work on the other PR on Transaction Mode changes (PR #604) and get it merged.

Next step is continue refactoring this part to enable transactional support and do a quick perf test.

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2021

This pull request fixes 4 alerts when merging 8dcfda2 into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2021

This pull request fixes 4 alerts when merging 565e102 into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2021

This pull request fixes 4 alerts when merging 83a5a1e into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2021

This pull request fixes 4 alerts when merging 06d3d25 into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2021

This pull request fixes 4 alerts when merging 37d579e into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

@xieus xieus requested review from cj-chung and zzxgzgz May 6, 2021 22:17
@xieus xieus changed the title [Network Config Mgr] Support On Demand Service [Network Config Mgr] Support on-demand service and GS persistence service May 6, 2021
@lgtm-com
Copy link

lgtm-com bot commented May 7, 2021

This pull request fixes 4 alerts when merging e7352ab into a78e1d4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

Comment on lines +75 to +76
// 4. Bingo! this packet is allowed, collect port related resources (NEIGHBOR, SG etc. FULL GS) and send down
// to ACA by a separate gRPC client
Copy link
Contributor

Choose a reason for hiding this comment

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

@xieus How about routing rule check?

@lgtm-com
Copy link

lgtm-com bot commented May 10, 2021

This pull request fixes 4 alerts when merging 179979f into 1639de4 - view on LGTM.com

fixed alerts:

  • 4 for Container contents are never accessed

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 for now.

@xieus xieus merged commit b3dbbd4 into futurewei-cloud:master May 10, 2021
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