database corruption
Wednesday, 5 February 2014 · 2 messages
MB
Michel Banguerski5 Feb 2014 18:15 #
Greetings,
I am currently using BaseX 7.7.2 on windows 7.
Periodically I get a corrupted database which topically manifests itself by the following message:
<basex-talk at mailman.uni-konstanz.de>Improper use? Potential bug? Your
feedback is welcome:
Contact: basex-talk at mailman.uni-konstanz.de
Version: BaseX 7.7.2
Java: Oracle Corporation, 1.7.0_45
OS: Windows 7, x86
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: 33
at
org.basex.io.random.TableDiskAccess.flush(TableDiskAccess.java:124)
at org.basex.data.DiskData.finishUpdate(DiskData.java:212)
at org.basex.core.cmd.Add.run(Add.java:109)
at org.basex.core.Command.run(Command.java:345)
at org.basex.core.Command.exec(Command.java:321)
at org.basex.core.Command.execute(Command.java:78)
at org.basex.server.LocalSession.execute(LocalSession.java:122)
at org.basex.server.Session.execute(Session.java:37)
at org.basex.core.Main.execute(Main.java:146)
at org.basex.core.Main.execute(Main.java:130)
at org.basex.core.Main.console(Main.java:90)
at org.basex.BaseX.<init>(BaseX.java:168)
at org.basex.BaseX.main(BaseX.java:38)Once the database is corrupted there is no means to get the information back.
In order to restore a backup I have to manually shutdown running java processes to remove the locks.
I was able to narrow the circumstances of the corruption event to the following.
- The corruption occurs when adding a resource to the database
- The added resource needs to be big enough (one additional characher or xml node makes the difference)
- The database has to be in a certain state at the moment of the resource addition for the corruption to happen: the same resource added at a different time will note cause corruption
- The database could leave the 'pre-corruption' state if some activity happens
I was able to capture a database in 'pre-corruption' state in a backup, the database has no resources (all removed previously) and the backup is 44Kb I also have an couple of XML files that cause corruption of this database when added both are 2kb.
I mostly experience the corruption when using
db:add() or db:replace() functions in xqm files but in the example I managed to capture the corruption happens when issuing the add command in CLI as well.
I can provide the backup and XML files but I suppose that sending them to the list as attachments would not be welcomed.
I performed the same test with the same result on Linux:
- restaure the 'pre-corrupted' backup
- open the database
- add the XML file
Finally I performed the same tests with BaseX78-20140203.150949 and no corruption happened.
I'm seeking the most stable configuration for my application and therefore I would like to have Your opinion: Should I seek a workaround in BaseX 7.7.2 to avoid corruption or should I go with 7.8 in spite it being in beta stage?
TIA
Best regards
MichelCG
Christian Grün5 Feb 2014 22:45 #
Hi Michel,
thanks for providing us with all the details.
I'm glad to hear the problem seems to be fixed in the 7.8 snapshot. You can safely switch to this version; the official 7.8 release is planned for next week (in alignment with the XMLPrague conference).
Hope this helps,
Christian
Quoted text · Michel Banguerski · 85 lines
On Wed, Feb 5, 2014 at 6:15 PM, Michel Banguerski <banguerski at gmail.com> wrote: > Greetings, > > I am currently using BaseX 7.7.2 on windows 7. > > Periodically I get a corrupted database which topically manifests itself by > the following message: > > Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 7.7.2 > Java: Oracle Corporation, 1.7.0_45 > OS: Windows 7, x86 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: 33 > at > org.basex.io.random.TableDiskAccess.flush(TableDiskAccess.java:124) > at org.basex.data.DiskData.finishUpdate(DiskData.java:212) > at org.basex.core.cmd.Add.run(Add.java:109) > at org.basex.core.Command.run(Command.java:345) > at org.basex.core.Command.exec(Command.java:321) > at org.basex.core.Command.execute(Command.java:78) > at org.basex.server.LocalSession.execute(LocalSession.java:122) > at org.basex.server.Session.execute(Session.java:37) > at org.basex.core.Main.execute(Main.java:146) > at org.basex.core.Main.execute(Main.java:130) > at org.basex.core.Main.console(Main.java:90) > at org.basex.BaseX.<init>(BaseX.java:168) > at org.basex.BaseX.main(BaseX.java:38) > > Once the database is corrupted there is no means to get the information > back. > In order to restore a backup I have to manually shutdown running java > processes to remove the locks. > > I was able to narrow the circumstances of the corruption event to the > following. > - The corruption occurs when adding a resource to the database > - The added resource needs to be big enough (one additional characher or xml > node makes the difference) > - The database has to be in a certain state at the moment of the resource > addition for the corruption to happen: the same resource added at a > different time will note cause corruption > - The database could leave the 'pre-corruption' state if some activity > happens > > > I was able to capture a database in 'pre-corruption' state in a backup, the > database has no resources (all removed previously) and the backup is 44Kb > I also have an couple of XML files that cause corruption of this database > when added both are 2kb. > > I mostly experience the corruption when using db:add() or db:replace() > functions in xqm files but in the example I managed to capture the > corruption happens when issuing the add command in CLI as well. > > I can provide the backup and XML files but I suppose that sending them to > the list as attachments would not be welcomed. > > I performed the same test with the same result on Linux: > - restaure the 'pre-corrupted' backup > - open the database > - add the XML file > > Finally I performed the same tests with BaseX78-20140203.150949 and no > corruption happened. > > > I'm seeking the most stable configuration for my application and therefore I > would like to have Your opinion: Should I seek a workaround in BaseX 7.7.2 > to avoid corruption or should I go with 7.8 in spite it being in beta stage? > > > TIA > Best regards > Michel > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery