[CDRIVER-3625] Multi-threaded scanning should scan servers independently Created: 15/Apr/20 Updated: 28/Oct/23 Resolved: 29/May/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | SDAM |
| Affects Version/s: | None |
| Fix Version/s: | 1.17.0-beta2, 1.17.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
For a client pool, the background topology scanner runs a complete scan of all servers after heartbeatFrequencyMS has passed (or sooner, if a scan is requested). The background scan uses mongoc_topology_scan_once. This fans out "ismaster" commands and waits for all responses before another scan can be scheduled. A big problem with this, is that a slow server could block the next scheduled scan of all other servers. The timeout of an "ismaster" in scanning is connectTimeoutMS, which may exceed heartbeatFrequencyMS. This scenario can easily happen: 1. Scan requested I've reproduced this behavior by modifying example-sdam-monitoring.c. It overrides the stream initializer to simulate a slow connection to one server. Running it against a two node replica set shows the behavior:
The second heartbeat to localhost:27017 is blocked by the 20 second connection timeout. This behavior is unavoidable for single-threaded scans, but should not be the case for multi-threaded scans. Servers should be scanned at their own intervals (which also better aligns with the server monitoring spec). |
| Comments |
| Comment by Kevin Albertson [ 04/Jun/20 ] |
| Comment by Githook User [ 29/May/20 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: For a client pool, servers are now scanned independently using a SRV polling is now done on a separate thread. |
| Comment by Githook User [ 29/May/20 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: For a client pool, servers are now scanned independently using a SRV polling is now done on a separate thread. |
| Comment by Kevin Albertson [ 02/May/20 ] |
|
The following should be done as a part of this ticket or as a separate follow-on ticket:
|
| Comment by April Schoffer [ 20/Apr/20 ] |
|
|