apache / apache/couchdb

error: function_clause, gb_trees,delete_1

Open
#1,361 0 comments 0 reactions 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.

This one is shown multiple times in rapid succession, sometimes with and sometimes without a request ID. The contents are roughly identical every time, so only one line is shown.

```
[error] 2018-05-27T09:17:37.865000Z couchdb@node1 <0.30035.3192> dbf60f58f3 rexi_server exit:{{function_clause,[{gb_trees,delete_1,[{1527,412652,527140},nil],[{file,"gb_trees.erl"},{line,407}]},{gb_trees,delete_1,2,[{file,"gb_trees.erl"},{line,411}]},{gb_trees,delete_1,2,[{file,"gb_trees.erl"},{line,411}]},{gb_trees,delete_1,2,[{file,"gb_trees.erl"},{line,408}]},{gb_trees,delete_1,2,[{file,"gb_trees.erl"},{line,411}]},{gb_trees,delete,2,[{file,"gb_trees.erl"},{line,403}]},{couch_lru,close_int,2,[{file,"src/couch_lru.erl"},{line,53}]},{couch_server,maybe_close_lru_db,1,[{file,"src/couch_server.erl"},{line,294}]}]},{gen_server,call,[couch_server,{open,<<"shards/c0000000-dfffffff/db.1519652672">>,[{create_if_missing,true},{user_ctx,{user_ctx,<<"admin">>,[<<"_admin">>],<<"default">>}}]},infinity]}} [{gen_server,call,3,[{file,"gen_server.erl"},{line,212}]},{couch_server,open,2,[{file,"src/couch_server.erl"},{line,84}]},{fabric_rpc,changes,4,[{file,"src/fabric_rpc.erl"},{line,68}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]

```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the reported stack through src/couch_lru.erl at close_int/2 and src/couch_server.erl at maybe_close_lru_db/1, then inspect the Erlang gb_trees:delete/2 failure. Reproduce the heavy-load, CPU-starved 3-node scenario and determine why deletion receives nil; done means the reported function_clause error no longer occurs in that scenario.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.