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.
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.