read_repair resulting in function_clause (fabric calls fabric)
- Dominant language
- Erlang
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 9
Description
Seen when a read_repair is triggered on a ddoc.
Expurgated log:
```erlang
[error] 2019-01-14T19:11:14.899406Z couchdb@NODE <0.22982.3115> ee6892c069 req_err(2486679219) unknown_error : function_clause
[<<"fabric_doc_update:handle_message/3 L56">>,<<"rexi_utils:process_mailbox/6 L55">>,<<"fabric_doc_update:go/3 L39">>,<<"fabric:update_docs/3 L284">>,<<"fabric_doc_open:read_repair/1 L140">>,<<"fabric_doc_open:go/3 L54">>,<<"chttpd_db:couch_doc_open/4 L1259">>,<<"chttpd_db:db_doc_req/3 L798">>]
[notice] 2019-01-14T19:11:14.899626Z couchdb@NODE <0.22982.3115> ee6892c069 IP IP fccpe7yv GET /$DB/_design/$DDOCNAME 500 ok 21
```
From IRC:
```irc
14:19 <+rnewson> but it looks like handle_message received an unexpected message
14:19 <+rnewson> looking briefly, it seems there's a fabric call calling another fabric
call, which doesn't sound likely to work well
```
## Your Environment
* Version used: 2.3.0
* Browser Name and version: curl
* Operating System and version (desktop or mobile): Ubuntu 18.04.1 LTS
Contributor guide
Research direction
Start with the stack-trace entry points fabric_doc_update:handle_message/3 and fabric_doc_open:read_repair/1, then trace the message passed during a design-document read repair. Reproduce the GET /$DB/_design/$DDOCNAME request described in the issue and confirm that the function_clause is eliminated and the request no longer returns HTTP 500.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100