~brightbox/riak/master

« back to all changes in this revision

Viewing changes to src/riak_core_ring_manager.erl

  • Committer: GitHub
  • Author(s): Martin Sumner
  • Date: 2019-11-05 09:38:19 UTC
  • mfrom: (557.2.4)
  • Revision ID: git-v1:868283c25cbf4c00a956db9e487625080a3d0be4
Merge pull request #945 from basho/develop-3.0-lastgaspring

Develop 3.0 lastgaspring

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
    State2 = prune_write_notify_ring(Ring, State),
376
376
    {reply,ok,State2};
377
377
handle_call(refresh_my_ring, _From, State) ->
 
378
    %% Pompt the claimant before creating a fresh ring for shutdown, so that
 
379
    %% any final actions can be taken
 
380
    ok = riak_core_claimant:pending_close(State#state.raw_ring, get_ring_id()),
 
381
 
378
382
    %% This node is leaving the cluster so create a fresh ring file
379
383
    FreshRing = riak_core_ring:fresh(),
380
 
    State2 = set_ring(FreshRing, State),
381
 
    %% Make sure the fresh ring gets written before stopping
 
384
    LastGaspRing = riak_core_ring:set_lastgasp(FreshRing),
 
385
    State2 = set_ring(LastGaspRing, State),
 
386
    %% Make sure the fresh ring gets written before stopping, that the updated
 
387
    %% state global ring has the last gasp, but not the persisted ring (so that
 
388
    %% on restart there will be no last gasp indicator. 
382
389
    ok = do_write_ringfile(FreshRing),
383
390
 
384
391
    %% Handoff is complete and fresh ring is written