-
-
Notifications
You must be signed in to change notification settings - Fork 97
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]: restore operation fails (with no transaction history) #531
Comments
Hey @awb99, could you check with version |
I will. Is the db storage of 0.4.1488 identical to 0.4.1480 ? BTW: But I had to be very careful in my dependency management. I use datahike, shadow cljs and tml dataset in my project. And they together are not easy to get working together. So might take me some time to change version. |
0.4.1480 is much better than prior versions. But it is not perfect. If I do transact a schema to the database before importing, then I get schema constraint warnings that should
I assume this is because my schema that I commit already defines a higher transaction-id than the schema in the |
This documents what went wrong when I import to a brand new db without commiting In my production database I did add the field :shiphero-product/active and then I
|
I fixed the import issue with this trick: I remove This works because sometimes the database import The only non-generic thing in my bugfix is that I
|
What version of Datahike are you using?
0.4.1480
What version of Java are you using?
openjdk 17.0.1 2021-10-19
What operating system are you using?
linux, guix
What database EDN configuration are you using?
{:store {:backend :file
:path "data/datahike-db"}
:keep-history? false}
Describe the bug
I run export-db from a running server.
Then I start on another machine with a blank new datahike database, and add a schema transaction,
then I run import-db from the same dump that I created earlier.
On the restore there are this errors:
This is an extract from the dump:
There are a couple hundred lines like this in the beginning. I assume it is the schema specification
Is a restore from a dump expecting that I dont commit my schema first?
Is it possible to do a restore that does not import the schema?
The import works when I delete all the "schema lines" in the dump manually before importing.
What is the expected behaviour?
I have setup the datahike services so that it creates my schema when there is no currently existing database directory
automatically. So what would be nice is to do a db restore WITHOUT including the schema transactions.
This would make sense because if I do not keep a transaction log, and I have schema changes over time,
then the transactions from the dump would fail.
So what I want to do is make sure that when I import from a dump, I have certainity that my current schema is
satisfied from all imported transactions.
If the import with my current schema fails, then I could start an import with no schema, and possibly it could work.
But it will only work if there was no schema change, or if there was a schema change and all transactions in the
dump are according to the schema.
So to me it is essential to import a dump without the schema from the dump. Then I can run a preprocessing script
that makes non compliant transations comply, or simply remove them.
How can the behaviour be reproduced?
I can post something if it shoudl be required. Right now I cannot think of something that would be relevant.
The text was updated successfully, but these errors were encountered: