readTs: X less than minTs: Y for key during query

Hey guys, I’m having the same error as mentioned in this closed discuss thread.

Just wondering if this would be solved by restarting the alpha/zero service in a given cluster node?

You can just retry the transaction. That should be sufficient to get rid of this error.

This is even worse than I thought. This error happens every time I perform the query, for certain ids.
In essence, any instance of the cluster yields this error for certain predicate ids.
Is there a solution to cleaning the data somehow for this error to stop?

This simple query for certain ids fails every time:

{ranges(func:eq(view,"SOME_VIEW_ID")) { xid }}

This seems to a problem for the predicate view but not other predicates in the schema.
Is it possibly a problem in badger? The minTs value seems stuck, or the readTs was reset somehow?

The error happened on v1.0.3 and I’ve now tried v1.0.4 and the latest v1.0.4-dev and the error is the same

Is it possible for you to share your p, w and zw directories so that we could investigate? Also, does the error give the exact values of readTs and minTs?

Are you using multiple Zeros? There was a bug because of which readTs could have gone back but that is fixed in the nightly release. Though if that was the issue, it should occur for more predicates.

My cluster is 3-replica nodes of 1.0.3, each node has its zero, and yes the error gives out exact values for readTs and minTs.

After some hours, during the night some queries started being successful (it’s a bit intermittent right now), it seems that readTs was stuck for a very long time and I guess the cluster slowly caught up to the minTs? Is this something that makes sense? Sometimes I do another query and get the error again, with a slightly greater readTs than before. Could this be attributed to one node becoming slower perhaps?

Regardless, it may be useful to debug this either way. If you use my p folder data locally, you can see that the readTs is forever at a very low number while minTs is much greater, thus I can’t perform the query.
I’m going to DM you a zip of the p and w folders of one of the cluster nodes.

Can you create a Github issue so that we can continue a discussion there? Though note a bunch of bugs have been resolved since then and you should try and upgrade to the nightly build.

Created now. I tried the nightly with the same results.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.