[ 
https://issues.apache.org/jira/browse/COUCHDB-1503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15236806#comment-15236806
 ] 

Jan Lehnardt commented on COUCHDB-1503:
---------------------------------------

Here’s a patch that fixes the issue: 
https://gist.github.com/janl/855c622253f76d307004006a7a6cc18e

We get a debug log entry when encountering a VDU without the right query server.

I’d be happy to change this to fail-by-default and override by config setting, 
if people feel strongly about it.

Or opt-in via config, whatever ;)

> Missed query server and validate_doc_update funcs.
> --------------------------------------------------
>
>                 Key: COUCHDB-1503
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1503
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.3
>            Reporter: Alexander Shorin
>
> CouchDB prevents any write operations due to query server fail if where is 
> DDoc in database with validate_doc_update function and language property that 
> points to not existed query server key.
> Expected behavior:
> Fail with nicer message about missed query server.
> OR 
> Skip VDU routines in that case.
> Actual behavior:
> Error: EXIT {{badmatch,[]}, [{couch_query_servers,new_process,3, 
> [{file,"couch_query_servers.erl"},{line,478}]}, 
> {couch_query_servers,lang_proc,3, 
> [{file,"couch_query_servers.erl"},{line,468}]}, 
> {couch_query_servers,handle_call,3, 
> [{file,"couch_query_servers.erl"},{line,328}]}, 
> {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,588}]}, 
> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
> Trivia:
> CouchDB allows to specify custom query servers and there are many of them: 
> javascript, python, erlang, php, ruby, clojure and more. While any custom 
> things are outside of CouchDB domain, there is edge case then they makes a 
> sense. 
> From some point of data consistency, that is right behavior, because docs 
> should be validated before they be putted into database. VDU fails - no data, 
> VDU passes - data are in. Case, when VDU fails because there is no query 
> servers that could proceed it, looks right from that side. (Probably, they 
> should fail with more nicer message). Missed query server is configuration 
> error and any other design functions stops workings as well, but they do that 
> without any additional behavior for base CouchDB operations(doc save is it). 
> That's right position for developer and database designer.
> From point of data spreading that is bad behavior, because I, as database 
> user, could not just replicate data from server to my own local sandbox. I 
> also have to find right query server or remove any DDocs(or just VDU func 
> from them) or use some mocked solution. Fine, but I do not care about all 
> your ruby couchapps! I just want to handle my own data and just work with 
> them in my own way. Quite emotional, but position for end user is right as 
> data holder(in most cases).
> ...
> I couldn't count this issue as real issue, due to it has quite fine 
> workarounds as:
> 1. Filtered replication that removes ddocs for missed query server.
> 2. Client side scripting.
> 3. Providing well service that allows not only to replicate user data, but to 
> setup right environment with less pain.
> But all of them are additional steps that should be made. So what do you 
> think about this case?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to