Hi Marco,
I'm sorry to hear your database got corrupted. Once a database has inconsistent structures, it's difficult to restore its original state. Some questions that might help:
1. Can you do a full optimization via db:optimize('db', true())? Before calling the command, I would recommend you to create a backup of your database. 2. Can you successfully serialize or export your database? 3. Did you do any backups during the last months that may help us to find the first corrupt database version? 4. Which version(s) of BaseX did you use?
Hope this helps, Christian
On Mon, Jan 26, 2015 at 10:51 AM, Marco Lettere marco.lettere@dedalus.eu wrote:
Hi all, we have an installation that has been running in production for nearly two months now. It's very insertion intensive and from time to time we need to run a db:optimize to keep it on track because the time it takes to serve a request turns from about 2 seconds to 100k seconds. But after the optimize it again runs with the expected performance. Today we noticed again a strange difficulty in serving requests so we tried the usual approach but we got this exception during the optimize:
[SENR0001] Attributes cannot be serialized:attribute determinerCode {"INSTA....
Upon running an inspect command, we got a long list of EOF exceptions followed by the resume stating about 85K wrong parent/descendants relationships.
Is there any idea on what could have gone wrongly and if possible any way to recover from this? Thank you very much. Regards, Marco.
java.io.EOFException at java.io.RandomAccessFile.readFully(RandomAccessFile.java:446) at java.io.RandomAccessFile.readFully(RandomAccessFile.java:424) at org.basex.io.random.TableDiskAccess.readBlock(TableDiskAccess.java:525) at org.basex.io.random.TableDiskAccess.readPage(TableDiskAccess.java:489) at org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:468) at org.basex.io.random.TableDiskAccess.read1(TableDiskAccess.java:148) at org.basex.data.Data.kind(Data.java:290) at org.basex.core.cmd.Inspect.inspect(Inspect.java:50) at org.basex.core.cmd.Inspect.run(Inspect.java:27) at org.basex.core.Command.run(Command.java:360) at org.basex.core.Command.execute(Command.java:94) at org.basex.api.client.LocalSession.execute(LocalSession.java:122) at org.basex.api.client.Session.execute(Session.java:36) at org.basex.core.CLI.execute(CLI.java:106) at org.basex.core.CLI.execute(CLI.java:90) at org.basex.BaseX.console(BaseX.java:197) at org.basex.BaseX.<init>(BaseX.java:171) at org.basex.BaseX.main(BaseX.java:42) Checking main table (43626334 nodes):
- 0 invalid node kinds
- 0 invalid parent references
- 84663 wrong parent/descendant relationships (pre: 6299342,..)
Warning: Database is inconsistent. 'db' inspected in 21789.24 ms.