Open jamesreprise opened 1 year ago
do you think just checking two directories exist is sufficient behaviour @jamesreprise ? https://github.com/vaticle/typedb/pull/6689
do you think just checking two directories exist is sufficient behaviour @jamesreprise ? #6689
Based on discussions we've had, if we don't decide or control what happens in either of the directories, then we can't require anything to exist (or say that because something does or doesn't exist that the file is valid or invalid). A temporary measure could be to include a file with some magic bytes named TYPEDB_DATABASE
so we can validate that this is a real database created by TypeDB. However, this isn't much added value over requiring a data and schema folder exist.
Let's keep this in mind for TypeDB 3.0
Just FYI, I did face that situation on my side as I had a volume mounted that contained other directories (i.e. to import data).
Description
When a new folder is created by another program in server/data/, TypeDB assumes that it is a database without checking the file layout first. It also creates a schema folder, even if there is no data folder in place. It then halts and produces the following error:
This new folder has no data folder at all, yet the error reports an "incompatible data version '0'".
Environment
Reproducible Steps
Expected Output
A warning (or error) that a given database folder is not valid.
Actual Output
and a valid schema directory is created in the folder, which is particularly strange behaviour.