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

appnet: filter duplicate paths in QueryPaths #161

Merged
merged 2 commits into from
Aug 12, 2020
Merged

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Aug 12, 2020

Filter paths with identical sequence of interfaces. These duplicates
occur because sciond may return the same "effective" path with different
short-cut "upstream" parts. We don't need these duplicates, the paths are
identical for our purposes; we simply pick the one with latest expiry.

See also discussion in scionproto/scion#2445 (currently not merged).


This change is Reviewable

Filter paths with identical sequence of interfaces. These duplicates
occur because sciond may return the same "effective" path with different
short-cut "upstream" parts. We don't need these duplicates, they are
identical for our purposes; we simply pick the one with latest expiry.

See also discussion in scionproto/scion#2445 (currently not merged).
@matzf matzf requested a review from FR4NK-W August 12, 2020 08:38
Copy link
Member

@juagargi juagargi left a comment

Choose a reason for hiding this comment

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

just a small nit.

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @FR4NK-W and @matzf)


pkg/appnet/path_selection.go, line 127 at r1 (raw file):

func filterDuplicates(paths []snet.Path) []snet.Path {

	set := make(map[snet.PathFingerprint]int)

I would rename set to something like chosenPath

Copy link
Contributor Author

@matzf matzf 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 1 files reviewed, 1 unresolved discussion (waiting on @FR4NK-W and @juagargi)


pkg/appnet/path_selection.go, line 127 at r1 (raw file):

Previously, juagargi (Juan A. Garcia Pardo) wrote…

I would rename set to something like chosenPath

Done.

Copy link
Member

@juagargi juagargi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @FR4NK-W)

@matzf matzf merged commit 6f9416b into master Aug 12, 2020
@matzf matzf deleted the matzf/filter-duplicates branch August 12, 2020 09:55
Copy link
Contributor

@FR4NK-W FR4NK-W 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: :shipit: complete! all files reviewed, all discussions resolved


pkg/appnet/path_selection.go, line 137 at r1 (raw file):

kept := make(map[int]struct{})

Ok with me, but wouldn't it have been easier to keep a slice of indices you want to keep and sort that in ascending order (to preserve the initial order)?

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.

3 participants