wohali commented on issue #559: 304 after GET-PUT-GET cycle on a _show
URL: https://github.com/apache/couchdb/issues/559#issuecomment-305707270
 
 
   Through instrumentation of `ddoc_cache` and `ets_lru` I suspect that this is 
caused by cache eviction happening after the second `GET`. Here's a log from a 
failed instance of the test:
   
   ```
   [notice] 2017-06-01T23:23:40.753022Z [email protected] <0.325.0> 6b133c86bb 
127.0.0.1:15984 127.0.0.1 undefined GET 
/test_suite_db_hpsbou/_design/template/_show/just-name/ba144f667c0b6e26eb5f03b684033710
 304 ok 3
   [error] 2017-06-01T23:23:40.792726Z [email protected] <0.587.0> -------- 
ddoc_cache evicting _design/template
   [error] 2017-06-01T23:23:40.793209Z [email protected] <0.587.0> -------- 
ddoc_cache evicted _design/template
   [error] 2017-06-01T23:23:40.793479Z [email protected] <0.587.0> -------- 
ddoc_cache evicting _design/template
   [error] 2017-06-01T23:23:40.793546Z [email protected] <0.587.0> -------- 
ddoc_cache evicted _design/template
   [notice] 2017-06-01T23:23:40.794495Z [email protected] <0.325.0> dcca3621ed 
127.0.0.1:15984 127.0.0.1 undefined PUT 
/test_suite_db_hpsbou/_design%2Ftemplate 201 ok 41
   [error] 2017-06-01T23:23:40.795740Z [email protected] <0.391.0> -------- 
ets_lru remove test_suite_db_hpsbou
   [error] 2017-06-01T23:23:40.796272Z [email protected] <0.325.0> 67dbdabbba 
ddoc_cache opening _design/template
   [error] 2017-06-01T23:23:40.796338Z [email protected] <0.391.0> -------- 
ets_lru remove test_suite_db_hpsbou
   [error] 2017-06-01T23:23:40.796350Z [email protected] <0.325.0> 67dbdabbba hit 
_design/template
   [notice] 2017-06-01T23:23:40.798244Z [email protected] <0.325.0> 67dbdabbba 
127.0.0.1:15984 127.0.0.1 undefined GET 
/test_suite_db_hpsbou/_design/template/_show/just-name/ba144f667c0b6e26eb5f03b684033710
 304 ok 3
   ```
   
   While I didn't instrument exactly where the GET occurs it's clear that it's 
fairly late, certainly after the `PUT 201` is returned, and likely after the 
subsequent `GET` actually reads from `ddoc_cache`.
   
   During testing I also determined it's impossible to completely disable the 
`ddoc_cache`; I can only set its size to a positive integer. I'll submit a 
separate PR that fixes this. Once that change was implemented, and I could set 
`max_objects` to `0`, I ran the test in a loop 500 times and got not a single 
failure.
   
   Our options are:
   1. Change the `ddoc_cache` flush on updating a ddoc to be synchronous, not 
asynchronous, at least in the pathological case of a single node server. 
However, I am betting some Cloudant stakeholders will not want this (/cc 
@davisp @rnewson @nickva)
   2. Improve our test harness to completely disable the `ddoc_cache` for this 
test, then use that option when running the test. This means augmenting 
`dev/run` and the JS harness so that we can specify `vm.args` files. 
Alternately, setup `ddoc_cache` with the appropriate `config:get` calls instead 
of using `application:get_env`.
   3. Discard the single test under review 
(`test/javascript/tests/show_documents.js` lines 280-296) To me this is 
sweeping the issue under the rug, though if we are permanently changing the 
semantics here, it is marginally acceptable.
   4. Drop ETag support for _shows.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to