Granola-Team / mina-indexer

The Mina Indexer is a re-imagined version of the software collectively called the "Mina archive node."
Apache License 2.0
18 stars 10 forks source link

Problem: can't determine database version from directory #1168

Closed robinbb closed 2 months ago

robinbb commented 2 months ago

Given a mina-indexer's database directory, one cannot determine what version of database it is. In other words, one cannot determine if a given version of the indexer is compatible with an on-disk version of the database.

One could query the running indexer about its version of database, but how do we know whether the running indexer is using the particular database directory that we are considering.

Also, it is often the case that the running indexer has no open socket for querying.

Further, the indexer that created (and expects to use) the database may not be running.

So, we are left with no way to discover the version of a database.

This could be solved by, for example, writing a file with name "VERSION" inside the database directory as soon as it is created by an indexer. If this is done, then it also makes sense, whenever an indexer launches, to have it verify that the version matches its own.

robinbb commented 2 months ago

The absence of this feature makes it very difficult to correctly write deployment software for the indexer, and negatively affects user experience.