Dear Team, I am working on a version update from 0.8.29 to (current latest) 0.9.12 in my app, but got stuck in the import step.
I want to use use the nippy format because I have some types that cannot be read by default (LocalDate, byte array etc).
1. Created the dump with dtlv-0.8.29 -d . --nippy dump > db-dump.nippy
2. Trying to import the dump with cat db-dump.nippy | dtlv-0.9.12 -d ./imported -n load
The dump file file is successfully created in (1) but running (2) hangs indefinitely. The new ./imported/data.mdb file is stuck at the size of 40960 bytes. Seems like the process hangs (no cpu load).
Please advise thanks2
Seems like the problem is not only with the standalone dtlv command (amd64 linux build). Running the jar file version has the same effect:
cat db-dump.nippy | java --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED -jar ~/Downloads/datalevin-0.9.12-standalone.jar -d ./imported --nippy loadAre you able to create a gist? Or even something you can show off? Guess that might help. @huahaiy is really fast in responding. But i guess to fix a bug he has to reproduce it somehow.
ok, will try. in the meanwhile, I got a thread dump of the java process.
And maybe open up an issue if its really a bug
Please follow the guide at https://cljdoc.org/d/datalevin/datalevin/0.9.12/doc/database-upgrade
Is this a Datalog DB or not?
You did not specify it in you command
I don't think cat or pipe is well tested, I would use -f option to specify source and destanation
for Datalog db, you need -g
./dtlv-0.8.29 -d /src/dir -g -n -f dump-file dump
./dtlv-0.9.12 -d /dest/dir -f dump-file -g -n load
hey @huahaiy, thanks for jumping in to this thread.
> for Datalog db, you need -g
Apparently -g and -n cannot work together.
The problem with -g is that it disables -n and the entities will be dumped as edn regular maps instead of just the triples. But I need Nippy serialized values in the dump, because I have values in the database that cannot be pretty-printed by dtlv (for example, LocalDate, LocalTime, byte array, etc)
> I don't think cat or pipe is well tested, I would use -f option
I tried, had the same experience with explicitly specifying the file instead of using stdin/stdout.
did you try -g and -n together?
why would -g disable -n? did you try?
if it is nippy dump, -f must be given, apparently you did not
yes, I can confirm I have tried -g and -n together. For example, running:
dtlv-0.8.29 -d . -g -n -f dump-file dump
will result
[23 :spend/tx-day {:nippy/unthawable {:type :serializable, :cause :exception, :class-name "java.time.LocalDate", :content nil, :exception #error {
:cause "java.time.Ser"
:via
[{:type java.lang.ClassNotFoundException
:message "java.time.Ser"
:at [java.lang.Class forName "DynamicHub.java" 1132]}]
:trace
[
so it looks like LocalDate cannot be serialized> if it is nippy dump, -f must be given, apparently you did not oh thanks, I was not aware of this restriction. Tried again, see result above.
well then nippy is not going to help you either
I see, so if I understand correctly, Nippy itself also cannot serialize java.time.LocalDate. Thanks for checking it. I will move forward with a application code exporting/importing the database. 🙇
Datalevin cannot handle arbitrary object at this point, we have a ticket for that
one thing you may be able to do, is to dump/load in your app, where all the missing classes probably are present, because you did write them into DB in the app.
datalein.main/dump and datalein.main/load can be called in your code.
these are what dtlv command is calling anyway
so they are the same
dump in 0.8.29, then close app, change deps to 0.9.12, then load
updated the upgrade doc to mention this in code upgrade method.