Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: basho/riak_core
base: cet-bg-mgr-proto
...
head fork: basho/riak_core
compare: eas-merge.1.4.2
  • 7 commits
  • 3 files changed
  • 0 commit comments
  • 5 contributors
Commits on Aug 17, 2013
Evan Vigil-McClanahan evanmcc make core aware of possible null returns 6cfa2cb
Commits on Aug 19, 2013
Engel A. Sanchez engelsanchez Add protection against folsom stat errors
Folsom may sometimes return an error tuple if something goes wrong (see
folsom_ets.erl), but our code was only catching exceptions. So the error
would end up being used as a valid value and crash the riak_kv_stat
process later. This fixes that problem and gives us better protection
from folsom funkiness.
586df15
Evan Vigil-McClanahan evanmcc Merge pull request #359 from basho/pevm-drop-bad-data
Corruption filtering changes for core.
84eb7b1
Commits on Aug 20, 2013
Engel A. Sanchez engelsanchez Merge pull request #356 from basho/eas-folsom-stat-error-protection
Add protection against folsom stat errors
41add84
Commits on Aug 23, 2013
Jared Morrow jaredmorrow Roll webmachine dep to 1.10.4 5d6b5b9
Jared Morrow jaredmorrow Roll riak_core version 1.4.2 3352fa2
Commits on Sep 04, 2013
Engel A. Sanchez engelsanchez Merge 1.4.2 into develop
Conflicts:
	rebar.config
05f1720
2  ebin/riak_core.app
View
@@ -3,7 +3,7 @@
{application, riak_core,
[
{description, "Riak Core"},
- {vsn, "1.4.1"},
+ {vsn, "1.4.2"},
{modules, [
app_helper,
bloom,
33 src/riak_core_handoff_sender.erl
View
@@ -316,21 +316,28 @@ visit_item(K, V, Acc) ->
case Filter(K) of
true ->
- BinObj = Module:encode_handoff_item(K, V),
-
- ItemQueue2 = [BinObj | ItemQueue],
- ItemQueueLength2 = ItemQueueLength + 1,
- ItemQueueByteSize2 = ItemQueueByteSize + byte_size(BinObj),
-
- Acc2 = Acc#ho_acc{item_queue_length=ItemQueueLength2,
- item_queue_byte_size=ItemQueueByteSize2},
-
+ case Module:encode_handoff_item(K, V) of
+ corrupted ->
+ {Bucket, Key} = K,
+ lager:warning("Unreadable object ~p/~p discarded",
+ [Bucket, Key]),
+ Acc;
+ BinObj ->
+
+ ItemQueue2 = [BinObj | ItemQueue],
+ ItemQueueLength2 = ItemQueueLength + 1,
+ ItemQueueByteSize2 = ItemQueueByteSize + byte_size(BinObj),
+
+ Acc2 = Acc#ho_acc{item_queue_length=ItemQueueLength2,
+ item_queue_byte_size=ItemQueueByteSize2},
+
%% Unit size is bytes:
- HandoffBatchThreshold = app_helper:get_env(riak_core, handoff_batch_threshold, 1024*1024),
+ HandoffBatchThreshold = app_helper:get_env(riak_core, handoff_batch_threshold, 1024*1024),
- case ItemQueueByteSize2 =< HandoffBatchThreshold of
- true -> Acc2#ho_acc{item_queue=ItemQueue2};
- false -> send_objects(ItemQueue2, Acc2)
+ case ItemQueueByteSize2 =< HandoffBatchThreshold of
+ true -> Acc2#ho_acc{item_queue=ItemQueue2};
+ false -> send_objects(ItemQueue2, Acc2)
+ end
end;
false ->
10 src/riak_core_stat_q.erl
View
@@ -90,6 +90,10 @@ get_stat(Stat) ->
Pid = riak_core_stat_calc_sup:calc_proc(Stat),
riak_core_stat_calc_proc:value(Pid).
+throw_folsom_error({error, _, _} = Err) ->
+ throw(Err);
+throw_folsom_error(Other) -> Other.
+
%% Encapsulate getting a stat value from folsom.
%%
%% If for any reason we can't get a stats value
@@ -99,7 +103,7 @@ get_stat(Stat) ->
%% stats that are broken?
calc_stat({Name, gauge}) ->
try
- GaugeVal = folsom_metrics:get_metric_value(Name),
+ GaugeVal = throw_folsom_error(folsom_metrics:get_metric_value(Name)),
calc_gauge(GaugeVal)
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
@@ -107,13 +111,13 @@ calc_stat({Name, gauge}) ->
end;
calc_stat({Name, histogram}) ->
try
- folsom_metrics:get_histogram_statistics(Name)
+ throw_folsom_error(folsom_metrics:get_histogram_statistics(Name))
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
unavailable
end;
calc_stat({Name, _Type}) ->
- try folsom_metrics:get_metric_value(Name)
+ try throw_folsom_error(folsom_metrics:get_metric_value(Name))
catch ErrClass:ErrReason ->
log_error(Name, ErrClass, ErrReason),
unavailable

No commit comments for this range

Something went wrong with that request. Please try again.