Skip to content

Instantly share code, notes, and snippets.

@shino
Created December 8, 2022 06:24
Show Gist options
  • Save shino/d8091d0a3ece8156974c99efd021c599 to your computer and use it in GitHub Desktop.
Save shino/d8091d0a3ece8156974c99efd021c599 to your computer and use it in GitHub Desktop.
% rebar3 shell --sname ra1
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling ra_test
Erlang/OTP 25 [erts-13.1.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
Eshell V13.1.1 (abort with ^G)
(ra1@shino-xps)1> ===> Booted sasl
===> Booted ra_test
ra_kv_store:start_cluster().
{ok,[{ra_kv,'ra1@shino-xps'},
{ra_kv,'ra2@shino-xps'},
{ra_kv,'ra3@shino-xps'}],
[]}
(ra1@shino-xps)2> ra_kv_store:until_block().
=INFO REPORT==== 8-Dec-2022::15:21:22.646725 ===
Going for a round...
=INFO REPORT==== 8-Dec-2022::15:21:32.651499 ===
Stopping server {ra_kv,'ra3@shino-xps'}
=INFO REPORT==== 8-Dec-2022::15:21:33.660245 ===
ra:overview #{counters =>
#{ra_log_segment_writer =>
#{entries => 0,mem_tables => 0,segments => 0},
ra_log_wal => #{batches => 2,wal_files => 1,writes => 2},
{ra_kv,'ra1@shino-xps'} =>
#{aer_received_follower => 0,
aer_received_follower_empty => 0,
aer_replies_fail => 0,aer_replies_success => 6,
aux_commands => 0,command_flushes => 0,
commands => 1,consistent_queries => 0,
dropped_sends => 0,elections => 1,fetch_term => 13,
forced_gcs => 1,invalid_reply_mode_commands => 0,
local_queries => 0,msgs_sent => 6,
pre_vote_elections => 1,read_cache => 2,
read_closed_mem_tbl => 0,read_open_mem_tbl => 1,
read_ops => 3,read_segment => 0,
release_cursors => 0,reserved_1 => 0,
rpcs_sent => 6,send_msg_effects_sent => 0,
snapshot_installed => 0,snapshots_sent => 0,
snapshots_written => 0,
term_and_voted_for_updates => 2,write_ops => 2,
write_resends => 0}},
node => 'ra1@shino-xps',
segment_writer =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
segment_conf =>
#{compute_checksums => true,max_count => 4096}},
servers =>
#{ra_kv =>
#{cluster_name => cluster,parent => <0.249.0>,
pid => <0.250.0>,snapshot_state => undefined,
state => undefined,
uid => <<"CLUSTE5ASRB64T2AVI">>}},
wal =>
#{closed_mem_tables => 0,open_mem_tables => 1,
status =>
[{header,"Status for batching server ra_log_wal"},
{data,[{"Status",running},
{"Parent",<0.237.0>},
{"Logged Events",[]}]},
#{compute_checksums => true,current_size => 118,
filename => "00000001.wal",
max_size_bytes => 256000000,
write_strategy => default,writers => 1}]}}
=INFO REPORT==== 8-Dec-2022::15:21:34.661537 ===
Starting server {ra_kv,'ra3@shino-xps'}
=PROGRESS REPORT==== 8-Dec-2022::15:21:35.667643 ===
supervisor: {<0.261.0>,ra_server_sup}
started: [{pid,<0.262.0>},
{id,ra_kv},
{mfargs,{ra_server_proc,start_link,
[#{await_condition_timeout => 30000,
broadcast_time => 100,
cluster_name => cluster,
has_changed => false,
id => {ra_kv,'ra1@shino-xps'},
initial_members =>
[{ra_kv,'ra1@shino-xps'},
{ra_kv,'ra2@shino-xps'},
{ra_kv,'ra3@shino-xps'}],
install_snap_rpc_timeout => 120000,
log_init_args =>
#{uid =>
<<"CLUSTE5ASRB64T2AVI">>},
machine => {module,ra_kv_store,#{}},
parent => <0.261.0>,
reply_to =>
{#Ref<0.118794759.1362100227.212937>,
<0.186.0>},
system_config =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
default_max_append_entries_rpc_batch_size =>
128,
default_max_pipeline_count =>
4096,
message_queue_data => on_heap,
name => default,
names =>
#{closed_mem_tbls =>
ra_log_closed_mem_tables,
directory => ra_directory,
directory_rev =>
ra_directory_reverse,
log_ets => ra_log_ets,
log_meta => ra_log_meta,
log_sup => ra_log_sup,
open_mem_tbls =>
ra_log_open_mem_tables,
segment_writer =>
ra_log_segment_writer,
server_sup =>
ra_server_sup_sup,
wal => ra_log_wal,
wal_sup =>
ra_log_wal_sup},
segment_compute_checksums =>
true,
segment_max_entries => 4096,
wal_compute_checksums => true,
wal_data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
wal_garbage_collect => false,
wal_max_batch_size => 8192,
wal_max_entries => undefined,
wal_max_size_bytes => 256000000,
wal_pre_allocate => false,
wal_sync_method => datasync,
wal_write_strategy => default},
tick_timeout => 1000,
uid => <<"CLUSTE5ASRB64T2AVI">>}]}},
{restart_type,transient},
{significant,false},
{shutdown,5000},
{child_type,worker}]
=INFO REPORT==== 8-Dec-2022::15:21:35.670576 ===
Going for a round...
=INFO REPORT==== 8-Dec-2022::15:21:45.674432 ===
Stopping server {ra_kv,'ra3@shino-xps'}
=INFO REPORT==== 8-Dec-2022::15:21:46.677982 ===
ra:overview #{counters =>
#{ra_log_segment_writer =>
#{entries => 0,mem_tables => 0,segments => 0},
ra_log_wal => #{batches => 3,wal_files => 1,writes => 4},
{ra_kv,'ra1@shino-xps'} =>
#{aer_received_follower => 2,
aer_received_follower_empty => 0,
aer_replies_fail => 0,aer_replies_success => 0,
aux_commands => 0,command_flushes => 0,
commands => 0,consistent_queries => 0,
dropped_sends => 0,elections => 0,fetch_term => 3,
forced_gcs => 1,invalid_reply_mode_commands => 0,
local_queries => 0,msgs_sent => 3,
pre_vote_elections => 1,read_cache => 2,
read_closed_mem_tbl => 0,read_open_mem_tbl => 1,
read_ops => 2,read_segment => 0,
release_cursors => 0,reserved_1 => 0,
rpcs_sent => 0,send_msg_effects_sent => 0,
snapshot_installed => 0,snapshots_sent => 0,
snapshots_written => 0,
term_and_voted_for_updates => 1,write_ops => 2,
write_resends => 0}},
node => 'ra1@shino-xps',
segment_writer =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
segment_conf =>
#{compute_checksums => true,max_count => 4096}},
servers =>
#{ra_kv =>
#{cluster_name => cluster,parent => <0.261.0>,
pid => <0.262.0>,snapshot_state => undefined,
state => undefined,
uid => <<"CLUSTE5ASRB64T2AVI">>}},
wal =>
#{closed_mem_tables => 0,open_mem_tables => 1,
status =>
[{header,"Status for batching server ra_log_wal"},
{data,[{"Status",running},
{"Parent",<0.237.0>},
{"Logged Events",[]}]},
#{compute_checksums => true,current_size => 234,
filename => "00000001.wal",
max_size_bytes => 256000000,
write_strategy => default,writers => 1}]}}
=INFO REPORT==== 8-Dec-2022::15:21:47.679521 ===
Starting server {ra_kv,'ra3@shino-xps'}
=PROGRESS REPORT==== 8-Dec-2022::15:21:48.687732 ===
supervisor: {<0.270.0>,ra_server_sup}
started: [{pid,<0.271.0>},
{id,ra_kv},
{mfargs,{ra_server_proc,start_link,
[#{await_condition_timeout => 30000,
broadcast_time => 100,
cluster_name => cluster,
has_changed => false,
id => {ra_kv,'ra1@shino-xps'},
initial_members =>
[{ra_kv,'ra1@shino-xps'},
{ra_kv,'ra2@shino-xps'},
{ra_kv,'ra3@shino-xps'}],
install_snap_rpc_timeout => 120000,
log_init_args =>
#{uid =>
<<"CLUSTE5ASRB64T2AVI">>},
machine => {module,ra_kv_store,#{}},
parent => <0.270.0>,
reply_to =>
{#Ref<0.118794759.1362100227.213182>,
<0.186.0>},
system_config =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
default_max_append_entries_rpc_batch_size =>
128,
default_max_pipeline_count =>
4096,
message_queue_data => on_heap,
name => default,
names =>
#{closed_mem_tbls =>
ra_log_closed_mem_tables,
directory => ra_directory,
directory_rev =>
ra_directory_reverse,
log_ets => ra_log_ets,
log_meta => ra_log_meta,
log_sup => ra_log_sup,
open_mem_tbls =>
ra_log_open_mem_tables,
segment_writer =>
ra_log_segment_writer,
server_sup =>
ra_server_sup_sup,
wal => ra_log_wal,
wal_sup =>
ra_log_wal_sup},
segment_compute_checksums =>
true,
segment_max_entries => 4096,
wal_compute_checksums => true,
wal_data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
wal_garbage_collect => false,
wal_max_batch_size => 8192,
wal_max_entries => undefined,
wal_max_size_bytes => 256000000,
wal_pre_allocate => false,
wal_sync_method => datasync,
wal_write_strategy => default},
tick_timeout => 1000,
uid => <<"CLUSTE5ASRB64T2AVI">>}]}},
{restart_type,transient},
{significant,false},
{shutdown,5000},
{child_type,worker}]
=INFO REPORT==== 8-Dec-2022::15:21:48.690620 ===
Going for a round...
=INFO REPORT==== 8-Dec-2022::15:22:03.696897 ===
Stopping server {ra_kv,'ra3@shino-xps'}
=INFO REPORT==== 8-Dec-2022::15:22:04.699949 ===
ra:overview #{counters =>
#{ra_log_segment_writer =>
#{entries => 0,mem_tables => 0,segments => 0},
ra_log_wal => #{batches => 4,wal_files => 1,writes => 5},
{ra_kv,'ra1@shino-xps'} =>
#{aer_received_follower => 2,
aer_received_follower_empty => 0,
aer_replies_fail => 0,aer_replies_success => 0,
aux_commands => 0,command_flushes => 0,
commands => 0,consistent_queries => 0,
dropped_sends => 0,elections => 0,fetch_term => 3,
forced_gcs => 1,invalid_reply_mode_commands => 0,
local_queries => 0,msgs_sent => 3,
pre_vote_elections => 1,read_cache => 1,
read_closed_mem_tbl => 0,read_open_mem_tbl => 3,
read_ops => 2,read_segment => 0,
release_cursors => 0,reserved_1 => 0,
rpcs_sent => 0,send_msg_effects_sent => 0,
snapshot_installed => 0,snapshots_sent => 0,
snapshots_written => 0,
term_and_voted_for_updates => 2,write_ops => 1,
write_resends => 0}},
node => 'ra1@shino-xps',
segment_writer =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
segment_conf =>
#{compute_checksums => true,max_count => 4096}},
servers =>
#{ra_kv =>
#{cluster_name => cluster,parent => <0.270.0>,
pid => <0.271.0>,snapshot_state => undefined,
state => undefined,
uid => <<"CLUSTE5ASRB64T2AVI">>}},
wal =>
#{closed_mem_tables => 0,open_mem_tables => 1,
status =>
[{header,"Status for batching server ra_log_wal"},
{data,[{"Status",running},
{"Parent",<0.237.0>},
{"Logged Events",[]}]},
#{compute_checksums => true,current_size => 292,
filename => "00000001.wal",
max_size_bytes => 256000000,
write_strategy => default,writers => 1}]}}
=INFO REPORT==== 8-Dec-2022::15:22:05.701528 ===
Starting server {ra_kv,'ra3@shino-xps'}
=PROGRESS REPORT==== 8-Dec-2022::15:22:06.708728 ===
supervisor: {<0.279.0>,ra_server_sup}
started: [{pid,<0.280.0>},
{id,ra_kv},
{mfargs,{ra_server_proc,start_link,
[#{await_condition_timeout => 30000,
broadcast_time => 100,
cluster_name => cluster,
has_changed => false,
id => {ra_kv,'ra1@shino-xps'},
initial_members =>
[{ra_kv,'ra1@shino-xps'},
{ra_kv,'ra2@shino-xps'},
{ra_kv,'ra3@shino-xps'}],
install_snap_rpc_timeout => 120000,
log_init_args =>
#{uid =>
<<"CLUSTE5ASRB64T2AVI">>},
machine => {module,ra_kv_store,#{}},
parent => <0.279.0>,
reply_to =>
{#Ref<0.118794759.1362100227.213487>,
<0.186.0>},
system_config =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
default_max_append_entries_rpc_batch_size =>
128,
default_max_pipeline_count =>
4096,
message_queue_data => on_heap,
name => default,
names =>
#{closed_mem_tbls =>
ra_log_closed_mem_tables,
directory => ra_directory,
directory_rev =>
ra_directory_reverse,
log_ets => ra_log_ets,
log_meta => ra_log_meta,
log_sup => ra_log_sup,
open_mem_tbls =>
ra_log_open_mem_tables,
segment_writer =>
ra_log_segment_writer,
server_sup =>
ra_server_sup_sup,
wal => ra_log_wal,
wal_sup =>
ra_log_wal_sup},
segment_compute_checksums =>
true,
segment_max_entries => 4096,
wal_compute_checksums => true,
wal_data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
wal_garbage_collect => false,
wal_max_batch_size => 8192,
wal_max_entries => undefined,
wal_max_size_bytes => 256000000,
wal_pre_allocate => false,
wal_sync_method => datasync,
wal_write_strategy => default},
tick_timeout => 1000,
uid => <<"CLUSTE5ASRB64T2AVI">>}]}},
{restart_type,transient},
{significant,false},
{shutdown,5000},
{child_type,worker}]
=INFO REPORT==== 8-Dec-2022::15:22:06.712186 ===
Going for a round...
=INFO REPORT==== 8-Dec-2022::15:22:16.717142 ===
Stopping server {ra_kv,'ra2@shino-xps'}
=INFO REPORT==== 8-Dec-2022::15:22:17.719796 ===
ra:overview #{counters =>
#{ra_log_segment_writer =>
#{entries => 0,mem_tables => 0,segments => 0},
ra_log_wal => #{batches => 5,wal_files => 1,writes => 6},
{ra_kv,'ra1@shino-xps'} =>
#{aer_received_follower => 2,
aer_received_follower_empty => 0,
aer_replies_fail => 0,aer_replies_success => 0,
aux_commands => 0,command_flushes => 0,
commands => 0,consistent_queries => 0,
dropped_sends => 0,elections => 0,fetch_term => 3,
forced_gcs => 1,invalid_reply_mode_commands => 0,
local_queries => 0,msgs_sent => 3,
pre_vote_elections => 0,read_cache => 1,
read_closed_mem_tbl => 0,read_open_mem_tbl => 4,
read_ops => 2,read_segment => 0,
release_cursors => 0,reserved_1 => 0,
rpcs_sent => 0,send_msg_effects_sent => 0,
snapshot_installed => 0,snapshots_sent => 0,
snapshots_written => 0,
term_and_voted_for_updates => 1,write_ops => 1,
write_resends => 0}},
node => 'ra1@shino-xps',
segment_writer =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
segment_conf =>
#{compute_checksums => true,max_count => 4096}},
servers =>
#{ra_kv =>
#{cluster_name => cluster,parent => <0.279.0>,
pid => <0.280.0>,snapshot_state => undefined,
state => undefined,
uid => <<"CLUSTE5ASRB64T2AVI">>}},
wal =>
#{closed_mem_tables => 0,open_mem_tables => 1,
status =>
[{header,"Status for batching server ra_log_wal"},
{data,[{"Status",running},
{"Parent",<0.237.0>},
{"Logged Events",[]}]},
#{compute_checksums => true,current_size => 350,
filename => "00000001.wal",
max_size_bytes => 256000000,
write_strategy => default,writers => 1}]}}
=INFO REPORT==== 8-Dec-2022::15:22:18.721525 ===
Starting server {ra_kv,'ra2@shino-xps'}
=PROGRESS REPORT==== 8-Dec-2022::15:22:19.728757 ===
supervisor: {<0.284.0>,ra_server_sup}
started: [{pid,<0.285.0>},
{id,ra_kv},
{mfargs,{ra_server_proc,start_link,
[#{await_condition_timeout => 30000,
broadcast_time => 100,
cluster_name => cluster,
has_changed => false,
id => {ra_kv,'ra1@shino-xps'},
initial_members =>
[{ra_kv,'ra1@shino-xps'},
{ra_kv,'ra2@shino-xps'},
{ra_kv,'ra3@shino-xps'}],
install_snap_rpc_timeout => 120000,
log_init_args =>
#{uid =>
<<"CLUSTE5ASRB64T2AVI">>},
machine => {module,ra_kv_store,#{}},
parent => <0.284.0>,
reply_to =>
{#Ref<0.118794759.1362100227.213717>,
<0.186.0>},
system_config =>
#{data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
default_max_append_entries_rpc_batch_size =>
128,
default_max_pipeline_count =>
4096,
message_queue_data => on_heap,
name => default,
names =>
#{closed_mem_tbls =>
ra_log_closed_mem_tables,
directory => ra_directory,
directory_rev =>
ra_directory_reverse,
log_ets => ra_log_ets,
log_meta => ra_log_meta,
log_sup => ra_log_sup,
open_mem_tbls =>
ra_log_open_mem_tables,
segment_writer =>
ra_log_segment_writer,
server_sup =>
ra_server_sup_sup,
wal => ra_log_wal,
wal_sup =>
ra_log_wal_sup},
segment_compute_checksums =>
true,
segment_max_entries => 4096,
wal_compute_checksums => true,
wal_data_dir =>
"/home/shino/g/rabbitmq-ra-337-ra_test/ra1@shino-xps",
wal_garbage_collect => false,
wal_max_batch_size => 8192,
wal_max_entries => undefined,
wal_max_size_bytes => 256000000,
wal_pre_allocate => false,
wal_sync_method => datasync,
wal_write_strategy => default},
tick_timeout => 1000,
uid => <<"CLUSTE5ASRB64T2AVI">>}]}},
{restart_type,transient},
{significant,false},
{shutdown,5000},
{child_type,worker}]
=INFO REPORT==== 8-Dec-2022::15:22:19.730027 ===
Going for a round...
** exception error: no match of right hand side value {error,{no_more_servers_to_try,[{timeout,{ra_kv,'ra2@shino-xps'}},
{timeout,{ra_kv,'ra2@shino-xps'}},
{error,noproc}]}}
in function ra_kv_store:consistent_query/0 (/home/shino/g/rabbitmq-ra-337-ra_test/src/ra_kv_store.erl, line 61)
in call from ra_kv_store:maybe_block/0 (/home/shino/g/rabbitmq-ra-337-ra_test/src/ra_kv_store.erl, line 47)
in call from ra_kv_store:until_block/1 (/home/shino/g/rabbitmq-ra-337-ra_test/src/ra_kv_store.erl, line 67)
(ra1@shino-xps)3>
(ra1@shino-xps)3>
(ra1@shino-xps)3>
(ra1@shino-xps)3>
(ra1@shino-xps)3> [{S, ra:consistent_query(S, fun(_) -> foo end)} || S <- ra_kv_store:servers()].
[{{ra_kv,'ra1@shino-xps'},{error,noproc}},
{{ra_kv,'ra2@shino-xps'},{timeout,{ra_kv,'ra2@shino-xps'}}},
{{ra_kv,'ra3@shino-xps'},{timeout,{ra_kv,'ra2@shino-xps'}}}]
(ra1@shino-xps)4>
(ra1@shino-xps)4>
(ra1@shino-xps)4> [{S, ra:consistent_query(S, fun(_) -> foo end)} || S <- ra_kv_store:servers()].
[{{ra_kv,'ra1@shino-xps'},{error,noproc}},
{{ra_kv,'ra2@shino-xps'},{ok,foo,{ra_kv,'ra2@shino-xps'}}},
{{ra_kv,'ra3@shino-xps'},{ok,foo,{ra_kv,'ra2@shino-xps'}}}]
(ra1@shino-xps)5>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment