[SERVER-42909] Replace ConnectionPool generations with sequence ids Created: 19/Aug/19  Updated: 06/Dec/22  Resolved: 15/Oct/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

Right now we use a generation index to processFailure() for connection pooling. This has two unintended side effects in spurious networking conditions:

  • A failed connection causes connections created after it to be considered failed as well. This could throw away good connections in situations with spurious failures.
  • A failed connection causes a connection request (and thus an operation) to receive a not okay status. This can happen even if the remote host has already failed the connection by the time the request came in.

We should use either a monotonic sequence id or clock to mark each time a connection is considered "ready" (including initial creation). We should also attach these ids to requests. When a connection fails, all ids before it should be considered failed.



 Comments   
Comment by Mira Carey [ 20/Aug/19 ]

ben.caimano - I think this is more a bug with finishRefresh, rather than using a generation counter. My original notion was that any connection which comes back in the wrong generation needs to be thrown away, which I think is identical to < _generation (because all new requests are in generation == latest, so != == <). That's also the behavior of returnConnection (check if wrong generation before checking status).

Generated at Thu Feb 08 05:01:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.