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

Different Implementation of ChangeEnsemble between BookKeeperProtocol and BookKeeperProtocolWithLimbo. #5

Open
thetumbled opened this issue Mar 13, 2024 · 0 comments

Comments

@thetumbled
Copy link
Contributor

thetumbled commented Mar 13, 2024

Hi, I have a question about the different Implementation of ChangeEnsemble between BookKeeperProtocol and BookKeeperProtocolWithLimbo.
The ChangeEnsemble operator in BookKeeperProtocolWithLimbo is defined as follows, which only select one faied bookie and add a seemingly unnecessary check ValidNextFragment.
I wonder whether it is a bug or a different implementation due to the new feature limbo? I will appreciate it if you could help to answer this question, thanks.

ChangeEnsemble(c, recovery) ==
    /\ NoPendingResends(c)
    /\ \/ recovery
       \/ ~recovery /\ c.meta_version = meta_version
    /\ \E bookie \in c.curr_fragment.ensemble :
        /\ WriteTimeoutForBookie(messages, bookie, recovery)
        /\ EnsembleAvailable(c.curr_fragment.ensemble \ {bookie}, {bookie})
        /\ ValidNextFragment(c.lac + 1)
        /\ LET new_ensemble   == SelectEnsemble(c.curr_fragment.ensemble \ {bookie}, {bookie})
               first_entry_id == c.lac + 1
           IN LET updated_fragments == UpdatedFragments(c, first_entry_id, new_ensemble)
              IN
                \* only update the metadata if not in ledger recovery
                /\ IF recovery 
                   THEN UNCHANGED << meta_version, meta_fragments >>
                   ELSE /\ meta_fragments' = updated_fragments
                        /\ meta_version' = meta_version + 1
                /\ clients' = [clients EXCEPT ![c.id] =  
                                    [c EXCEPT !.meta_version  = IF recovery THEN @ ELSE meta_version + 1,
                                              !.confirmed     = [id \in DOMAIN c.confirmed |->
                                                                   IF id >= first_entry_id
                                                                   THEN c.confirmed[id] \ {bookie}
                                                                   ELSE c.confirmed[id]],
                                              !.fragments     = updated_fragments,
                                              !.curr_fragment = Last(updated_fragments)]]
                /\ ClearWriteTimeout(bookie, recovery)
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

1 participant