[CDRIVER-751] Discovered servers not checked until next scan Created: 16/Jul/15 Updated: 12/Aug/15 Resolved: 10/Aug/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | 1.2-beta0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Description |
|
Bug in unreleased implementation of Server Discovery And Monitoring spec. The spec requires a single-threaded scan to keep going until all nodes have been checked, including nodes discovered during the scan. But it seems that _mongoc_topology_do_blocking_scan quits once all servers known at the start of the scan are checked. Discovered nodes are added to the topology description, but not checked until the next scan. I think mongoc_topology_scanner_add must call mongoc_async_cmd_new to schedule a check during the current scan, instead of deferring it to the next scan. Impact: an initial server selection may take longer than necessary, or may fail when it could have succeeded. E.g., if the seed list contains only a secondary, the primary is discovered from the secondary's host list, but not checked until the next scan, 500 ms (minHeartbeatFrequencyMS) later. If the new "serverSelectionTryOnce" is enabled in single-threaded mode, the selection actually fails in this scenario when it must succeed. |
| Comments |
| Comment by Githook User [ 10/Aug/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Fix test_topology_scanner_oscillate case. |
| Comment by Githook User [ 10/Aug/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Bug in unreleased Server Discovery And Monitoring implementation. The spec requires a single-threaded scan to keep going until all nodes With this patch, a block scan keeps going until all servers are checked, TODO: test_topology_scanner_oscillate currently fails, revealing that |