[GODRIVER-2136] ChangeStream server selectors should include a LatencySelector Created: 20/Aug/21  Updated: 28/Oct/23  Resolved: 30/Aug/21

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 1.7.1
Fix Version/s: 1.7.2

Type: Bug Priority: Major - P3
Reporter: Matt Dale Assignee: Benji Rewis (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-446 Add option for applications to regist... Closed
Duplicate
duplicates GODRIVER-2143 Clarify server selection process for ... Closed
Related
is related to GODRIVER-563 The writeSelector property in the mon... Closed
Case:
Documentation Changes: Not Needed

 Description   

I looked into this community forum post and I think it describes a real bug.

Summary

Almost all operations use a composite server selector that includes a LatencySelector to filter out high-latency servers.

See default Collection read selector:

description.CompositeSelector([]description.ServerSelector{
	description.ReadPrefSelector(rp),
	description.LatencySelector(db.client.localThreshold),
})

However, the ChangeStream server selector seems to not use a LatencySelector, only a ReadPrefSelector.

See ChangeStream selector:

cs := &ChangeStream{
	client:        config.client,
	registry:      config.registry,
	streamType:    config.streamType,
	options:       options.MergeChangeStreamOptions(opts...),
	selector:      description.ReadPrefSelector(config.readPreference),
	cursorOptions: config.client.createBaseCursorOptions(),
}

Is that intentional or a bug?



 Comments   
Comment by Githook User [ 30/Aug/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-2136 Include LatencySelector in change stream server selector (#720)
Branch: release/1.7
https://github.com/mongodb/mongo-go-driver/commit/2347bc090a7fd3d0a5f59419ead5c203ff0ad6d3

Comment by Githook User [ 30/Aug/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-2136 Include LatencySelector in change stream server selector (#720)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/e142bb3bb6c3c05f3feedefc6c5e87ee096c7422

Comment by Benji Rewis (Inactive) [ 24/Aug/21 ]

https://github.com/mongodb/mongo-go-driver/pull/720

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