Skip to content

Commit 987b3ec

Browse files
authored
Merge pull request #2100 from matthewdale/godriver3494-dep-hedgedread
GODRIVER-3494 Deprecate hedged read preference methods.
2 parents 5bde67f + f650e80 commit 987b3ec

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

mongo/readpref/options.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,15 @@ func WithTagSets(tagSets ...tag.Set) Option {
7171
}
7272
}
7373

74-
// WithHedgeEnabled specifies whether or not hedged reads should be enabled in the server. This feature requires MongoDB
75-
// server version 4.4 or higher. For more information about hedged reads, see
76-
// https://www.mongodb.com/docs/manual/core/sharded-cluster-query-router/#mongos-hedged-reads. If not specified, the default
77-
// is to not send a value to the server, which will result in the server defaults being used.
74+
// WithHedgeEnabled specifies whether or not hedged reads should be enabled in
75+
// the server. This feature requires MongoDB server version 4.4 or higher. For
76+
// more information about hedged reads, see
77+
// https://www.mongodb.com/docs/manual/core/sharded-cluster-query-router/#mongos-hedged-reads.
78+
// If not specified, the default is to not send a value to the server, which
79+
// will result in the server defaults being used.
80+
//
81+
// Deprecated: Hedged reads are deprecated in MongoDB 8.0 and may be removed in
82+
// a future MongoDB version.
7883
func WithHedgeEnabled(hedgeEnabled bool) Option {
7984
return func(rp *ReadPref) error {
8085
rp.hedgeEnabled = &hedgeEnabled

mongo/readpref/readpref.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ func (r *ReadPref) TagSets() []tag.Set {
103103
return r.tagSets
104104
}
105105

106-
// HedgeEnabled returns whether or not hedged reads are enabled for this read preference. If this option was not
107-
// specified during read preference construction, nil is returned.
106+
// HedgeEnabled returns whether or not hedged reads are enabled for this read
107+
// preference. If this option was not specified during read preference
108+
// construction, nil is returned.
109+
//
110+
// Deprecated: Hedged reads are deprecated in MongoDB 8.0 and may be removed in
111+
// a future MongoDB version.
108112
func (r *ReadPref) HedgeEnabled() *bool {
109113
return r.hedgeEnabled
110114
}

0 commit comments

Comments
 (0)