Compare commits

..

No commits in common. "master" and "gsb-2.0-fixes" have entirely different histories.

5 changed files with 30 additions and 59 deletions

View file

@ -13,7 +13,7 @@ set -e
WT_REPO=http://github.com/wiredtiger/wiredtiger.git WT_REPO=http://github.com/wiredtiger/wiredtiger.git
WT_BRANCH=develop WT_BRANCH=develop
WT_DIR=wiredtiger-`basename $WT_BRANCH` WT_DIR=wiredtiger-`basename $WT_BRANCH`
#WT_REF="tags/1.6.6" #WT_REF="tags/1.6.4"
#WT_DIR=wiredtiger-`basename $WT_REF` #WT_DIR=wiredtiger-`basename $WT_REF`
SNAPPY_VSN="1.0.4" SNAPPY_VSN="1.0.4"

View file

@ -440,7 +440,6 @@ __close_cursors_on(WterlConnHandle *conn_handle, const char *uri)
return; return;
} }
/** /**
* Callback to handle error messages. * Callback to handle error messages.
* *
@ -455,15 +454,13 @@ __close_cursors_on(WterlConnHandle *conn_handle, const char *uri)
* operation or library failure. * operation or library failure.
*/ */
int int
__wterl_error_handler(WT_EVENT_HANDLER *handler, WT_SESSION *session, __wterl_error_handler(WT_EVENT_HANDLER *handler, int error, const char *message)
int error, const char *message)
{ {
struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler; struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler;
ErlNifEnv *msg_env; ErlNifEnv *msg_env;
ErlNifPid *to_pid; ErlNifPid *to_pid;
int rc = 0; int rc = 0;
UNUSED(session);
enif_mutex_lock(eh->error_mutex); enif_mutex_lock(eh->error_mutex);
msg_env = eh->msg_env_error; msg_env = eh->msg_env_error;
to_pid = &eh->to_pid; to_pid = &eh->to_pid;
@ -495,14 +492,13 @@ __wterl_error_handler(WT_EVENT_HANDLER *handler, WT_SESSION *session,
* operation or library failure. * operation or library failure.
*/ */
int int
__wterl_message_handler(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *message) __wterl_message_handler(WT_EVENT_HANDLER *handler, const char *message)
{ {
struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler; struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler;
ErlNifEnv *msg_env; ErlNifEnv *msg_env;
ErlNifPid *to_pid; ErlNifPid *to_pid;
int rc = 0; int rc = 0;
UNUSED(session);
enif_mutex_lock(eh->message_mutex); enif_mutex_lock(eh->message_mutex);
msg_env = eh->msg_env_message; msg_env = eh->msg_env_message;
to_pid = &eh->to_pid; to_pid = &eh->to_pid;
@ -533,14 +529,13 @@ __wterl_message_handler(WT_EVENT_HANDLER *handler, WT_SESSION *session, const ch
* operation or library failure. * operation or library failure.
*/ */
int int
__wterl_progress_handler(WT_EVENT_HANDLER *handler, WT_SESSION *session, const char *operation, uint64_t counter) __wterl_progress_handler(WT_EVENT_HANDLER *handler, const char *operation, uint64_t counter)
{ {
struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler; struct wterl_event_handlers *eh = (struct wterl_event_handlers *)handler;
ErlNifEnv *msg_env; ErlNifEnv *msg_env;
ErlNifPid *to_pid; ErlNifPid *to_pid;
int rc = 0; int rc = 0;
UNUSED(session);
enif_mutex_lock(eh->progress_mutex); enif_mutex_lock(eh->progress_mutex);
msg_env = eh->msg_env_progress; msg_env = eh->msg_env_progress;
to_pid = &eh->to_pid; to_pid = &eh->to_pid;
@ -2308,7 +2303,7 @@ on_load(ErlNifEnv *env, void **priv_data, ERL_NIF_TERM load_info)
char msg[1024]; char msg[1024];
snprintf(msg, 1024, "NIF on_load complete (wterl version: %s, wiredtiger version: %s)", priv->wterl_vsn, priv->wiredtiger_vsn); snprintf(msg, 1024, "NIF on_load complete (wterl version: %s, wiredtiger version: %s)", priv->wterl_vsn, priv->wiredtiger_vsn);
__wterl_message_handler((WT_EVENT_HANDLER *)&priv->eh, NULL, msg); __wterl_message_handler((WT_EVENT_HANDLER *)&priv->eh, msg);
return 0; return 0;
} }

View file

@ -22,7 +22,6 @@
-module(riak_kv_wterl_backend). -module(riak_kv_wterl_backend).
-behavior(temp_riak_kv_backend). -behavior(temp_riak_kv_backend).
-compile([{parse_transform, lager_transform}]).
%% KV Backend API %% KV Backend API
-export([api_version/0, -export([api_version/0,
@ -43,7 +42,7 @@
-ifdef(TEST). -ifdef(TEST).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
-compile(export_all). -compiel(export_all).
-endif. -endif.
-define(API_VERSION, 1). -define(API_VERSION, 1).
@ -120,14 +119,11 @@ start(Partition, Config) ->
"lsm" -> "lsm" ->
[{internal_page_max, "128K"}, [{internal_page_max, "128K"},
{leaf_page_max, "16K"}, {leaf_page_max, "16K"},
{lsm, [ {lsm_chunk_size, "100MB"},
{bloom_config, [{leaf_page_max, "8MB"}]}, {lsm_bloom_oldest, true} ,
{bloom_bit_count, 28}, {lsm_bloom_bit_count, 28},
{bloom_hash_count, 19}, {lsm_bloom_hash_count, 19},
{bloom_oldest, true}, {lsm_bloom_config, [{leaf_page_max, "8MB"}]}
{chunk_size, "100MB"},
{merge_threads, 2}
]}
] ++ Compressor; ] ++ Compressor;
"table" -> "table" ->
Compressor Compressor
@ -401,41 +397,30 @@ establish_connection(Config, Type) ->
ok = filelib:ensure_dir(filename:join(DataRoot, "x")), ok = filelib:ensure_dir(filename:join(DataRoot, "x")),
%% WT Connection Options: %% WT Connection Options:
LogSetting = app_helper:get_prop_or_env(log, Config, wterl, false), %% NOTE: LSM auto-checkpoints, so we don't have too.
CheckpointSetting = CheckpointSetting =
case Type =:= "lsm" of case Type =:= "lsm" of
true -> true ->
case LogSetting of [];
true ->
%% Turn checkpoints on if logging is on, checkpoints enable log archival.
app_helper:get_prop_or_env(checkpoint, Config, wterl, [{wait, 30}]); % in seconds
_ ->
[]
end;
false -> false ->
app_helper:get_prop_or_env(checkpoint, Config, wterl, [{wait, 30}]) app_helper:get_prop_or_env(checkpoint, Config, wterl, [{wait, 10}])
end, end,
RequestedCacheSize = app_helper:get_prop_or_env(cache_size, Config, wterl), RequestedCacheSize = app_helper:get_prop_or_env(cache_size, Config, wterl),
ConnectionOpts = ConnectionOpts =
orddict:from_list( orddict:from_list(
[ wterl:config_value(create, Config, true), [ wterl:config_value(create, Config, true),
wterl:config_value(checkpoint_sync, Config, false), wterl:config_value(checkpoint_sync, Config, false),
wterl:config_value(transaction_sync, Config, "none"),
wterl:config_value(log, Config, [{enabled, LogSetting}]),
wterl:config_value(mmap, Config, false),
wterl:config_value(checkpoint, Config, CheckpointSetting),
wterl:config_value(session_max, Config, max_sessions(Config)), wterl:config_value(session_max, Config, max_sessions(Config)),
wterl:config_value(cache_size, Config, size_cache(RequestedCacheSize)), wterl:config_value(cache_size, Config, size_cache(RequestedCacheSize)),
wterl:config_value(statistics, Config, [ "fast", "clear"]),
wterl:config_value(statistics_log, Config, [{wait, 600}]), % in seconds wterl:config_value(statistics_log, Config, [{wait, 600}]), % in seconds
wterl:config_value(verbose, Config, [ "salvage", "verify" wterl:config_value(verbose, Config, [ "salvage", "verify"
% Note: for some unknown reason, if you add these additional % Note: for some unknown reason, if you add these additional
% verbose flags Erlang SEGV's "size_object: bad tag for 0x80" % verbose flags Erlang SEGV's "size_object: bad tag for 0x80"
% no idea why... you've been warned. % no idea why... yet... you've been warned.
%"block", "shared_cache", "reconcile", "evict", "lsm", %"block", "shared_cache", "reconcile", "evict", "lsm",
%"fileops", "read", "write", "readserver", "evictserver", %"fileops", "read", "write", "readserver", "evictserver",
%"hazard", "mutex", "ckpt" %"hazard", "mutex", "ckpt"
]) ] ++ proplists:get_value(wterl, Config, [])), % sec ]) ] ++ CheckpointSetting ++ proplists:get_value(wterl, Config, [])), % sec
%% WT Session Options: %% WT Session Options:
SessionOpts = [{isolation, "snapshot"}], SessionOpts = [{isolation, "snapshot"}],

View file

@ -454,26 +454,18 @@ config_to_bin([], Acc) ->
config_to_bin([{Key, Value} | Rest], Acc) -> config_to_bin([{Key, Value} | Rest], Acc) ->
ConfigTypes = ConfigTypes =
[{block_compressor, {string, quoted}}, [{block_compressor, {string, quoted}},
{bloom_bit_count, integer},
{bloom_config, config},
{bloom_hash_count, integer},
{bloom_newest, bool},
{bloom_oldest, bool},
{cache_size, string}, {cache_size, string},
{checkpoint, config}, {checkpoint, config},
{checkpoint_sync, bool}, {checkpoint_sync, bool},
{checksum, string}, {checksum, string},
{chunk_size, string},
{create, bool}, {create, bool},
{direct_io, list}, {direct_io, list},
{drop, list}, {drop, list},
{enabled, bool},
{error_prefix, string}, {error_prefix, string},
{eviction_target, integer}, {eviction_target, integer},
{eviction_trigger, integer}, {eviction_trigger, integer},
{extensions, {list, quoted}}, {extensions, {list, quoted}},
{statistics_fast, bool}, {statistics_fast, bool},
{file_max, string},
{force, bool}, {force, bool},
{from, string}, {from, string},
{hazard_max, integer}, {hazard_max, integer},
@ -483,21 +475,23 @@ config_to_bin([{Key, Value} | Rest], Acc) ->
{isolation, string}, {isolation, string},
{key_type, string}, {key_type, string},
{leaf_page_max, string}, {leaf_page_max, string},
{log, config}, {logging, bool},
{lsm, config}, {lsm_bloom_bit_count, integer},
{mmap, bool}, {lsm_bloom_config, config},
{merge_threads, integer}, {lsm_bloom_hash_count, integer},
{lsm_bloom_newest, bool},
{lsm_bloom_oldest, bool},
{lsm_chunk_size, string},
{prefix_compression, bool},
{lsm_merge_threads, integer},
{multiprocess, bool}, {multiprocess, bool},
{name, string}, {name, string},
{overwrite, bool}, {overwrite, bool},
{prefix_compression, bool},
{raw, bool}, {raw, bool},
{session_max, integer}, {session_max, integer},
{statistics, list},
{statistics_log, config}, {statistics_log, config},
{target, {list, quoted}}, {target, {list, quoted}},
{to, string}, {to, string},
{transaction_sync, string},
{transactional, bool}, {transactional, bool},
{verbose, list}, {verbose, list},
{wait, integer}], {wait, integer}],

View file

@ -25,7 +25,7 @@
{mode, max}. {mode, max}.
{duration, 10}. {duration, 10}.
{concurrent, 16}. {concurrent, 4}.
{report_interval, 1}. {report_interval, 1}.
{pb_timeout_general, 1000}. % ms {pb_timeout_general, 1000}. % ms
%{pb_timeout_read, ?}. %{pb_timeout_read, ?}.
@ -43,9 +43,7 @@
{wterl, [ {wterl, [
{connection, [ {connection, [
{create, true}, {create, true},
{session_sync, false}, {sync, false},
{transaction_sync, "none"},
{log, [{enabled, false}]},
{session_max, 1024}, {session_max, 1024},
{cache_size, 4294967296}, {cache_size, 4294967296},
{verbose, []}, {verbose, []},
@ -60,11 +58,11 @@
]}, ]},
{session, [ {isolation, "snapshot"} ]}, {session, [ {isolation, "snapshot"} ]},
{table_uri, "lsm:test"}, {table_uri, "lsm:test"},
{lsm_merge_threads, 2},
{table, [ {table, [
{internal_page_max, "128K"}, {internal_page_max, "128K"},
{leaf_page_max, "128K"}, {leaf_page_max, "128K"},
{lsm_chunk_size, "25MB"}, {lsm_chunk_size, "25MB"},
{prefix_compression, false},
{lsm_bloom_newest, true}, {lsm_bloom_newest, true},
{lsm_bloom_oldest, true} , {lsm_bloom_oldest, true} ,
{lsm_bloom_bit_count, 128}, {lsm_bloom_bit_count, 128},
@ -78,9 +76,7 @@
{wterl_, [ {wterl_, [
{connection, [ {connection, [
{create, true}, {create, true},
{session_sync, false}, {sync, false},
{transaction_sync, "none"},
{log, [{enabled, false}]},
{session_max, 1024}, {session_max, 1024},
{cache_size, 4294967296}, {cache_size, 4294967296},
{verbose, []}, {verbose, []},
@ -97,6 +93,7 @@
{session, [ {isolation, "snapshot"} ]}, {session, [ {isolation, "snapshot"} ]},
{table_uri, "table:test"}, {table_uri, "table:test"},
{table, [ {table, [
{prefix_compression, false},
{block_compressor, "snappy"} % bzip2 {block_compressor, "snappy"} % bzip2
]} ]}
]}. ]}.