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

Arista: port NX-OS route-map logic #6465

Merged
merged 2 commits into from Dec 2, 2020
Merged

Conversation

dhalperi
Copy link
Member

@dhalperi dhalperi commented Dec 2, 2020

Prior to this PR, Arista modeled route-maps as nested structures, so that if
there were N terms, those terms would go into a recursive structure that was N
terms deep. For large N (hundreds+) this can cause recursion limits in Java,
e.g., in walking the route-map or in serializing it to disk.

Fix this by adopting (nearly verbatim) the logic from NX-OS.

Validated by existing unit tests + Batfish Enterprise compare view: routes are
the same before and after in many real networks.

@batfish-bot
Copy link

This change is Reviewable

@codecov
Copy link

codecov bot commented Dec 2, 2020

Codecov Report

Merging #6465 (eee8c83) into master (d6ed45b) will decrease coverage by 0.00%.
The diff coverage is 91.83%.

@@             Coverage Diff              @@
##             master    #6465      +/-   ##
============================================
- Coverage     73.28%   73.28%   -0.01%     
- Complexity    35451    35452       +1     
============================================
  Files          2821     2821              
  Lines        143320   143306      -14     
  Branches      17306    17299       -7     
============================================
- Hits         105036   105023      -13     
- Misses        29957    29959       +2     
+ Partials       8327     8324       -3     
Impacted Files Coverage Δ Complexity Δ
...ish/representation/arista/AristaConfiguration.java 58.21% <91.83%> (+0.14%) 176.00 <23.00> (+1.00)
.../batfish/representation/arista/MatchSemantics.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-1.00%)
...sh/representation/arista/PolicyMapClassAction.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-1.00%)
.../org/batfish/dataplane/rib/RouteAdvertisement.java 83.67% <0.00%> (-4.09%) 18.00% <0.00%> (-1.00%)
...main/java/org/batfish/datamodel/acl/AclTracer.java 60.37% <0.00%> (-1.26%) 43.00% <0.00%> (-1.00%)
...src/main/java/org/batfish/coordinator/PoolMgr.java 59.52% <0.00%> (-1.20%) 15.00% <0.00%> (-1.00%)
...java/org/batfish/dataplane/ibdp/VirtualRouter.java 90.54% <0.00%> (-0.34%) 208.00% <0.00%> (-1.00%)
...a/org/batfish/representation/aws/LoadBalancer.java 82.50% <0.00%> (+0.31%) 71.00% <0.00%> (+1.00%)
...col/src/main/java/org/batfish/role/InferRoles.java 90.90% <0.00%> (+1.36%) 51.00% <0.00%> (+1.00%)
... and 2 more

Copy link
Member Author

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arifogel)


projects/batfish/src/main/java/org/batfish/representation/arista/AristaConfiguration.java, line 1903 at r1 (raw file):

      // Continue: on match, change the default.
      if (action == LineAction.PERMIT) {
        trueStatements.add(Statements.SetLocalDefaultActionAccept.toStaticStatement());

codecov reveals we need new unit tests of continue statements

Copy link
Member

@arifogel arifogel left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion

Prior to this PR, Arista modeled route-maps as nested structures, so that if
there were N terms, those terms would go into a recursive structure that was N
terms deep. For large N (hundreds+) this can cause recursion limits in Java,
e.g., in walking the route-map or in serializing it to disk.

Fix this by adopting (neearly verbatim) the logic from NX-OS.

Validated by existing unit tests + Batfish Enterprise compare view: routes are
the same before and after in many real networks.
Copy link
Member Author

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@dhalperi dhalperi merged commit 6bf1b6a into batfish:master Dec 2, 2020
@dhalperi dhalperi deleted the arista-rm-redo branch December 2, 2020 02:58
dhalperi added a commit to dhalperi/batfish that referenced this pull request Dec 2, 2020
dhalperi added a commit to dhalperi/batfish that referenced this pull request Dec 2, 2020
dhalperi added a commit that referenced this pull request Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants