this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove useless function

garrison a461f35b 85cbe04a

+10 -13
+10 -13
lib/servers/coordinator.ex
··· 61 61 do_view_change_replicas: %{Coordinator.id => term}, 62 62 63 63 # Replication state 64 - op_number: non_neg_integer, 65 - commit_number: non_neg_integer, 64 + op_number: non_neg_integer | -1, 65 + commit_number: non_neg_integer | -1, 66 66 version: non_neg_integer, 67 67 xks: XKS.t, 68 68 ··· 361 361 assert is_integer(state.commit_number) 362 362 363 363 state = update_view(state, state.view_number) 364 - state = save_state_and_commit(state) 364 + state = commit_storage(state) 365 365 366 366 state = start_manager_if_primary(state) 367 367 ··· 610 610 %{state | version: version} 611 611 end 612 612 613 - # TODO: remove 614 - defp save_state_and_commit(%State{} = state), do: commit_storage(state) 615 - 616 613 # Commands 617 614 618 615 defp run_command(%State{} = state, {m, f, a} = _command) when is_atom(m) and is_atom(f) and is_list(a) do ··· 649 646 current_op: {op_number, writes}, 650 647 } 651 648 |> apply_writes(writes) 652 - |> save_state_and_commit() 649 + |> commit_storage() 653 650 654 651 pending_op = %PendingOp{from: from, result: result, acks: MapSet.new([state.id])} 655 652 state = put_in(state.pending_ops[op_number], pending_op) ··· 705 702 state = 706 703 %{state | op_number: prepare.op_number} 707 704 |> apply_writes(prepare.writes) 708 - |> save_state_and_commit() 705 + |> commit_storage() 709 706 710 707 msg_prepare_ok(primary_pid(state), %PrepareOk{ 711 708 view_number: state.view_number, ··· 729 726 730 727 case commit.commit_number == state.commit_number do 731 728 true -> state 732 - false -> %{state | commit_number: commit.commit_number} |> save_state_and_commit() 729 + false -> %{state | commit_number: commit.commit_number} |> commit_storage() 733 730 end 734 731 |> track_primary_message() 735 732 end ··· 764 761 assert new_commit_number >= state.commit_number 765 762 state = 766 763 %{state | commit_number: new_commit_number} 767 - |> save_state_and_commit() 764 + |> commit_storage() 768 765 769 766 # Reply to clients for committed pending ops and remove them 770 767 state.pending_ops ··· 908 905 } 909 906 |> update_view(state.view_number) 910 907 |> load_checkpoint(max_dvc.checkpoint) 911 - |> save_state_and_commit() 908 + |> commit_storage() 912 909 913 910 assert state.commit_number <= state.op_number 914 911 ··· 949 946 } 950 947 |> update_view(sv.view_number) 951 948 |> load_checkpoint(sv.checkpoint) 952 - |> save_state_and_commit() 949 + |> commit_storage() 953 950 954 951 assert state.role == :backup 955 952 assert state.primary_id != state.id ··· 1053 1050 defp change_view_and_send_do_view_change(%State{} = state, view_number) do 1054 1051 %{state | status: :view_change} 1055 1052 |> update_view(view_number) 1056 - |> save_state_and_commit() 1053 + |> commit_storage() 1057 1054 |> send_do_view_change() 1058 1055 end 1059 1056