Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use init:script_id() for the server version. #22

Merged
merged 1 commit into from

2 participants

Sean Cribbs Russell Brown
Sean Cribbs
Owner

This makes it track releases better and is no longer coupled to the KV version.

Sean Cribbs seancribbs Use init:script_id() for the server version.
This makes it track releases better and is no longer coupled to the KV
version.
151cfb9
Sean Cribbs seancribbs was assigned
Russell Brown russelldb was assigned
Russell Brown russelldb commented on the diff
src/riak_api_basic_pb_service.erl
@@ -70,8 +68,7 @@ encode(Message) ->
process(rpbpingreq, State) ->
{reply, rpbpingresp, State};
process(rpbgetserverinforeq, State) ->
- %% TODO: Think of a better way to present the server version
- {ok, Vsn} = application:get_key(riak_kv, vsn),
+ {_, Vsn} = init:script_id(),
Russell Brown Owner

I notice on my current build application:get_key(riak_kv, vsn) and init:script_id() return different values. Is the former maintained by hand in the riak_kv.app.src? where does the init:script_id() value come from? (I mean, I see it comes from riak.rel / riak.boot in, but how does it get there, e.g. mine says 1.3.0rc2 but application:get_key says 1.3.0)

Sean Cribbs Owner

It is set originally in reltool.config and ends up in the riak.rel file. The fact that your release still says 1.3.0rc2 is because of this line in reltool.config on master:

{sys, [
       {lib_dirs, ["../deps", "../deps/riak_search/apps"]},
       {rel, "riak", "1.3.0rc2",
       %...
Russell Brown Owner

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sean Cribbs seancribbs was assigned
Sean Cribbs seancribbs merged commit ec2d353 into from
Sean Cribbs seancribbs deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2013
  1. Sean Cribbs

    Use init:script_id() for the server version.

    seancribbs authored
    This makes it track releases better and is no longer coupled to the KV
    version.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/riak_api_basic_pb_service.erl
5 src/riak_api_basic_pb_service.erl
View
@@ -57,12 +57,10 @@ init() ->
undefined.
%% @doc decode/2 callback. Decodes an incoming message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
decode(Code, Bin) when Code == 1; Code == 7 ->
{ok, riak_pb_codec:decode(Code, Bin)}.
%% @doc encode/1 callback. Encodes an outgoing response message.
-%% @todo Factor this out of riakc_pb to remove the dependency.
encode(Message) ->
{ok, riak_pb_codec:encode(Message)}.
@@ -70,8 +68,7 @@ encode(Message) ->
process(rpbpingreq, State) ->
{reply, rpbpingresp, State};
process(rpbgetserverinforeq, State) ->
- %% TODO: Think of a better way to present the server version
- {ok, Vsn} = application:get_key(riak_kv, vsn),
+ {_, Vsn} = init:script_id(),
Russell Brown Owner

I notice on my current build application:get_key(riak_kv, vsn) and init:script_id() return different values. Is the former maintained by hand in the riak_kv.app.src? where does the init:script_id() value come from? (I mean, I see it comes from riak.rel / riak.boot in, but how does it get there, e.g. mine says 1.3.0rc2 but application:get_key says 1.3.0)

Sean Cribbs Owner

It is set originally in reltool.config and ends up in the riak.rel file. The fact that your release still says 1.3.0rc2 is because of this line in reltool.config on master:

{sys, [
       {lib_dirs, ["../deps", "../deps/riak_search/apps"]},
       {rel, "riak", "1.3.0rc2",
       %...
Russell Brown Owner

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Message = #rpbgetserverinforesp{node = riak_pb_codec:to_binary(node()),
server_version = riak_pb_codec:to_binary(Vsn)},
{reply, Message, State}.
Something went wrong with that request. Please try again.