Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2136

ChangeStream server selectors should include a LatencySelector

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.2
    • Affects Version/s: 1.7.1
    • Component/s: None
    • None
    • Not Needed

      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?

            Assignee:
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: