-
Notifications
You must be signed in to change notification settings - Fork 190
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
[BUG] Torii is not returning indexing error even though it hasn't fully indexed data #2811
Comments
We show that error when there are 0 models indexed yet. The error disappears when at least 1 model has been indexed. So it isnt supposed for the world to be fully indexed, because anyway indexing is not finite. I can get rid of the error though ig, as it is a bit confusing |
Makes sense. Is there a way to know when the initial indexing is done? That would be very helpful when scaling up a cluster of torii replicas |
This should be something we can have yeah, when torii is indexing the pending block and not historical blocks. We already have in the database this info with the contracts heads @Larkooo right? Maybe in an other PR we could expose this info in a similar manner to the |
#2827 just removes the message but doesn't implement the full solution we've talked above right? |
Ah right, it removed the error, but doesn't expose any syncing state. But maybe the syncing state should be queried differently, with a specific query on the tables I mentioned. Since we can't return a valid data for a query with other data that is not expecting in return. Currently people are mostly using SQL to know the Torii syncing state: SELECT * FROM contracts; This gives the head for each contract: Do you think we need an other endpoint to give the head of each contracts specifically? Or since a SQL query can be crafted for that, it's ok like so? |
I definitely need some way of checking the state "is this node fully synced" or not to be able to provide proper upscaling of replicas. So the ideal solution would be to have an endpoint /ready or something which returns 200 only when that is the case. I can also query the SQL though, it's not much different for me. The only question I have is what do I compare the HEAD values to; where to get the comparison from? |
Ah, I see. @Larkooo does this sounds good to you too? |
I think for now you could just do something like
which will mean the contract has been synced from a pending block. If it switches back to range fetching, that will get NULLed so in combination with the sql endpoint. you could do a fetch to |
Sounds great to me @Larkooo, @steebchen if you have any issue with this solution, please re-open here or a new issue to follow up on that. |
Confirmed it works, thanks! |
In the beginning, it returns:
which is good. However, at some point, the message disappears, even though the data is not fully indexed yet. Some data is returned but it takes another plenty of minutes. Maybe this might be due to the data not fully being written do the db yet?
The text was updated successfully, but these errors were encountered: