Skip to content

Commit

Permalink
Refine warning log and code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shino committed Sep 9, 2014
1 parent 6de33fe commit 24b1e05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions riak_test/tests/gc_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ verify_gc_run(Node, GCKey) ->
rtcs:gc(1, "batch"),
true = rt:expect_in_log(Node,
"Invalid state manifest in GC bucket at <<\""
++ binary_to_list(GCKey)
++ "\">>: "),
++ binary_to_list(GCKey) ++ "\">>, "
++ "bucket=<<\"" ++ ?TEST_BUCKET ++ "\">> "
++ "key=<<\"" ++ ?TEST_KEY_BAD_STATE ++ "\">>: "),
true = rt:expect_in_log(Node,
"Finished garbage collection: \\d+ seconds, "
"\\d batch_count, 0 batch_skips, "
Expand Down
9 changes: 7 additions & 2 deletions src/riak_cs_delete_fsm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,17 @@ handle_receiving_manifest(State=#state{manifest=Manifest,
total_blocks=BlockCount},
start_block_servers(NewState);
{error, invalid_state} ->
_ = lager:warning("Invalid state manifest in GC bucket at ~p: ~p",
[GCKey, Manifest]),
{Bucket, Key} = Manifest?MANIFEST.bkey,
_ = lager:warning("Invalid state manifest in GC bucket at ~p, "
"bucket=~p key=~p: ~p",
[GCKey, Bucket, Key, Manifest]),
%% If total blocks and deleted blocks are the same,
%% gc worker attempt to delete the manifest in fileset.
%% Then manifests and blocks becomes orphan.
%% To avoid it, set total_blocks > 0 here.
%% For now delete FSM stops with pseudo-normal termination to
%% let other valid manifests be collected, as the root cause
%% of #827 is still unidentified.
{stop, normal, State#state{total_blocks=1}}
end.

Expand Down

6 comments on commit 24b1e05

@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 24b1e05 Sep 9, 2014

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 24b1e05

@borshop
Copy link
Contributor

@borshop borshop commented on 24b1e05 Sep 9, 2014

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/skip-invalid-state-manifest-in-gc = 24b1e05 into borshop-integration-964-bugfix/skip-invalid-state-manifest-in-gc

@borshop
Copy link
Contributor

@borshop borshop commented on 24b1e05 Sep 9, 2014

Choose a reason for hiding this comment

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

basho/riak_cs/bugfix/skip-invalid-state-manifest-in-gc = 24b1e05 merged ok, testing candidate = f381403

@borshop
Copy link
Contributor

@borshop borshop commented on 24b1e05 Sep 9, 2014

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 24b1e05 Sep 9, 2014

Choose a reason for hiding this comment

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

fast-forwarding release/1.5 to borshop-integration-964-bugfix/skip-invalid-state-manifest-in-gc = f381403

Please sign in to comment.