anton-vinogradov commented on PR #13327:
URL: https://github.com/apache/ignite/pull/13327#issuecomment-4876643524

   Sequence of events leading to the message loss:
   
   ```mermaid
   sequenceDiagram
       participant S as New router (server)
       participant RC as Client: Reconnector<br/>(own TcpDiscoveryIoSession)
       participant SR as Client: SocketReader<br/>(fresh TcpDiscoveryIoSession)
   
       Note over S: topology storm: NodeLeft(N+1) is enqueued<br/>to the client 
worker right behind the reconnect response
       S->>RC: [reconnect response][NodeLeft(N+1)] — one TCP segment
       Note over RC: BufferedInputStream reads ahead:<br/>BOTH messages land in 
the session buffer
       RC->>RC: parses reconnect response, returns success
       Note over RC: NodeLeft(N+1) bytes stay in the buffer<br/>of the 
abandoned session — lost forever
       RC-->>SR: socket handed over (raw socket, new session)
       S->>SR: NodeLeft(N+2) — later segment
       Note over SR: client applies N+2 while lastVer=N →<br/>AssertionError: 
lastVer=N, newVer=N+2<br/>(or stays on stale topology if nothing follows)
   ```
   
   Before IGNITE-26111 both readers shared the single `BufferedInputStream` 
owned by `SocketStream`, so the read-ahead survived the handover — the fix 
restores exactly that invariant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to