Skip to content

Commit

Permalink
Don't try to resolve siblings in supercluster
Browse files Browse the repository at this point in the history
Because it will results in notfound error, almost, in vein.
  • Loading branch information
shino committed Oct 8, 2015
1 parent c810baa commit 36bd3d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
10 changes: 7 additions & 3 deletions riak_test/tests/sibling_benchmark.erl
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ confirm() ->
%% Just test sibling resolver, for a major case of manifests
RawManifestBucket = rc_helper:to_riak_bucket(objects, ?TEST_BUCKET),
RawKey = ?KEY_SINGLE_BLOCK,
R0 = rpc:call(hd(CSNodes), riak_cs_console, resolve_siblings,
[RawManifestBucket, RawKey]),
?assertEqual(ok, R0),
case rpc:call(hd(CSNodes), riak_cs_console, resolve_siblings,
[RawManifestBucket, RawKey]) of
ok -> ok;
{error, not_supported} ->
_ = lager:info("resolve_siblings does not suport multibag yet, skip it"),
ok
end,

%% tearing down the stage
erlcloud_s3:delete_object(?TEST_BUCKET, ?KEY_SINGLE_BLOCK, UserConfig),
Expand Down
17 changes: 11 additions & 6 deletions src/riak_cs_console.erl
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,17 @@ cleanup_orphan_multipart(Timestamp) when is_binary(Timestamp) ->

-spec resolve_siblings(binary(), binary()) -> any().
resolve_siblings(RawBucket, RawKey) ->
{ok, RcPid} = riak_cs_riak_client:start_link([]),
try
{ok, Pid} = riak_cs_riak_client:master_pbc(RcPid),
resolve_siblings(Pid, RawBucket, RawKey)
after
riak_cs_riak_client:stop(RcPid)
case riak_cs_config:is_multibag_enabled() of
true ->
{error, not_supported};
false ->
{ok, RcPid} = riak_cs_riak_client:start_link([]),
try
{ok, Pid} = riak_cs_riak_client:master_pbc(RcPid),
resolve_siblings(Pid, RawBucket, RawKey)
after
riak_cs_riak_client:stop(RcPid)
end
end.

%% @doc Resolve siblings as quick operation. Assuming login via
Expand Down

9 comments on commit 36bd3d9

@kuenishi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from kuenishi
at 36bd3d9

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_cs/bugfix/still-rt-is-failing-oh-my-bad = 36bd3d9 into borshop-integration-1262-bugfix/still-rt-is-failing-oh-my-bad

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_cs/bugfix/still-rt-is-failing-oh-my-bad = 36bd3d9 merged ok, testing candidate = f356aaf

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge sha f356aaf is stale.

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_cs/bugfix/still-rt-is-failing-oh-my-bad = 36bd3d9 into borshop-integration-1262-bugfix/still-rt-is-failing-oh-my-bad

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_cs/bugfix/still-rt-is-failing-oh-my-bad = 36bd3d9 merged ok, testing candidate = 8ac1424

@borshop
Copy link
Contributor

@borshop borshop commented on 36bd3d9 Oct 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding 2.1 to borshop-integration-1262-bugfix/still-rt-is-failing-oh-my-bad = 8ac1424

Please sign in to comment.