Close trees before cleanup
Problem is that we sometimes get errors resulting from files being written as a result of pending merges. Closing a tree should stop all such file-level activity.
This commit is contained in:
parent
29d1493415
commit
3ddfd97aea
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,8 @@ handle_call({lookup, N, K}, _, #state { btrees = D} = State) ->
|
||||||
Tree = dict:fetch(N, D),
|
Tree = dict:fetch(N, D),
|
||||||
Reply = lsm_btree:lookup(Tree, K),
|
Reply = lsm_btree:lookup(Tree, K),
|
||||||
{reply, Reply, State};
|
{reply, Reply, State};
|
||||||
handle_call(stop, _, State) ->
|
handle_call(stop, _, #state{ btrees = D } = State ) ->
|
||||||
|
[ lsm_btree:close(Tree) || {_,Tree} <- dict:to_list(D) ],
|
||||||
cleanup_trees(State),
|
cleanup_trees(State),
|
||||||
{stop, normal, ok, State};
|
{stop, normal, ok, State};
|
||||||
handle_call(_Request, _From, State) ->
|
handle_call(_Request, _From, State) ->
|
||||||
|
|
Loading…
Reference in a new issue