[DRIVERS-1998] Add a reason to connection pool Clear method Created: 01/Dec/21  Updated: 11/Jan/23

Status: Backlog
Project: Drivers
Component/s: CMAP
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Dmitry Lukyanov (Inactive) Assignee: Dmitry Lukyanov (Inactive)
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DRIVERS-2032 Clarify server pinning behavior and p... Backlog
Driver Changes: Needed
Quarter: FY24Q2

 Description   

Summary

Add a reason for a connection pool Clear method. The included information should clarify why the method has been called, for example include Heartbeat exception.

Motivation

Who is the affected end user?

Drivers

How does this affect the end user?

-

How likely is it that this problem or use case will occur?

It's always reproducible in sharded transaction where pinning server is involved. Steps:

  1. The valid server is pinned by the previous operation
  2. Then heartbeat is failed, the pool is paused. The server is not unpinned because heartbeat doesn't participate in unpinning
  3. The next operation in transaction sees the pinned server and doesn't select it again, then tries to acquire connection and sees pausable pool exception without a reason of why it has been triggered.

The same behavior where we use previously selected server happens in cursors. We pass the server that has been selected in the initial operation into cursor and don't select any other server for internal cursor operations like GetMore or KillCursor (regardless wire protocol)

If the problem does occur, what are the consequences and how severe are they?

The implementation of this ticket will allow easier diagnostic of why the paused pool exception has been triggered.

Is this issue urgent?

no

Is this ticket required by a downstream team?

no

Is this ticket only for tests?

no



 Comments   
Comment by Boris Dogadov [ 18/Oct/22 ]

cc james.kovacs@mongodb.com 

Comment by Dmitry Lukyanov (Inactive) [ 14/Dec/21 ]

what about clarification for pinning behavior? Should I create a ticket for it?

Comment by Patrick Freed [ 14/Dec/21 ]

This would be a useful clarification, but since it's already implicitly required by the format of the PoolClearedError, completing this work is not a high priority right now. It would be a simple change though, so if any interested parties want to pick it up that would also be fine.

Comment by Dmitry Lukyanov (Inactive) [ 01/Dec/21 ]

As it was discussed here, this ticket can lead to creating different tickets to clarify pinning server behavior in transaction and cursors

Generated at Thu Feb 08 08:24:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.