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
Update schedule counter behavior #6223
Conversation
|
8b84095
to
9be650a
Compare
This came up in office hours today. I am in favor of redefining I recognize this breaks an unlikely use case where someone might have been using this to track executions. But that data is better accessed through the |
Close+reopen to retrigger build, which may fail again and is a KP. |
9be650a
to
fbe5d9d
Compare
I am rebasing the PR to (hopefully) fix the KP with the build status reporting. |
Ok so the test failures are not because of our CI infra. This change needs to be reflecting in at least one unit test:
Here is the documentation for building and testing locally: https://osquery.readthedocs.io/en/latest/development/building/#testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the unit test failures.
I think the the test is correct. If I understand this correctly |
@directionless, I think I missed the original discussion, but this change seems reasonable. I only read the code but it seems to be correct. You're call if we want this in 4.4.0. |
Change the counter behavior so only when a differential results is calculated the counter increments. With this new behavior the counter represents the order in which differentials results should be replayed to recreate state at a point in time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's deep dive into the test.
60f728f
to
497e98b
Compare
Ok @jnog, @directionless, I think this is the best approach to making the change. We only increment the counter when results are emitted, otherwise we might reset the counter. |
Thanks for fixing that @theopolis |
What is being changed?
The schedule counter increments every query execution. This is true even when a query has no new results to log. The Current behavior, which increments the query counter every execution, makes it difficult to determine whether or not a differential result was missed.
Change the counter behavior so only when a differential results is calculated the counter increments. With this change the counter represents the order in which differential results should be replayed to recreate the point in time state.
Looking for initial thoughts on this change. The documentation and original PR #3651 suggest the counter is only ever useful to detect the initial results. Changing the counter behavior this way doesn't break this use case.