Most new clients propose leadership when there is actually a leader
Looking at fluid-fetcher analyzes of latest readout file, I've noticed we have too many proposals & rejections. All of them seems to be coming from new clients always proposing leadership immediately after joining (literary first op). This is not just 1-off issue or some weird case - even second client (on op #30) does that. And yet, it's not 100% correlation:
join 1,537 propose 907
Can you please poke at it and see what's going on? Sounds like it should be easy to repro. It's possible it has something to do with difference in states between snapshot & latest state - i.e. if snapshot does not have leader, do we always propose leadership even if by the time we are connected, we know there is a leader?
Note: I'll look into why we have so many sessions - clients lose connection quite often.
I was playing with the idea of alternate leadership mechanism for a while. Previously, proposals were the only mechanism to get a consensus. But now with the scheduler component and consensus-register dds, it's much easier to reach a consensus and we don't need that many proposals.
I updated how leader's are calculated in master (not in 0.10). My tests are working fine. We can add it to 0.10 and test it out. All the variables and events are still the same so app does not need to do anything else. In addition, I added a "notleader" event to propagate that this client is not the leader anymore. This is useful since we have readonly clients now. And app can use it revert back the leader related tasks.
PR: https://github.com/microsoft/FluidFramework/pull/155/files
Thanks Tanvir! Arin - can you please sync up with Tanvir and see what's the right action is for 10.0? Thanks!
I assume this is addressed in master. We no longer porting things to 0.10 and will move Bohemia to 0.11 shortly.