这是indexloc提供的服务,不要输入任何密码
Skip to content

skip system and unsample-able collections in introspection #160

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

Conversation

hallettj
Copy link
Collaborator

We have had users unable to run introspection because sampling fails on an automatically-generated collection called system.views. This collection is generated if the database has any views. On some deployments attempts to run aggregate (which is what introspection sampling uses) fail with a permissions error. We've seen this come up in MongoDB v6 running on Atlas.

Collections prefixed with system. are reserved for internal use. We shouldn't include them in introspection. https://www.mongodb.com/docs/manual/reference/system-collections/#synopsis

This PR makes two changes:

  • skip collections whose names begin with system., and log a warning
  • when sampling a collection fails for any reason skip that collection and log a warning instead of failing the entire introspection process

@hallettj
Copy link
Collaborator Author

I wrote an integration test for this, but since our integration test database runs without any security measures in place it was taking too long for me to reproduce the error. So no automated test. Sorry!

@hallettj hallettj merged commit 66f9e7b into v1 Apr 16, 2025
1 of 2 checks passed
@hallettj hallettj deleted the jessehallett/eng-1613-mongodb-exclude-systemviews-from-introspection branch April 16, 2025 23: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.

2 participants