preCommitConfigurationChange vRaft (entry:_) = do
    case entryAction entry of
        Cmd _ -> return ()
        action -> do
            raft <- readTVar (raftContext vRaft)
            let oldRaftState = raftState raft
                newCfg = applyConfigurationAction (clusterConfiguration $ raftStateConfiguration oldRaftState) action
                newRaft = setRaftConfiguration newCfg raft
            writeTVar (raftContext vRaft) newRaft
    -- we don't need to recurse, because we expect the configuration change at the beginning
    -- preCommitConfigurationChange vRaft entries

{-|
Wait for request vote requests and process them
-}
preCommitConfigurationChange vRaft (entry:_) = do
    case entryAction entry of
        Cmd _ -> return ()
        action -> do
            raft <- readTVar (raftContext vRaft)
            let oldRaftState = raftState raft
                newCfg = applyConfigurationAction (clusterConfiguration $ raftStateConfiguration oldRaftState) action
                newRaft = setRaftConfiguration newCfg raft
            writeTVar (raftContext vRaft) newRaft
    -- we don't need to recurse, because we expect the configuration change at the beginning
    -- preCommitConfigurationChange vRaft entries

{-|
Wait for request vote requests and process them
-}
preCommitConfigurationChange vRaft (entry:_) = do
    case entryAction entry of
        Cmd _ -> return ()
        action -> do
            raft <- readTVar (raftContext vRaft)
            let oldRaftState = raftState raft
                newCfg = applyConfigurationAction (clusterConfiguration $ raftStateConfiguration oldRaftState) action
                newRaft = setRaftConfiguration newCfg raft
            writeTVar (raftContext vRaft) newRaft
    -- we don't need to recurse, because we expect the configuration change at the beginning
    -- preCommitConfigurationChange vRaft entries

{-|
Wait for request vote requests and process them
-}