Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When to clear tainted ring state or what's the meaning of tainted ring [JIRA: RIAK-1864] #744

Open
jsvisa opened this issue Jun 12, 2015 · 1 comment

Comments

@jsvisa
Copy link

jsvisa commented Jun 12, 2015

Hi all, In riak_core_ring_manager.erl, every time you fresh the ring, or transfer the ring, you have to riak_core_ring:set_tainted/1, but I don't see anywhere to clear the tainted ring? So my question is what does riak_core_ring:set_tainted/1 actually did? What's the meaning of a tainted ring? Yeah, you may say a tainted ring is dangerous, the riak_core may stopped by app_helper:get_env(riak_core, exit_when_tainted, false). But I see after the cluster is set up, all nodes started, the ring is always tainted, seems it's useless?

@Basho-JIRA Basho-JIRA changed the title When to clear tainted ring state or what's the meaning of tainted ring When to clear tainted ring state or what's the meaning of tainted ring [JIRA: RIAK-1864] Jun 12, 2015
@binarytemple-external
Copy link

@jsvisa +1 also curious - changes were introduced by this P/R by @jtuple in 2011.

I never really understood the distinction between riak_core_ring:get_raw_ring and riak_core_ring:get_my_ring.

Examining the data structure returned by riak_core_ring_manager:get_raw_ring() - the only significant difference seems to be the following field: [[riak_core_ring_tainted|{meta_entry,t....

And the tainted ring check you mention is not enabled by default:

check_tainted(Ring=?CHSTATE{}, Msg) ->
    Exit = app_helper:get_env(riak_core, exit_when_tainted, false),
    case {get_meta(riak_core_ring_tainted, Ring), Exit} of
        {{ok, true}, true} ->
            riak_core:stop(Msg),
            ok;
        {{ok, true}, false} ->
            lager:error(Msg),
            ok;
        _ ->
            ok
    end.

The ring state is held per node in ETS (which is cheap to update, but comparatively slow to query), after a certain period of cluster stability (60 seconds I think) stored as a module definition via mochiglobal for faster lookup speed.

I guess the taint checks might have something to do with this interplay?

martinsumner added a commit that referenced this issue Oct 28, 2019
to make it easier should it ever need to be unset via remote_console should something go wrong.  Also provides function to unset tainted ring re #744
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants