Hello James,

 

Did you try to set ADDCACHE ?

This way you might run out of disk space during disk caching, before database corruption occurs.

Be careful, you may have to serialize the XML in order to use this option with db:add/db:replace (I read you are in the REST-XQ layer).

 

Otherwise, the only way to prevent database corruption might be to check disk size regularly and reject new data by program…

 

http://docs.basex.org/wiki/Options#ADDCACHE

http://docs.basex.org/wiki/Database_Module#db:add

 

 

Best regards,

Fabrice Etanchaud

Horanet Smart Objects

FR-85200 Fontenay le Comte

 

De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de James Ball
Envoyé : vendredi 1 avril 2016 16:48
À : BaseX <basex-talk@mailman.uni-konstanz.de>
Objet : [basex-talk] Expected behaviour with full disk

 

Hello,

 

I’m having some problems with BaseX in situations where there it runs out of disk space.

 

I’m delivering XML files to BaseX 8.4 using RestXQ.

 

A request is made and the XML is added to a database depending on some criteria. I receive many hundreds of thousands of requests and everything works well unless I run out of disk space.

J

What I would expect to happen is that BaseX would try to add the document, find it couldn’t due to the disk being full and return a server error (e.g. 500) and the transaction would be aborted leaving the database as it was before the request. Any further requests would all get errors returned.

 

What I’m seeing is that when a request is made that causes the disk to become full BaseX gets part way through adding the document, fails and returns an error but also leaves the database corrupted. Usually the server has to be restarted and then any database that has been affected has to be deleted - it’s rare to be able to save anything from it.

 

The errors vary but it is usually a NullPointer exception and then java.nio.channels.OverlappingFileLockException. for further requests.  

 

I’ve tried turning off logging and setting parallel to 1 to see if that made any difference but it doesn’t.

 

Is what I’m seeing unique to my setup or do others see this?

 

Is there anything I can do to make BaseX just stop accepting requests when disk space runs out to protect my databases?

 

Many thanks, James