Skip to content
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

[CORE-2256] Fix hint return and display #9968

Merged
merged 46 commits into from Apr 30, 2024

Conversation

robert-uhl
Copy link
Contributor

@robert-uhl robert-uhl commented Apr 22, 2024

Reworked paging and hints. Added a plethora of tests against a testing Loki instance. Worked with @pleeko to test expected vs. actual results.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 75.34247% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 58.30%. Comparing base (3599156) to head (d32ab66).
Report is 2 commits behind head on master.

Files Patch % Lines
src/server/logs/cmds/cmds.go 16.66% 10 Missing ⚠️
src/server/logs/logs.go 82.14% 5 Missing ⚠️
src/server/logs/query.go 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9968      +/-   ##
==========================================
+ Coverage   58.28%   58.30%   +0.02%     
==========================================
  Files         614      614              
  Lines       75593    75610      +17     
==========================================
+ Hits        44060    44088      +28     
+ Misses      30980    30964      -16     
- Partials      553      558       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/server/logs/cmds/cmds.go Show resolved Hide resolved
This will be used in the case of multiple logs at the same timestamp.
…erm/pachyderm into rau/core-2256-debug-improve-hints
Working through each possibility individually.
@robert-uhl robert-uhl marked this pull request as ready for review April 26, 2024 20:11
@robert-uhl robert-uhl requested review from a team as code owners April 26, 2024 20:11
Copy link
Member

@jrockway jrockway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained on Slack, I don't think we need this feature. The chances of having a lot of lines with the same timestamp is pretty much zero, and even then, you still can't get duplicate-timestamped lines that exceed the loki server's limit. I'd just let it be.

You should keep the changes that let you ingest old samples. I'd expect some existing tests to be failing if they can't, though.

src/internal/lokiutil/testloki/testloki.go Show resolved Hide resolved
@pleeko
Copy link
Member

pleeko commented Apr 26, 2024

TY for implementing these fixes!

@robert-uhl
Copy link
Contributor Author

The chances of having a lot of lines with the same timestamp is pretty much zero, and even then, you still can't get duplicate-timestamped lines that exceed the loki server's limit.

With just promtail, you’re correct that the odds of it happening by chance are zero or close to it, but anyone in the cluster is able to write logs with any timestamp (within the bounds Loki permits). I think that it’s necessary to be at least aware enough of the possibility to not crash or loop infinitely when encountering runs of logs with the same timestamp, and the complexity involved even in handling that is enough that it gets one pretty close to just handling duplicate timestamps generally.

even then, you still can't get duplicate-timestamped lines that exceed the loki server's limit

This is also true; it’s a limitation of Loki which cannot be worked around (I’m pretty sure).

I share your concern regarding the amount of complexity this adds, but I think that it’s necessary, and hope that the extensive test coverage provides some level of protection from implementation bugs. It’d be great if Loki guaranteed unique timestamps, or if we didn’t rely on it, but I believe that this is the least bad solution.

@robert-uhl robert-uhl merged commit 920221f into master Apr 30, 2024
21 checks passed
@robert-uhl robert-uhl deleted the rau/core-2256-debug-improve-hints branch April 30, 2024 14:47
robert-uhl added a commit that referenced this pull request May 2, 2024
Reworked paging and hints. Added a plethora of tests against a testing
Loki instance. Worked with @pleeko to test expected vs. actual results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants