From 7219281b3109f73d1852c747a9adc74dc23e57b7 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Sun, 11 Mar 2012 11:48:22 -0400 Subject: [PATCH] increase session count and ignore table creation errors WiredTiger session count defaults to 50, but we need at least one per vnode, so for now hard-code it to 100. Also ignore table creation results in the kv backend because WiredTiger is currently producing a strange error if the table already exists. --- src/riak_kv_wterl_backend.erl | 5 ++++- src/wterl_conn.erl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/riak_kv_wterl_backend.erl b/src/riak_kv_wterl_backend.erl index fb5f60a..40c1e87 100644 --- a/src/riak_kv_wterl_backend.erl +++ b/src/riak_kv_wterl_backend.erl @@ -92,7 +92,10 @@ start(Partition, Config) -> {ok, ConnRef} -> Table = "table:wt" ++ integer_to_list(Partition), {ok, SRef} = wterl:session_open(ConnRef), - ok = wterl:session_create(SRef, Table), + %% TODO: should check return value here, but we + %% currently get an error when the table already + %% exists, so for now we ignore it. + wterl:session_create(SRef, Table), {ok, #state{conn=ConnRef, table=Table, session=SRef, diff --git a/src/wterl_conn.erl b/src/wterl_conn.erl index f2ae13c..49c51a3 100644 --- a/src/wterl_conn.erl +++ b/src/wterl_conn.erl @@ -69,7 +69,7 @@ init([]) -> {ok, #state{}}. handle_call({open, Dir, Caller}, _From, #state{conn=undefined}=State) -> - Opts = [{create, true}, {cache_size, "100MB"}], + Opts = [{create, true}, {cache_size, "100MB"}, {session_max, 100}], {Reply, NState} = case wterl:conn_open(Dir, wterl:config_to_bin(Opts)) of {ok, ConnRef}=OK -> Monitors = ets:new(?MODULE, []),