-
Notifications
You must be signed in to change notification settings - Fork 3.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
The pagination results order of the logs is incorrect #9705
Comments
The deeper reason is method #mergeOrderedNonOverlappingStreams called by A reasonable way is to traverse each stream and get the latest time line and then continue loop to get the next. In fact it's method name have said that streams should be non-overlapping, but in Loki different streams' entries could have overlapping time, Like above test case. |
Hi @honganan Thanks for the detailed report. We will have a look at the issue. |
That's great! I have changed the test case as some I have made a fix locally, and I am trying to send a PR. |
Describe the bug
query-frontend
split query and send to queriers, then collect the response data and merge, then return the firstlimit
lines sort by timestamp.However, In some situations, if the total number of log lines returned by queriers are bigger than the
limit
, the last returned result may not be the firstlimit
lines. I think problem comes from the heap sort (not sure if it's api usage problem).I found this in our production environment, after research I create a simple test case below which can reproduce it easier.
To Reproduce
Expected behavior
There are 12 lines in total (nanoseconds 1 ~ 12), and
limit
is 10, expect return 12 ~ 3.The text was updated successfully, but these errors were encountered: