apache / apache/couchdb

error: function_clause, fabric_doc_update:handle_message (on view update?)

Open
#1,359 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

Under heavy load and insufficient CPU, a 3-node cluster produced a large number of function_clause errors. This is one of these errors.

View code and database content has been replaced by `...`
```
[error] 2018-05-28T07:14:39.496000Z couchdb@node1 emulator -------- Error in process <0.149.770> on node 'couchdb@node1' with exit value:
{function_clause,[{fabric_doc_update,handle_message,[{error,function_clause},{shard,<<"shards/20000000-3fffffff/db.1519652673">>,'couchdb@node1',<<"db">>,[536870912,1073741823],#Ref<0.0.58720260.121950>},{2,1,2,[{{shard,<<"s
hards/20000000-3fffffff/db.1519652673">>,'couchdb@node1',<<"db">>,[536870912,1073741823],#Ref<0.0.58720260.121950>},[{doc,<<"_design/Users">>,...]},{[{<<"views">>,...}]}]},{{shard,<<"shards/20000000-3fffffff/db.1519652673">>,'couchdb@node3',<<"db">>,[536870
912,1073741823],#Ref<0.0.58720260.121952>},[{doc,<<"_design/Users">>,...]},{[{<<"views">>,...}]},[],false,[{
ref,#Ref<0.0.58720260.121949>}]}]}],{dict,...]},{[{<<"views">>,{[{...}]},[],false,[{ref,#Ref<0.0.58720260.121949>}]},noreply]],[],[],[],[],[],[],[],[],[],[]}}}}],[{file,"src/fabric_doc_update.erl"},{line,55}]},{rexi_utils,process_mailbox,6,[{file,"src/rexi
_utils.erl"},{line,55}]},{fabric_doc_update,go,3,[{file,"src/fabric_doc_update.erl"},{line,39}]},{fabric,update_docs,3,[{file,"src/fabric.erl"},{line,259}]},{fabric_doc_open,read_repair,1,[{file,"src/fabric_doc_open.erl"},{line,133}]},{fabric_doc_open,go,
3,[{file,"src/fabric_doc_open.erl"},{line,53}]},{couch_index_server,'-get_index/3-fun-0-',2,[{file,"src/couch_index_server.erl"},{line,70}]}]}
```

Contributor guide

Open the contributing guide

Research direction

Start at src/fabric_doc_update.erl line 55 and trace the call chain through fabric.erl and src/fabric_doc_open.erl, using the reported view-update and read-repair path as the entry point. Reproduce the function_clause under heavy load on a 3-node cluster, then confirm the error is prevented and the affected update path remains functional.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.