Skip to content

Instantly share code, notes, and snippets.

View bowrocker's full-sized avatar

Jon Anderson bowrocker

  • Fastly
  • Massachusetts
View GitHub Profile
@bowrocker
bowrocker / gist:6040048
Created July 19, 2013 15:32
registration functions
riakcore_cluster_mgr:register_member_fun(
fun({IP, Port}) ->
{ok, MyIPs} = inet:getifaddrs(),
{ok, NormIP} = riak_repl_util:normalize_ip(IP),
MyMask = lists:foldl(fun({_IF, Attrs}, Acc) ->
case lists:member({addr, NormIP}, Attrs) of
true -> NetMask = lists:foldl(fun({netmask,
NM = {, , _, _}}, _) -> NM;
(, Acc2) -> Acc2
end, undefined, Attrs),
@bowrocker
bowrocker / gist:6178490
Created August 7, 2013 20:47
basho_bench broken config
{mode, max}.
{duration, 10}.
{concurrent, 1}.
{riakclient_nodes, ['[[email protected]](mailto:[email protected])']}.
{riakclient_cookie, riak}.
@bowrocker
bowrocker / gist:6178682
Created August 7, 2013 21:06
basho_bench output
basho_bench$ ./basho_bench examples/riakc_pb.devrel.config
17:05:36.841 [debug] Lager installed handler lager_console_backend into lager_event
17:05:36.857 [debug] Lager installed handler {lager_file_backend,"/usr/local/bos1/home/janderson/sandbox/basho_bench/tests/20130807_170536/error.log"} into lager_event
17:05:36.859 [debug] Lager installed handler {lager_file_backend,"/usr/local/bos1/home/janderson/sandbox/basho_bench/tests/20130807_170536/console.log"} into lager_event
17:05:36.862 [debug] Lager installed handler error_logger_lager_h into error_logger
17:05:36.863 [info] Application lager started on node nonode@nohost
17:05:36.876 [info] Est. data size: 95.37 MB
17:05:36.908 [debug] Supervisor sasl_safe_sup started alarm_handler:start_link() at pid <0.55.0>
17:05:36.909 [debug] Supervisor sasl_safe_sup started overload:start_link() at pid <0.56.0>
17:05:36.909 [debug] Supervisor sasl_sup started supervisor:start_link({local,sasl_safe_sup}, sasl, safe) at pid <0.54.0>
@bowrocker
bowrocker / gist:6178688
Created August 7, 2013 21:07
Hanging basho_bench output
basho_bench$ ./basho_bench examples/riakc_pb.devrel.config
17:06:47.160 [debug] Lager installed handler lager_console_backend into lager_event
17:06:47.173 [debug] Lager installed handler {lager_file_backend,"/usr/local/bos1/home/janderson/sandbox/basho_bench/tests/20130807_170646/error.log"} into lager_event
17:06:47.175 [debug] Lager installed handler {lager_file_backend,"/usr/local/bos1/home/janderson/sandbox/basho_bench/tests/20130807_170646/console.log"} into lager_event
17:06:47.181 [debug] Lager installed handler error_logger_lager_h into error_logger
17:06:47.181 [info] Application lager started on node nonode@nohost
17:06:47.195 [info] Est. data size: 95.37 MB
17:06:47.232 [debug] Supervisor sasl_safe_sup started alarm_handler:start_link() at pid <0.55.0>
17:06:47.232 [debug] Supervisor sasl_safe_sup started overload:start_link() at pid <0.56.0>
17:06:47.233 [debug] Supervisor sasl_sup started supervisor:start_link({local,sasl_safe_sup}, sasl, safe) at pid <0.54.0>
- rtsource supervisor (controls rtq) attach and ETS table as in lager. One key: overload. read_concurrency
- rtq is only writer to ETS table
- rtq looks at mailbox, if over 2K message, set overload flag to true
- function in rtq (push), read from ETS table, if overload condition, don't send anything to RTQ
- another process under rtq supervisor, rtq_helper. Receives message from post commit hook that say "rtq overloaded"
- rtq_helper sends messages (all it does) to rtq saying "I dropped N message"
- rtq side sets it stats for this message
- rtq turns off OVERLOAD based on mailbox side (1/2 max or some heuristic)
@bowrocker
bowrocker / riak_kv_vnode.erl
Created September 12, 2013 20:09
riak_kv_vnode.erl changes to compile with YZ merge problem
%% -------------------------------------------------------------------
%%
%% riak_kv_vnode: VNode Implementation
%%
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
@bowrocker
bowrocker / gist:6799290
Created October 2, 2013 19:32
Eunit for AT&T urgent issue, PR 415
[ 0 ] janderson::Jons-MacBook-Pro { ~/sandbox/develop/riak_ee/deps/riak_repl }-> ./rebar eunit skip_deps=true
==> riak_repl (eunit)
test/riak_core_cluster_mgr_tests.erl:87:<0.859.0>: get_known_clusters_when_empty_test(): {ok,[]}
src/riak_core_cluster_conn.erl:40:<0.856.0>: connecting to {cluster_by_addr,{"127.0.0.1",4097}}
test/riak_core_cluster_mgr_tests.erl:557:<0.875.0>: ctrlService: received connection from cluster: "undefined"
src/riak_core_cluster_conn.erl:80:<0.870.0>: Cluster Manager control channel client connected to remote {cluster_by_addr,
{"127.0.0.1",
4097}} at {"127.0.0.1",
4097} named "undefined"
test/riak_core_cluster_mgr_tests.erl:582:<0.884.0>: wants my name
@bowrocker
bowrocker / gist:7669842
Created November 27, 2013 02:38
rt_cascading output for OpenX fix on riak_repl branch feature/csm/openx-deliverables
21:14:41.190 [info] ======================== EUnit ========================
21:14:41.204 [info] Riak path: "/Users/janderson/rt/riak_ee"
21:14:41.204 [info] module 'rt_cascading'
21:14:41.221 [info] rtdev:update_app_config_file(/Users/janderson/rt/riak_ee/current/dev/dev1/etc/app.config, [{lager,[{handlers,[{lager_console_backend,info},{lager_file_backend,[{"./log/error.log",error,10485760,"$D0",5},{"./log/console.log",info,10485760,"$D0",5},{"./log/debug.log",debug,10485760,"$D0",5}]}]},{crash_log,"./log/crash.log"},{crash_log_msg_size,65536},{crash_log_size,10485760},{crash_log_date,"$D0"},{crash_log_count,5},{error_logger_redirect,true}]},{riak_repl,[{fullsync_on_connect,false},{fullsync_interval,disabled},{diff_batch_size,10}]}])
21:14:41.221 [info] rtdev:update_app_config_file(/Users/janderson/rt/riak_ee/current/dev/dev2/etc/app.config, [{lager,[{handlers,[{lager_console_backend,info},{lager_file_backend,[{"./log/error.log",error,10485760,"$D0",5},{"./log/console.log",info,10485760,"$D0",5},{"./log/debug
@bowrocker
bowrocker / gist:7929319
Created December 12, 2013 14:58
PR 448 replication2 results
Tests to run: [{replication2,
[{id,-1},
{platform,<<"local">>},
{version,<<"riak_ee-2.0.0pre7-1-g852b8c2-develop">>},
{project,<<"riak_ee">>}]}]
09:45:23.994 [info] Application lager started on node nonode@nohost
09:45:24.001 [info] These modules are not runnable tests: []
09:45:24.053 [info] Skipping cover, no modules included
09:45:24.627 [info] Stopped Node... /Users/janderson/rt/riak_ee/riak_ee-1.2.1/dev/dev1/bin/riak stop ~ wasn't running.
09:45:24.818 [info] Stopped Node... /Users/janderson/rt/riak_ee/current/dev/dev1/bin/riak stop ~ wasn't running.
@bowrocker
bowrocker / gist:7951511
Created December 13, 2013 21:19
Replication2 results for repl PR487
[ 0 ] janderson::Jons-MacBook-Pro { ~/sandbox/features/riak_test }-> ./riak_test -c rtee -t replication2
Tests to run: [{replication2,
[{id,-1},
{platform,<<"local">>},
{version,<<"riak_ee-2.0.0pre7-1-g852b8c2-develop">>},
{project,<<"riak_ee">>}]}]
16:09:04.604 [info] Application lager started on node nonode@nohost
16:09:04.608 [info] These modules are not runnable tests: []
16:09:04.655 [info] Skipping cover, no modules included
16:09:05.179 [info] Stopped Node... /Users/janderson/rt/riak_ee/riak_ee-1.2.1/dev/dev1/bin/riak stop ~ wasn't running.