-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: use signoz ksuid for epoch nano in log id's #489
base: main
Are you sure you want to change the base?
Conversation
The issue with releasing this is that, till the n'th log we have the old ksuid. And there is no guarantee that id of old ksuid < id of the new ksuid. Now while paginating if we somehow land at a case were the query is id < id(n +1 th log) then the correctness of that query is not gauranteed. It's a rare case but it might happen. I am not sure what to do. From the surface level it's fine that it has a very rare occurance but it can happen. @srikanthccv any suggestion here ? |
Can you share some examples of such cases with IDs? |
here it is old
new
When I compare
|
Do we get any particular advantage by using |
The reason we have id instead of timestamp is that timestamp is not really unique. In our case id is basically giving more uniqueness to the timestamp and is allowing sorting on logs based on how they are received in otel collector for logs with similar timestamp. |
I understand the lack of strict uniqueness of timestamp, but that doesn't necessarily mean I can't use the filter by timestamp instead of ID? like give me a scenario where I can't substitute |
okay for |
Yes, as long as the order is consistent (something to verify with timestamp, id), can we use limit + offset with timestamp? |
@raj-k-singh, share your thoughts on this. |
For example, let's say we have 10 logs with timestamp X and we are paginating through the logs with ascending timestamps. If a page of results ends at the 4th log with timestamp X, we can't construct the query for the next page starting at the 5th log with timestamp X with filter like |
@nityanandagohain do we use (timestamp, id) both for pagination filter? If yes, if we can ensure that the transition to the new ksuid only happens at a timestamp boundary things should work out? i.e all logs with timestamp >= t0 will have the new ksuid while the ones with timestamp < t0 will have the old ksuid, with that if we use a filter like (timestamp >= t0 and id > XYZ) things should work out? |
If we add offset 4 (wherever the page ended), does it not give the desired result? |
Ya offset should also work 👍 |
So as of now ordering is done by timestamp and in the filters we pass the entire timerange and i.e during pagination the timerange remains the same and only the id filter gets updated. but here since we are just using order by timestamp it might be wrong as well as it should have order by id included in it. I will think more on this. I will pick this up once I am back |
Fixes SigNoz/signoz#6365