-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(kubernetes_logs source): Start reading logs at checkpoint #4043
Conversation
Signed-off-by: MOZGIII <[email protected]>
…r confguration Signed-off-by: MOZGIII <[email protected]>
We should add this to list of gotchas with the |
It operates as expected in my testing so far. |
Could you expand on this? This is the |
start_at_beginning: true, | ||
// We want to use checkpoining mechanism, and resume from where we | ||
// left off. | ||
start_at_beginning: false, |
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.
Why are we not relying on the Default
implementation here? That would have avoided this bug in the first place.
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.
FileServer
does not implement Default
.
I know you've asked this before, and I was confused by this question last time, so might have forgot to address it, sorry.
I might still be confused, in that case could you please elaborate?
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.
Indeed, FileServer
does not have a safe constructor with defaults.
I think adding such would be a separate ticket, which I feel should be done, since right now it's very difficult to use the FileServer
type in a 'default' way.
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 think adding such would be a separate ticket, which I feel should be done, since right now it's very difficult to use the
FileServer
type in a 'default' way.
I'm not sure if default for the whole thing makes sense. But we could extract a subset of parameters into a Default
-constructible object and pass that.
However, even then, for something like a kubernetes_logs
source, I'd assign most of the settings manually. For instance, this one should probably be set in the source
level rather than being defined at the Default
that may change independently of the source (and potentially break the compatibility).
Some of the options I'd definitely offload to Default
, like max_read_bytes
.
We also need a proper test for this behaviour at the E2E, I'll create an issue (UPD: #4047).
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.
Sorry, I should have been clearer. We have encoded a reasonable set of default values into the Default
implementation for FileConfig
. It would take some tweaking, but we should really try to rely on those defaults wherever the source is reused.
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.
Ah, makes sense! FileConfig
isn't exactly a good fit for the use in kubernetes_logs
source, so we probably need to add a layer of indirection.
I'll create an issue for it (UPD: #4048).
I didn't properly address this at all, just copied from the previous implementation, my bad: #2653 (comment) |
I don't know why I'd think of the UPD: according to the table at #1020, the
This is a quite odd outliner, but the logic seems to be right nonetheless for this case. It may only happen if the file disappears and then reappears during the regular operation, with the same contents. Not using a checkpoint would mean that we'd start processing the file from scratch, that definitely has been read and checkpointed before. |
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.
Whoops! Glad we caught this.
I should have documented this. So I remember thinking about this option for some time, but don't quite remember what was bugging me, it's quite possible that it was a misinterpretation of the option on my part. I think I expected that with a |
…dotdev#4043) * Turn start_at_beginning off at kubernetes_logs source Signed-off-by: MOZGIII <[email protected]> * Add the extensive comments to motivate the decisions on the FileServer confguration Signed-off-by: MOZGIII <[email protected]> Signed-off-by: Brian Menges <[email protected]>
Closes #4042.
Also adds extensive comments to capture the motivation behind the decisions on the
FileServer
configuration.