Multiple clients summarize at the same time
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" }
Note - this is very likely due to Issue #197
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.
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:
- 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.
- The summary manager already detects when the parent container disconnects, so now it will call stop on the spawned summarizer when this happens.
Thanks! @GaryWilber , @ram-ramasubramanian - FYI, making progress on multiple summarizes.