-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(pkg/stanza/input/file/reader): skip building fingerprint in case of configuration change #10485
fix(pkg/stanza/input/file/reader): skip building fingerprint in case of configuration change #10485
Conversation
This is draft as I want to add some unit tests to the PR |
7282b95
to
df0f936
Compare
Not sure, how this change affects this code: opentelemetry-collector-contrib/pkg/stanza/operator/input/file/fingerprint.go Lines 59 to 75 in 90efffd
There shouldn't be an issue for increasing the fingerprint size. I will test it for decreasing the fingerprint size, but I consider PR ready to review |
for decreasing the @djaglowski WDYT? |
205b671
to
df0f936
Compare
Am I correct in thinking that this only affects fingerprints that have been loaded from a storage extension? If so, I wonder if we could detect this and normalize the fingerprints during startup. This would seem to be preferable to adding complexity to the ongoing read loop. |
Yes, it affects only fingerprints which have been loaded from storage
So, as I understand flow correctly, you propose to add logic to this function: opentelemetry-collector-contrib/pkg/stanza/operator/input/file/file.go Lines 324 to 361 in c522cef
|
I think in theory this case would be better handled in Comparing benchmarks before and after the shows no notable change:
Only thing I would ask is that new test cases be added rather than adding to the existing "GrowAndStop" test. |
Sure, I was considering that, but it will be mostly copy of the |
…of configuration change If customer changes fingerprint_size while offset is behind the value, it is going to panic as it is unable to rebuild fingerprint Signed-off-by: Dominik Rosiek <[email protected]>
Signed-off-by: Dominik Rosiek <[email protected]>
Signed-off-by: Dominik Rosiek <[email protected]>
df0f936
to
251c4f0
Compare
…of configuration change (open-telemetry#10485) * fix(pkg/stanza/input/file/reader): skip building fingerprint in case of configuration change If customer changes fingerprint_size while offset is behind the value, it is going to panic as it is unable to rebuild fingerprint Signed-off-by: Dominik Rosiek <[email protected]> * chore: changelog Signed-off-by: Dominik Rosiek <[email protected]> * feat(tests): extract fingerprint size change as separate test Signed-off-by: Dominik Rosiek <[email protected]>
Description:
If customer changes fingerprint_size while offset is behind the value,
it is going to panic as it is unable to rebuild fingerprint
Reproduction:
logs/file.txt
use this configuration
run again with ioncreased fingerprint_size
The error occures:
Link to tracking Issue: N/A
Testing: ToDo
Documentation: in code comments