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

Add unique indexes to beaconFQDN and beaconProxy collections #689

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

Zalgo2462
Copy link
Contributor

Fixes #688

Adds the necessary unique indexes to cover the upserts performed in the fqdn and proxy beacon analyses.

Running a .explain for the FQDN beacon selector (see #688) now returns the following plan without a filter stage:
image

Copy link
Contributor

@fullmetalcache fullmetalcache left a comment

Choose a reason for hiding this comment

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

Just the one change please, the other key looks good!

Thanks!

@@ -47,6 +47,7 @@ func (r *repo) CreateIndexes() error {
// set desired indexes
indexes := []mgo.Index{
{Key: []string{"-score"}},
{Key: []string{"src", "dst", "fqdn", "src_network_uuid", "dst_network_uuid"}, Unique: true},
Copy link
Contributor

Choose a reason for hiding this comment

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

In #690 , we are changing the keying to be src-fqdn and cutting out the dst (i.e., proxy) as part of the keying since it isn't really relevant for analysis. Can we please cut dst and dst_network_uuid from this key and just have it be "src" and "fqdn"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's revert the beaconProxy index commit from this PR and apply the change only in #690.

@Zalgo2462
Copy link
Contributor Author

Removed the change to beaconProxy and left a comment on #690 with the fix to be applied there.

Copy link
Contributor

@fullmetalcache fullmetalcache left a comment

Choose a reason for hiding this comment

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

lgtm!

@fullmetalcache fullmetalcache merged commit 3559371 into master Aug 18, 2021
@fullmetalcache fullmetalcache deleted the 688-add-fqdn-proxy-indexes branch August 18, 2021 14:58
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.

FQDN and Proxy Beacon updates are not properly indexed
2 participants