Am Dienstag, 10. September 2013, 10:24:50 schrieb James Ball:
I've got a collection with about 1.4 million small XML files in it. I can load all these through the GUI with no problems.
However really I need to be loading them, a few at a time, through PHP and have code to do this. Because the process involves add, query, add and so on I have set UPDINDEX to true on the database. In most instances everything works fine but sometimes I get the error below (it's not on particular documents, a second run will give the error in different places).
Can you try to reproduce the problem without using PHP, but a BaseX command script [1] instead (e.g. many XQUERY commands each executing a replace with a few documents). If the problem persists, we will be able to eliminate the PHP binding and you will not have to use java ;)
exception 'Exception' with message 'Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 7.7 Java: Apple Inc., 1.6.0_51 OS: Mac OS X, x86_64 Stack Trace: java.lang.IllegalStateException: Key should not exist
at org.basex.index.value.UpdatableDiskValues.index(UpdatableDiskValu es.java:79) at org.basex.data.DiskData.indexEnd(DiskData.java:356)
Can you check if the error occurs always at line 356 in DiskData.java? If yes, will it be possible to send us a list of all attribute values from all documents?
The problem is that a key, which has been determined to be not existing in a previous step, actually exists in the index when trying to insert it. I checked the relevant code and I fail the see any obvious error. In my opinion the following can cause the incorrect behavior:
1. the PHP binding somehow manages to update the database in parallel (the locking mechanism should already prevent that) 2. there is a bug in the index update code: possible, although I fail to see it; either reproducible example should be provided or another pair of eyes 3. something else (e.g. our implementation of hash table contains duplicate keys, which is very unlikely).
Best regards, Dimitar