-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix event expiration to prevent losing events #8535
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
Fixes osquery#8524 by ensuring the last events are never expired from a table. Without this change, new event IDs could be unintentionally generated starting from 1, while optimizations tell the generate function to look at a higher ID. All of those newer events would then never be logged.
| // Events are expired after being queried (except for last valid event -- | ||
| // optimize should take care of that event not being returned again, but that | ||
| // is tested separately below.) |
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.
I don't really understand how optimize prevents it from being returned. Or how this tests it.
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.
Optimization keeps track of the highest eventid and then when the generate function is called any event with a lower ID is skipped when returning rows. The test for optimization verifies that behavior.
|
@alessandrogario Can you review this? |
|
@zwass What was the conclusion here? I know you talked for awhile at Office Hours about this. Is it ready for merge? |
|
I believe it's ready but I am hoping that @alessandrogario will review it because it's deep in the events code. |
|
Going ahead and merging. |
Fixes #8524 by ensuring the last events are never expired from a table. Without this change, new event IDs could be unintentionally generated starting from 1, while optimizations tell the generate function to look at a higher ID. All of those newer events would then never be logged.