Hi Christian,
First thank you for your quick answer! I can understand it would be a tough job to restore a corrupt database. I'll try to use the lateste version of BaseX to use the inspect command but as you said it seems to apply to an opened database and BaseX returns the error when I try to open the database so I'm not sure it will work.
What I need is to understand what could have happened and ensure it does not happen again especially in production. You advise to do regular backups but isn't BaseX completely ACID-safe? From what I understood on the documentation, write operation or concurrent access should not put the database in a state from which it cannot recover. And right now it seems that crashing the machine resulted in the database being corrupted. Maybe the problem does not come directly from BaseX in the end, that's why I want to be sure of what BaseX really offers on this point.
For the regular backups we will have proper solution in place in production. But in our project we plan to use BaseX as a database to store documents data. Multiple users will be able, simultaneously to modify the same documents or different documents in real-time. To avoid bottlenecks we create one specific database per document but in the end we will end-up with concurrent access on the same database too. It is not realistic to backup each database on every modifications but we cannot backup the database everyday and just lose a day of work for some users when the databases are corrupted.
What would be your advice with our current situation? I can provide more input if you need anything.
Remi
2012/11/10 Christian Grün christian.gruen@gmail.com
Dear Remi,
it's usually a tough job to restore a corrupt database; at least there are no existing tools for it. The latest snapshot of BaseX [1] provides the (yet undocumented) command INSPECT, which can applied on an opened database, and which may give you some hint which part of the database has been damaged. Incremental backups are still on our agenda, and might slow down update operations, so, for the moment, I would advise to do regular backups (e.g. via CREATE BACKUP).
I hope this helps at least a little bit.. Christian
[1] files.basex.org/releases/latest/ ___________________________
On Fri, Nov 9, 2012 at 7:21 PM, Rémi Jannel remi.jannel@mydatalinx.com wrote:
Hi!
After crashing my computer while editing a BaseX database, BaseX now
returns
an error when trying to access the database .I was editing the database through a web application (in Javascript) communicating with BaseX
through
the PHP wrapper and not with BaseX GUI.
My system is Ubuntu 12.04 in a VirtualBox for the development on a Win7 64bits host system.
All the other BaseX databases are working properly but when I'm trying to open the one I need, an error is returned. I put the message at the end
of
the email.
I checked on my filesystem, the files corresponding to the database are still present in the BaseX data directory if you think it could be
useful to
debug what happened I could provide it.
Is there something wrong on the BaseX version I'm using that could
explain
the data being corrupted? And is there a way for me to recover the
database?
The error message:
Potential bug? Improper use? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 7.0.2 Java: Sun Microsystems Inc., 1.6.0_24 OS: Linux, i386 Stack Trace: java.lang.RuntimeException: Not expected: Data Access out of bounds [pre:1078, indexSize:9, access:9 > 8]. org.basex.util.Util.notexpected(Util.java:67) org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:394) org.basex.io.random.TableDiskAccess.read1(TableDiskAccess.java:107) org.basex.data.Data.kind(Data.java:319) org.basex.query.item.DBNode$4.next(DBNode.java:317) org.basex.query.path.IterStep$1.next(IterStep.java:46) org.basex.query.path.IterStep$1.next(IterStep.java:33) org.basex.query.path.IterPath$1.next(IterPath.java:68) org.basex.query.path.IterPath$1.next(IterPath.java:40) org.basex.core.cmd.AQuery.query(AQuery.java:102) org.basex.core.cmd.XQuery.run(XQuery.java:22) org.basex.core.Command.run(Command.java:328) org.basex.core.Command.exec(Command.java:309) org.basex.core.Command.execute(Command.java:77) org.basex.server.ClientListener.run(ClientListener.java:200)
Thanks,
Remi Jannel
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk