Open brigadier opened 8 years ago
This is not a bug. Sophia shares a write-ahead log pool for all databases. Open an existing database during run means to reply existing log files. This only works during initial environment open.
Do you have a work case where you need this feature?
After sp_destroy(db)
was called, it is impossible to reopen db again with sp_open(db)
, the env should be closed and reopened with sp_destroy(env); sp_open(env);
right?
Yes, this is tricky. Database shutdown happens in background. Some explanations are available here: https://github.com/pmwkaa/sophia/issues/106
This probably will be fixed in future: database shutdown should wait sp_destroy(db)
a. until all references are released (transactions, compaction, etc)
b. all in-memory indexes flashed to disk.
If those two conditions are met, there would be no need to replay logs.
@pmwkaa is the solution proposed by you being worked on or even already implemented?
The "Create or open database after environment start" example from the
http://sphia.org/administration.html#database
page does not work when DB already exists. First run - ok, DB gets autocreated; second run - error.