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

Second step for refactor distributed query #576

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

zhuoyuan-liu
Copy link
Contributor

In this step, we would like to refactor the way of completing a distributed query and minimize the write request to the database.

Changelog:

  • Removed TrackExcution function and relevant table
  • Replaced VerifyComplete with CleanupCompletedQueries. In this case, we don't need to check the complete status whenever we receive new data from Osquery. Instead, we check it periodically with the expired function. Since we changed how to fetch the list of target queries, keeping a distributed query in an active state does not affect performance.
  • Update how to get lists of target nodes in API and osctrl-admin. We use the intersection to get a list of targeted nodes. We can easily extend this part to support more tags and unions or other operations.

TODO:

  • Remove everything related to CreateTarget function and relevant database table. This function was used by admin, API and cli. I am wondering if we can remove these duplications and make sure the Admin and CLI talk to API instead of the database directly.

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.

1 participant