Closed F21 closed 11 years ago
Looks like some behavioral change in ArangoDB...
I am so happy that we started writing tests for the client :smile:
Holding off with the 1.2.1 release because of this. It doesn't affect working with the 1.2 branch, but still, better to resolve anything before release.
Good idea :) I am currently working on other things, so am a bit busy to investigate this :(
After fixing this, we need to test it against 1.2 and 1.3 to make sure the change doesn't break backwards compatibility.
Yes, of course :smile: ... Unfortunately I am also still stuck in another project. We'll resume as time allows. :smiley:
I have found the root cause of the problems:
For 5
, and issue has been filed with ArangoDB: https://github.com/triAGENS/ArangoDB/issues/491
For 6
and 7
, the problem is caused by a combination of things. This snippet in updateVertex
and updateEdge
:
if (!is_null($revision)) {
$params[ConnectionOptions::OPTION_REVISION] = $revision;
}
The tests are saving us here because 1.2.x's check against the rev
query parameter was probably broken or does not exist, so that was why the tests are passing against it.
Effectively, here's what happens (in 'pseudo code'):
$doc1 = createFromArray(..)
$doc2 = createFromArray(..)
$doc1a = createFromArray(..)
$handler->save($doc1); //doc1 now has revision id
$handler->save($doc2); //doc2 now has revision id
$handler->replace($doc1id, $doc1a) //doc1a now has revision id
$handler->replace($doc1id, $doc1) //doc1 now has latest revision id
$handler->update($doc1id, $doc1a) //revision id mismatch! Exception thrown here.
Now, you might say, why is it that it only happens on update? replaceVertex
and replaceEdge
also supports a rev
parameter to replace conditionally. Well, the answer is that there is no code in replace*()
to actually send the $params
or options to the server, so this is also another bug.
So, we need to fix this:
replace*()
add the code to merge $params
or options into the URL. This can take the relevant lines from update*()
.replace*()
and update*()
, do not automatically append the revision to the request if one exists in the document. Instead, the revision could be perhaps passed in manually by the user. Not sure if this is the best way, but this is one solution.Delayed to 1.3
Quick update for 5
: It only occurs on 32-bit machines.
@frankmayer Let's close this :smile: 5
is due to 32-bit machines and Jan says he has fixed it. I will test that locally since travis uses 64-bit :smiley:
Great! :+1:
Reopening:
This is failing on the latest build of ArangoDB (bb7e3205774d202612248d02d61b4e9a401dcc76) on my 32-bit machine:
Time: 3 seconds, Memory: 4.75Mb
There was 1 error:
1) triagens\ArangoDb\BatchTest::testEmptyBatch
triagens\ArangoDb\ServerException: HTTP/1.1 409 Conflict
/www/ArangoDB-PHP/lib/triagens/ArangoDb/Connection.php:278
/www/ArangoDB-PHP/lib/triagens/ArangoDb/Connection.php:161
/www/ArangoDB-PHP/lib/triagens/ArangoDb/CollectionHandler.php:411
/www/ArangoDB-PHP/lib/triagens/ArangoDb/CollectionHandler.php:350
/www/ArangoDB-PHP/tests/BatchTest.php:24
I have seen this error, when I still had testcollections in ArangoDB which were not removed for some reason (for example when debugging and exiting before the phpunit teardown method could drop the collections).
I am investigating this to see how we can prevent it.
This is really strange. Suddenly, I am unable to reproduce it at all!
I will close this for now and hope we have enough logging in the future to fix it if it ever turns up again :smile:
Under normal conditions it won't happen. If it happens, just re-run the test. It can happen at so many commands, that it doesn't make sense to dig in that further... :smile:
I have been testing the
devel
against ArangoDB's devel (usually the latest commit). When running the tests, 7 of them always fails. Since we are looking at moving to 1.3 and finalizing 1.2.1, I think now would be a good time to investigate:The first 4 relates to the statistics not being available in 1.3 yet.
However,
5
,6
and7
warrants some investigation to see why they are failing, when they worked fine against ArangoDB 1.2.