FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Multiple clients summarize at the same time

Open vladsud opened this issue 7 years ago • 4 comments

Here are summarize-related ops from last readout file, locally downloaded here summarize 317 summaryAck 272 summaryNack 45

I’ve put all summary-related messages for this file into summaries.txt

All but one nacks are of that type: "errorMessage": "Proposed parent summary "bB+FJAAAHAAAA" does not match actual parent summary "bBxBKAAAHAAAA".",

Here is one example of the flow (I spot check 5 more – they are all the same) – 2 different summarizing clients: { "clientId": "5cf34f42-274e-4c6a-8cdb-20bebc1a0ee1", "contents": { "handle": "bO54AAAABAAAABgAAAA==", "head": "bB+FJAAAHAAAA", }, "sequenceNumber": 18999, "timestamp": 1569636957081, "type": "summarize" } { "clientId": "610c7bc3-bc0a-45da-997a-92356a0748da", "contents": { "handle": "bO58AAAABAAAABgAAAA==", "head": "bB+FJAAAHAAAA", }, "sequenceNumber": 19002, "timestamp": 1569636963080, "type": "summarize" } { "contents": { "handle": "bBxBKAAAHAAAA", }, "sequenceNumber": 19003, "timestamp": 1569636971583, "type": "summaryAck" } { "clientSequenceNumber": -1, "contents": { "errorMessage": "Proposed parent summary "bB+FJAAAHAAAA" does not match actual parent summary "bBxBKAAAHAAAA".", }, "sequenceNumber": 19004, "timestamp": 1569636978152, "type": "summaryNack" }

vladsud avatar Sep 29 '19 15:09 vladsud

Note - this is very likely due to Issue #197

vladsud avatar Sep 29 '19 15:09 vladsud

As a note: leader election isn't used for electing the summarizer. Summarizer is just the 0th member of the quorum, so all clients use that rule to know if they are the summarizer or not, and everyone recalculates on member join/leave. I'll take a look at this, but my guess is summarizers do not disconnect correctly (I think I have experienced this) sometimes.

arinwt avatar Sep 30 '19 03:09 arinwt

This is easy to reproduce with a disconnect.

0th 1st 2nd 3rd next action
c1 s1 c2 c3 c1 closes tab, which also closes s1
c2 c3 now c2 is 0th member, so spawns summarizer s2
c2 c3 s2 c2 disconnects but does not close tab
c3 s2 now c3 is 0th member, so spawns summarizer s3
c3 s2 s3 now there are 2 summarizers running

Looking at fixing with 2 changes:

  1. The summarizer will check that the client it is on behalf of (the container which spawned it), is still the 0th member of the quorum right before summarizing. If not, then it will stop - which closes its container.
  2. The summary manager already detects when the parent container disconnects, so now it will call stop on the spawned summarizer when this happens.

arinwt avatar Sep 30 '19 21:09 arinwt

Thanks! @GaryWilber , @ram-ramasubramanian - FYI, making progress on multiple summarizes.

vladsud avatar Sep 30 '19 21:09 vladsud