Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add more user-visible logs to ns_memcached.

Change-Id: Iabb04ce6b3a44f2f0182485cbb2aedb6b0d53672
Reviewed-on: http://review.northscale.com/3198
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
commit 45a78d823228915ddc70a6a69bd39112d96b6a81 1 parent e2a33d7
@seanlynch seanlynch authored alk committed
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/ns_memcached.erl
View
16 src/ns_memcached.erl
@@ -180,7 +180,9 @@ terminate(Reason, #state{bucket=Bucket, sock=Sock}) ->
Reason == normal; Reason == shutdown ->
case ns_bucket:get_bucket(Bucket) of
not_present ->
- ?log_info("Flushing data for deleted bucket ~p", [Bucket]),
+ ns_log:log(?MODULE, 2,
+ "Deleting data on ~p for deleted bucket ~p",
+ [node(), Bucket]),
mc_client_binary:flush(Sock);
{ok, BucketConfig} ->
case lists:member(node(), proplists:get_value(
@@ -188,8 +190,11 @@ terminate(Reason, #state{bucket=Bucket, sock=Sock}) ->
true ->
ok;
false ->
- ?log_info("Flushing data for bucket ~p since we no longer own it.",
- [Bucket]),
+ ns_log:log(
+ ?MODULE, 3,
+ "Deleting data for bucket ~p on ~p since bucket "
+ "is no longer mapped to node.",
+ [Bucket, node()]),
mc_client_binary:flush(Sock)
end
end,
@@ -201,7 +206,10 @@ terminate(Reason, #state{bucket=Bucket, sock=Sock}) ->
?log_error("Failed to delete bucket ~p: ~p",
[Bucket, {E, R}])
end;
- true -> ok
+ true ->
+ ns_log:log(?MODULE, 4,
+ "Control connection to memcached on ~p disconnected: ~p",
+ [node(), Reason])
end,
ok = gen_tcp:close(Sock),
ok.
Please sign in to comment.
Something went wrong with that request. Please try again.