wohali commented on issue #506: replication to non-existent target db never 
updates _replicator doc with state
URL: https://github.com/apache/couchdb/issues/506#issuecomment-299068678
 
 
   After investigation and chatting with you on IRC, I think this is because 
the standard JS harness is creating a custom replicator DB at 
`test_suite_db_<letters>%2F_replicator` and the scheduling replicator doesn't 
know what to do about that when a job fails.
   
   After PUTting a doc into that database, waiting the requisite time, and 
getting a failure, I did a `GET /_scheduler/docs` and get back: 
`{"total_rows":0,"offset":0,"docs":[]}` so I think my hunch is correct.
   
   It also occurs to me that you're going to have to de-duplicate doc IDs from 
different _replicator databases so perhaps the right thing to do is to prepend 
the replicator DB's name to the doc ID if it's not the default `_replicator`. 
In this case that means I'd have to `GET 
/_scheduler/docs/test_suite_db_quzroaxh%2F_replicator/foo_error_rep` which is 
acceptable, if ugly.
   
   Edited log:
   ```
   [notice] 2017-05-03T23:58:22.747195Z [email protected] <0.309.0> 9bde503c0a 
127.0.0.1:15984 127.0.0.1 undefined PUT 
/test_suite_db_quzroaxh%2F_replicator/foo_error_rep 201 ok 136
   [notice] 2017-05-03T23:58:27.179010Z [email protected] <0.348.0> -------- 
starting new replication `8742b3ea46dfe82f96a36485f46c6738` at <0.639.0> 
(`http://127.0.0.1:15984/test_suite_db_euuinovc/` -> 
`http://127.0.0.1:15984/nonexistent_test_db/`)
   [notice] 2017-05-03T23:58:27.179239Z [email protected] <0.349.0> -------- 
couch_replicator_scheduler: Job {"8742b3ea46dfe82f96a36485f46c6738",[]} started 
as <0.639.0>
   [error] 2017-05-03T23:58:27.303437Z [email protected] <0.639.0> -------- 
throw:{db_not_found,<<"could not open 
http://127.0.0.1:15984/nonexistent_test_db/";>>}: Replication failed to start 
for args 
{rep,{"8742b3ea46dfe82f96a36485f46c6738",[]},{httpdb,"http://127.0.0.1:15984/test_suite_db_euuinovc/",nil,[{"Accept","application/json"},{"User-Agent","CouchDB-Replicator/2.1.0-5cad2a4"}],30000,[{socket_options,[{keepalive,true},{nodelay,false}]}],10,250,nil,20,nil,undefined},{httpdb,"http://127.0.0.1:15984/nonexistent_test_db/",nil,[{"Accept","application/json"},{"User-Agent","CouchDB-Replicator/2.1.0-5cad2a4"}],30000,[{socket_options,[{keepalive,true},{nodelay,false}]}],10,250,nil,20,nil,undefined},[{checkpoint_interval,30000},{connection_timeout,30000},{http_connections,20},{retries,10},{socket_options,[{keepalive,true},{nodelay,false}]},{use_checkpoints,true},{worker_batch_size,500},{worker_processes,4}],{user_ctx,null,[],undefined},db,nil,<<"foo_error_rep">>,<<"shards/00000000-1ffffff
 f/test_suite_db_quzroaxh/_replicator.1493855893">>,{1493,855907,177746}}: 
[{couch_replicator_api_wrap,db_open,3,[{file,"src/couch_replicator_api_wrap.erl"},{line,109}]},{couch_replicator_scheduler_job,init_state,1,[{file,"src/couch_replicator_scheduler_job.erl"},{line,568}]},{couch_replicator_scheduler_job,do_init,1,[{file,"src/couch_replicator_scheduler_job.erl"},{line,127}]},{couch_replicator_scheduler_job,handle_info,2,[{file,"src/couch_replicator_scheduler_job.erl"},{line,357}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,599}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]
   [notice] 2017-05-03T23:58:27.752731Z [email protected] <0.309.0> 6e697a45b0 
127.0.0.1:15984 127.0.0.1 undefined GET /_scheduler/docs 200 ok 4
   ```
 
----------------------------------------------------------------
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