-
Notifications
You must be signed in to change notification settings - Fork 3.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
Loki: Do not store exact log line duplicates (now including unordered inserts) #6642
Conversation
…p and log content Signed-off-by: Edward Welch <edward.welch@grafana.com>
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.
Are we missing a test for the unordered case, or am I missing something?
@slim-bean we may not need this workaround if we make /push safe to retry |
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 prefer this behavior. It should also handle deduping across blocks as-is because we rebuild out of order chunks before flushing to ensure that once flushed to storage, all chunks maintain internal ordering for performance: https://github.com/grafana/loki/blob/main/pkg/chunkenc/memchunk.go#L914
Signed-off-by: Edward Welch <edward.welch@grafana.com>
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0.1%
+ logql 0%
+ loki 0% |
Signed-off-by: Edward Welch <edward.welch@grafana.com>
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0.1%
+ logql 0%
+ loki 0% |
* Update production-ready Loki in docker-compose (#6691) * Improved docker-compose setup: - S3-like storage - Interactive debugging by optionally exposing dlv ports - Improve performance - Use SSD mode (read/write) - GroupCache - Latest versions of loki, promtail, grafana - Scaling * Adding diagram & updated README Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Upgrade guide Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Adding steps to build debug image Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Add prometheus Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Add datasources and disable Grafana auth Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Add configurable groupcache capacity (#6678) * Add configurable groupcache capacity Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Improving the verbiage for clarity - thanks Travis! Changed the default size to 100MB Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Adding config docs Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * Removed test - it was pretty redundant, plus groupcache panics if you try init its http server more than once Signed-off-by: Danny Kopping <danny.kopping@grafana.com> * updated versions to the latest release v2.6.1 (#6703) * updated versions to the latest release v2.6.1 (#6705) * Add function to reset boltDBIndexClientWithShipper singleton In a downstream project I have a test case that creates multiple stores with different BoltDB shipper schema configurations. Since the client for the store is a singleton and is re-used, there needs to be a function to reset it as well. This function must only be used in tests. Signed-off-by: Christian Haudum <christian.haudum@gmail.com> * promtail: Inject tenant ID when receiving X-Scope-OrgID in heroku target (#6695) * inject tenant ID header * fix import order * Add push route (#6616) * Loki: Return an __error_details__ label for any line which incurs a __error__ while being processed (#6543) * adds an __error_details__ label which includes any details available about a logql error. Signed-off-by: Edward Welch <edward.welch@grafana.com> * fix lint, changed a test a little Signed-off-by: Edward Welch <edward.welch@grafana.com> * reset error details in Reset() function Signed-off-by: Edward Welch <edward.welch@grafana.com> * Loki: Do not store exact log line duplicates (now including unordered inserts) (#6642) * do not insert log lines which are an exact duplicate in both timestamp and log content Signed-off-by: Edward Welch <edward.welch@grafana.com> * update test to now ignore dupes pushed out of order Signed-off-by: Edward Welch <edward.welch@grafana.com> * make the test unordered to be more thorough Signed-off-by: Edward Welch <edward.welch@grafana.com> Co-authored-by: Danny Kopping <danny.kopping@grafana.com> Co-authored-by: Vladyslav Diachenko <82767850+vlad-diachenko@users.noreply.github.com> Co-authored-by: Christian Haudum <christian.haudum@gmail.com> Co-authored-by: Pablo <2617411+thepalbi@users.noreply.github.com> Co-authored-by: Salva Corts <salva.corts@grafana.com> Co-authored-by: Ed Welch <edward.welch@grafana.com>
… inserts) (grafana#6642) * do not insert log lines which are an exact duplicate in both timestamp and log content Signed-off-by: Edward Welch <edward.welch@grafana.com> * update test to now ignore dupes pushed out of order Signed-off-by: Edward Welch <edward.welch@grafana.com> * make the test unordered to be more thorough Signed-off-by: Edward Welch <edward.welch@grafana.com>
What this PR does / why we need it:
The behavior for Loki handling of log lines has been like this:
This behavior was changed when we added support for receiving and storing unordered logs.
This PR partially addresses the issue by making sure that inserts into the unordered head block are deduped according to those rules.
However, I believe it's still possible to insert exact duplicates if it's done so across multiple blocks in a chunk, and this is very difficult to solve for, instead I think we should accept these and de-dupe them at query time.
At query time we de-duplicate exact lines across chunks but not within a single chunk (because the rules were such that we would never have exact dupes in a single chunk), but I think to completely handle this we would need to have exact de-duplication within a chunk at query time also.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CHANGELOG.md
.docs/sources/upgrading/_index.md