diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 722545f288..337f8a6092 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1698,10 +1698,6 @@ axes: display_name: "4.0" variables: VERSION: "4.0" - - id: "3.6" - display_name: "3.6" - variables: - VERSION: "3.6" - id: "rapid" display_name: "rapid" variables: @@ -2124,19 +2120,6 @@ buildvariants: tasks: - name: ".goleak" - - matrix_name: "tests-rhel-36-with-zlib-support" - tags: ["pullrequest"] - matrix_spec: { version: ["3.6"], os-ssl-32: ["rhel87-64"] } - display_name: "${version} ${os-ssl-32}" - tasks: - - name: ".test !.enterprise-auth !.snappy !.zstd" - - - matrix_name: "tests-windows-36-with-zlib-support" - matrix_spec: { version: ["3.6"], os-ssl-32: ["windows-64"] } - display_name: "${version} ${os-ssl-32}" - tasks: - - name: ".test !.enterprise-auth !.snappy !.zstd" - - matrix_name: "tests-rhel-40-with-snappy-support" tags: ["pullrequest"] matrix_spec: { version: ["4.0"], os-ssl-40: ["rhel87-64"] } diff --git a/README.md b/README.md index f52d9a264c..089a5647cf 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See the following resources to learn more about upgrading from version 1.x to 2. - Go 1.18 or higher. We aim to support the latest versions of Go. - Go 1.22 or higher is required to run the driver test suite. -- MongoDB 3.6 and higher. +- MongoDB 4.0 and higher. ## Installation diff --git a/internal/driverutil/description.go b/internal/driverutil/description.go index df3adc3692..899637997f 100644 --- a/internal/driverutil/description.go +++ b/internal/driverutil/description.go @@ -21,7 +21,7 @@ import ( ) const ( - MinWireVersion = 6 + MinWireVersion = 7 MaxWireVersion = 25 ) diff --git a/internal/integration/causal_consistency_test.go b/internal/integration/causal_consistency_test.go index 2f997f956e..f4817334da 100644 --- a/internal/integration/causal_consistency_test.go +++ b/internal/integration/causal_consistency_test.go @@ -201,40 +201,6 @@ func TestCausalConsistency_Supported(t *testing.T) { }) } -func TestCausalConsistency_NotSupported(t *testing.T) { - // use RunOnBlock instead of mtest.NewOptions().MaxServerVersion("3.4").Topologies(mtest.Single) because - // these tests should be run on servers <= 3.4 OR standalones - rob := []mtest.RunOnBlock{ - {MaxServerVersion: "3.4"}, - {Topology: []mtest.TopologyKind{mtest.Single}}, - } - mt := mtest.New(t, mtest.NewOptions().RunOn(rob...).CreateClient(false)) - - mt.Run("afterClusterTime not included", func(mt *mtest.T) { - // a read in a causally consistent session does not include afterClusterTime in a deployment that does not - // support cluster times - - sessOpts := options.Session().SetCausalConsistency(true) - _ = mt.Client.UseSessionWithOptions(context.Background(), sessOpts, func(ctx context.Context) error { - _, _ = mt.Coll.Find(ctx, bson.D{}) - return nil - }) - - evt := mt.GetStartedEvent() - assert.Equal(mt, "find", evt.CommandName, "expected command 'find', got '%v'", evt.CommandName) - checkOperationTime(mt, evt.Command, false) - }) - mt.Run("clusterTime not included", func(mt *mtest.T) { - // $clusterTime should not be included in commands if the deployment does not support cluster times - - _ = mt.Coll.FindOne(context.Background(), bson.D{}) - evt := mt.GetStartedEvent() - assert.Equal(mt, "find", evt.CommandName, "expected command 'find', got '%v'", evt.CommandName) - _, err := evt.Command.LookupErr("$clusterTime") - assert.NotNil(mt, err, "expected $clusterTime to not be sent, but was") - }) -} - func checkOperationTime(mt *mtest.T, cmd bson.Raw, shouldInclude bool) { mt.Helper() diff --git a/internal/integration/index_view_test.go b/internal/integration/index_view_test.go index 62625c777a..89ad63b988 100644 --- a/internal/integration/index_view_test.go +++ b/internal/integration/index_view_test.go @@ -528,11 +528,6 @@ func TestIndexView(t *testing.T) { Unique: nil, }, } - if mtest.CompareServerVersions(mtest.ServerVersion(), "3.4") < 0 { - for _, expectedSpec := range expectedSpecs { - expectedSpec.Version = 1 - } - } specs, err := mt.Coll.Indexes().ListSpecifications(context.Background()) assert.Nil(mt, err, "ListSpecifications error: %v", err) diff --git a/mongo/bulk_write_models.go b/mongo/bulk_write_models.go index ddc3043a2a..fac0817b6c 100644 --- a/mongo/bulk_write_models.go +++ b/mongo/bulk_write_models.go @@ -70,12 +70,13 @@ func (dom *DeleteOneModel) SetCollation(collation *options.Collation) *DeleteOne return dom } -// SetHint specifies the index to use for the operation. This should either be the index name as a string or the index -// specification as a document. This option is only valid for MongoDB versions >= 4.4. Server versions >= 3.4 will -// return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if -// this option is specified. The driver will return an error if this option is specified during an unacknowledged write -// operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which -// means that no hint will be sent. +// SetHint specifies the index to use for the operation. This should either be +// the index name as a string or the index specification as a document. This +// option is only valid for MongoDB versions >= 4.4. Server versions < 4.4 will +// return an error if this option is specified. The driver will return an error +// if this option is specified during an unacknowledged write operation. The +// driver will return an error if the hint parameter is a multi-key map. The +// default value is nil, which means that no hint will be sent. func (dom *DeleteOneModel) SetHint(hint interface{}) *DeleteOneModel { dom.Hint = hint return dom @@ -111,12 +112,13 @@ func (dmm *DeleteManyModel) SetCollation(collation *options.Collation) *DeleteMa return dmm } -// SetHint specifies the index to use for the operation. This should either be the index name as a string or the index -// specification as a document. This option is only valid for MongoDB versions >= 4.4. Server versions >= 3.4 will -// return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if -// this option is specified. The driver will return an error if this option is specified during an unacknowledged write -// operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which -// means that no hint will be sent. +// SetHint specifies the index to use for the operation. This should either be +// the index name as a string or the index specification as a document. This +// option is only valid for MongoDB versions >= 4.4. Server versions < 4.4 will +// return an error if this option is specified. The driver will return an error +// if this option is specified during an unacknowledged write operation. The +// driver will return an error if the hint parameter is a multi-key map. The +// default value is nil, which means that no hint will be sent. func (dmm *DeleteManyModel) SetHint(hint interface{}) *DeleteManyModel { dmm.Hint = hint return dmm @@ -141,12 +143,13 @@ func NewReplaceOneModel() *ReplaceOneModel { return &ReplaceOneModel{} } -// SetHint specifies the index to use for the operation. This should either be the index name as a string or the index -// specification as a document. This option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will -// return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if -// this option is specified. The driver will return an error if this option is specified during an unacknowledged write -// operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which -// means that no hint will be sent. +// SetHint specifies the index to use for the operation. This should either be +// the index name as a string or the index specification as a document. This +// option is only valid for MongoDB versions >= 4.2. Server versions < 4.2 will +// return an error if this option is specified. The driver will return an error +// if this option is specified during an unacknowledged write operation. The +// driver will return an error if the hint parameter is a multi-key map. The +// default value is nil, which means that no hint will be sent. func (rom *ReplaceOneModel) SetHint(hint interface{}) *ReplaceOneModel { rom.Hint = hint return rom @@ -211,12 +214,13 @@ func NewUpdateOneModel() *UpdateOneModel { return &UpdateOneModel{} } -// SetHint specifies the index to use for the operation. This should either be the index name as a string or the index -// specification as a document. This option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will -// return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if -// this option is specified. The driver will return an error if this option is specified during an unacknowledged write -// operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which -// means that no hint will be sent. +// SetHint specifies the index to use for the operation. This should either be +// the index name as a string or the index specification as a document. This +// option is only valid for MongoDB versions >= 4.2. Server versions < 4.2 will +// return an error if this option is specified. The driver will return an error +// if this option is specified during an unacknowledged write operation. The +// driver will return an error if the hint parameter is a multi-key map. The +// default value is nil, which means that no hint will be sent. func (uom *UpdateOneModel) SetHint(hint interface{}) *UpdateOneModel { uom.Hint = hint return uom @@ -287,12 +291,13 @@ func NewUpdateManyModel() *UpdateManyModel { return &UpdateManyModel{} } -// SetHint specifies the index to use for the operation. This should either be the index name as a string or the index -// specification as a document. This option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will -// return an error if this option is specified. For server versions < 3.4, the driver will return a client-side error if -// this option is specified. The driver will return an error if this option is specified during an unacknowledged write -// operation. The driver will return an error if the hint parameter is a multi-key map. The default value is nil, which -// means that no hint will be sent. +// SetHint specifies the index to use for the operation. This should either be +// the index name as a string or the index specification as a document. This +// option is only valid for MongoDB versions >= 4.2. Server versions < 4.2 will +// return an error if this option is specified. The driver will return an error +// if this option is specified during an unacknowledged write operation. The +// driver will return an error if the hint parameter is a multi-key map. The +// default value is nil, which means that no hint will be sent. func (umm *UpdateManyModel) SetHint(hint interface{}) *UpdateManyModel { umm.Hint = hint return umm diff --git a/mongo/database.go b/mongo/database.go index 414971c870..c18bf52716 100644 --- a/mongo/database.go +++ b/mongo/database.go @@ -115,8 +115,7 @@ func (db *Database) Collection(name string, opts ...options.Lister[options.Colle return newCollection(db, name, opts...) } -// Aggregate executes an aggregate command the database. This requires MongoDB version >= 3.6 and driver version >= -// 1.1.0. +// Aggregate executes an aggregate command the database. // // The pipeline parameter must be a slice of documents, each representing an aggregation stage. The pipeline // cannot be nil but can be empty. The stage documents must all be non-nil. For a pipeline of bson.D documents, the @@ -874,8 +873,7 @@ func (db *Database) createCollectionOperation( } // CreateView executes a create command to explicitly create a view on the server. See -// https://www.mongodb.com/docs/manual/core/views/ for more information about views. This method requires driver version >= -// 1.4.0 and MongoDB version >= 3.4. +// https://www.mongodb.com/docs/manual/core/views/ for more information about views. // // The viewName parameter specifies the name of the view to create. // diff --git a/mongo/options/aggregateoptions.go b/mongo/options/aggregateoptions.go index c49951dc44..cf419677dc 100644 --- a/mongo/options/aggregateoptions.go +++ b/mongo/options/aggregateoptions.go @@ -70,8 +70,7 @@ func (ao *AggregateOptionsBuilder) SetBatchSize(i int32) *AggregateOptionsBuilde } // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, writes -// executed as part of the operation will opt out of document-level validation on the server. This -// option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. The default value +// executed as part of the operation will opt out of document-level validation on the server. The default value // is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for more information about // document validation. func (ao *AggregateOptionsBuilder) SetBypassDocumentValidation(b bool) *AggregateOptionsBuilder { @@ -84,9 +83,8 @@ func (ao *AggregateOptionsBuilder) SetBypassDocumentValidation(b bool) *Aggregat return ao } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For previous -// server versions, the driver will return an error if this option is used. The default value is nil, +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, // which means the default collation of the collection will be used. func (ao *AggregateOptionsBuilder) SetCollation(c *Collation) *AggregateOptionsBuilder { ao.Opts = append(ao.Opts, func(opts *AggregateOptions) error { @@ -99,8 +97,7 @@ func (ao *AggregateOptionsBuilder) SetCollation(c *Collation) *AggregateOptionsB } // SetMaxAwaitTime sets the value for the MaxAwaitTime field. Specifies maximum amount of time -// that the server should wait for new documents to satisfy a tailable cursor query. This option is -// only valid for MongoDB versions >= 3.2 and is ignored for previous server versions. +// that the server should wait for new documents to satisfy a tailable cursor query. func (ao *AggregateOptionsBuilder) SetMaxAwaitTime(d time.Duration) *AggregateOptionsBuilder { ao.Opts = append(ao.Opts, func(opts *AggregateOptions) error { opts.MaxAwaitTime = &d diff --git a/mongo/options/bulkwriteoptions.go b/mongo/options/bulkwriteoptions.go index 11dd6c1b7c..186e83a0c5 100644 --- a/mongo/options/bulkwriteoptions.go +++ b/mongo/options/bulkwriteoptions.go @@ -66,8 +66,7 @@ func (b *BulkWriteOptionsBuilder) SetOrdered(ordered bool) *BulkWriteOptionsBuil } // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, writes -// executed as part of the operation will opt out of document-level validation on the server. This option -// is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. The default value is +// executed as part of the operation will opt out of document-level validation on the server. The default value is // false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for more information about document // validation. func (b *BulkWriteOptionsBuilder) SetBypassDocumentValidation(bypass bool) *BulkWriteOptionsBuilder { diff --git a/mongo/options/changestreamoptions.go b/mongo/options/changestreamoptions.go index 66f1899faa..5607e10dd0 100644 --- a/mongo/options/changestreamoptions.go +++ b/mongo/options/changestreamoptions.go @@ -57,10 +57,9 @@ func (cso *ChangeStreamOptionsBuilder) SetBatchSize(i int32) *ChangeStreamOption return cso } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string comparisons -// during the operation. This option is only valid for MongoDB versions >= 3.4. For previous server versions, -// the driver will return an error if this option is used. The default value is nil, which means the default -// collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (cso *ChangeStreamOptionsBuilder) SetCollation(c Collation) *ChangeStreamOptionsBuilder { cso.Opts = append(cso.Opts, func(opts *ChangeStreamOptions) error { opts.Collation = &c diff --git a/mongo/options/clientoptions.go b/mongo/options/clientoptions.go index 9623562ec8..8602bf2e80 100644 --- a/mongo/options/clientoptions.go +++ b/mongo/options/clientoptions.go @@ -662,9 +662,9 @@ func (c *ClientOptions) SetAuth(auth Credential) *ClientOptions { // SetCompressors sets the compressors that can be used when communicating with a server. Valid values are: // -// 1. "snappy" - requires server version >= 3.4 +// 1. "snappy" // -// 2. "zlib" - requires server version >= 3.6 +// 2. "zlib" // // 3. "zstd" - requires server version >= 4.2, and driver version >= 1.2.0 with cgo support enabled or driver // version >= 1.3.0 without cgo. @@ -896,9 +896,8 @@ func (c *ClientOptions) SetReplicaSet(s string) *ClientOptions { // DeleteManyModel instances to be considered retryable. Unacknowledged writes will not be retried, even if this option // is set to true. // -// This option requires server version >= 3.6 and a replica set or sharded cluster and will be ignored for any other -// cluster type. This can also be set through the "retryWrites" URI option (e.g. "retryWrites=true"). The default is -// true. +// This option only works on a replica set or sharded cluster and will be ignored for any other cluster type. +// This can also be set through the "retryWrites" URI option (e.g. "retryWrites=true"). The default is true. func (c *ClientOptions) SetRetryWrites(b bool) *ClientOptions { c.RetryWrites = &b @@ -912,7 +911,7 @@ func (c *ClientOptions) SetRetryWrites(b bool) *ClientOptions { // EstimatedDocumentCount, Watch (for Client, Database, and Collection), ListCollections, and ListDatabases. Note that // operations run through RunCommand are not retried. // -// This option requires server version >= 3.6 and driver version >= 1.1.0. The default is true. +// The default is true. func (c *ClientOptions) SetRetryReads(b bool) *ClientOptions { c.RetryReads = &b diff --git a/mongo/options/countoptions.go b/mongo/options/countoptions.go index 8f92b62f73..27df828b00 100644 --- a/mongo/options/countoptions.go +++ b/mongo/options/countoptions.go @@ -35,10 +35,9 @@ func (co *CountOptionsBuilder) List() []func(*CountOptions) error { return co.Opts } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string comparisons -// during the operation. This option is only valid for MongoDB versions >= 3.4. For previous server versions, -// the driver will return an error if this option is used. The default value is nil, which means the default -// collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (co *CountOptionsBuilder) SetCollation(c *Collation) *CountOptionsBuilder { co.Opts = append(co.Opts, func(opts *CountOptions) error { opts.Collation = c diff --git a/mongo/options/createcollectionoptions.go b/mongo/options/createcollectionoptions.go index fd0aad57d0..d1231758f3 100644 --- a/mongo/options/createcollectionoptions.go +++ b/mongo/options/createcollectionoptions.go @@ -193,9 +193,8 @@ func (c *CreateCollectionOptionsBuilder) SetCapped(capped bool) *CreateCollectio return c } -// SetCollation sets the value for the Collation field. Specifies the default collation for the new -// collection. This option is only valid for MongoDB versions >= 3.4. For previous server versions, -// the driver will return an error if this option is used. The default value is nil. +// SetCollation sets the value for the Collation field. Specifies the default +// collation for the new collection. The default value is nil. func (c *CreateCollectionOptionsBuilder) SetCollation(collation *Collation) *CreateCollectionOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateCollectionOptions) error { opts.Collation = collation @@ -222,9 +221,9 @@ func (c *CreateCollectionOptionsBuilder) SetChangeStreamPreAndPostImages(csppi i return c } -// SetDefaultIndexOptions sets the value for the DefaultIndexOptions field. Specifies a default -// configuration for indexes on the collection. This option is only valid for MongoDB versions -// >= 3.4. The default value is nil, meaning indexes will be configured using server defaults. +// SetDefaultIndexOptions sets the value for the DefaultIndexOptions field. +// Specifies a default configuration for indexes on the collection. The default +// value is nil, meaning indexes will be configured using server defaults. func (c *CreateCollectionOptionsBuilder) SetDefaultIndexOptions(iopts *DefaultIndexOptionsBuilder) *CreateCollectionOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateCollectionOptions) error { opts.DefaultIndexOptions = iopts @@ -278,7 +277,7 @@ func (c *CreateCollectionOptionsBuilder) SetStorageEngine(storageEngine interfac // SetValidationAction sets the value for the ValidationAction field. Specifies what should happen if a // document being inserted does not pass validation. Valid values are "error" and "warn". See // https://www.mongodb.com/docs/manual/core/schema-validation/#accept-or-reject-invalid-documents for more -// information. This option is only valid for MongoDB versions >= 3.2. The default value is "error". +// information. The default value is "error". func (c *CreateCollectionOptionsBuilder) SetValidationAction(action string) *CreateCollectionOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateCollectionOptions) error { opts.ValidationAction = &action @@ -292,7 +291,7 @@ func (c *CreateCollectionOptionsBuilder) SetValidationAction(action string) *Cre // SetValidationLevel sets the value for the ValidationLevel field. Specifies how strictly the server applies // validation rules to existing documents in the collection during update operations. Valid values are "off", // "strict", and "moderate". See https://www.mongodb.com/docs/manual/core/schema-validation/#existing-documents -// for more information. This option is only valid for MongoDB versions >= 3.2. The default value is "strict". +// for more information. The default value is "strict". func (c *CreateCollectionOptionsBuilder) SetValidationLevel(level string) *CreateCollectionOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateCollectionOptions) error { opts.ValidationLevel = &level @@ -305,8 +304,7 @@ func (c *CreateCollectionOptionsBuilder) SetValidationLevel(level string) *Creat // SetValidator sets the value for the Validator field. Sets a document specifying validation rules for the // collection. See https://www.mongodb.com/docs/manual/core/schema-validation/ for more information about -// schema validation. This option is only valid for MongoDB versions >= 3.2. The default value is nil, -// meaning no validator will be used for the collection. +// schema validation. The default value is nil, meaning no validator will be used for the collection. func (c *CreateCollectionOptionsBuilder) SetValidator(validator interface{}) *CreateCollectionOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateCollectionOptions) error { opts.Validator = validator @@ -402,9 +400,8 @@ func (c *CreateViewOptionsBuilder) List() []func(*CreateViewOptions) error { return c.Opts } -// SetCollation sets the value for the Collation field. Specifies the default collation for the new -// collection. This option is only valid for MongoDB versions >= 3.4. For previous server versions, -// the driver will return an error if this option is used. The default value is nil. +// SetCollation sets the value for the Collation field. Specifies the default +// collation for the new collection. The default value is nil. func (c *CreateViewOptionsBuilder) SetCollation(collation *Collation) *CreateViewOptionsBuilder { c.Opts = append(c.Opts, func(opts *CreateViewOptions) error { opts.Collation = collation diff --git a/mongo/options/deleteoptions.go b/mongo/options/deleteoptions.go index f0d88043c0..1d045d9960 100644 --- a/mongo/options/deleteoptions.go +++ b/mongo/options/deleteoptions.go @@ -34,11 +34,9 @@ func (do *DeleteOneOptionsBuilder) List() []func(*DeleteOneOptions) error { return do.Opts } -// SetCollation sets the value for the Collation field. Specifies a collation to use for -// string comparisons during the operation. This option is only valid for MongoDB -// versions >= 3.4. For previous server versions, the driver will return an error if this -// option is used. The default value is nil, which means the default collation of the -// collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (do *DeleteOneOptionsBuilder) SetCollation(c *Collation) *DeleteOneOptionsBuilder { do.Opts = append(do.Opts, func(opts *DeleteOneOptions) error { opts.Collation = c @@ -62,13 +60,14 @@ func (do *DeleteOneOptionsBuilder) SetComment(comment interface{}) *DeleteOneOpt return do } -// SetHint sets the value for the Hint field. Specifies the index to use for the operation. This -// should either be the index name as a string or the index specification as a document. This option -// is only valid for MongoDB versions >= 4.4. Server versions >= 3.4 will return an error if this -// option is specified. For server versions < 3.4, the driver will return a client-side error if this -// option is specified. The driver will return an error if this option is specified during an -// unacknowledged write operation. The driver will return an error if the hint parameter is a -// multi-key map. The default value is nil, which means that no hint will be sent. +// SetHint sets the value for the Hint field. Specifies the index to use for the +// operation. This should either be the index name as a string or the index +// specification as a document. This option is only valid for MongoDB versions +// >= 4.4. Server versions < 4.4 will return an error if this option is +// specified. The driver will return an error if this option is specified during +// an unacknowledged write operation. The driver will return an error if the +// hint parameter is a multi-key map. The default value is nil, which means that +// no hint will be sent. func (do *DeleteOneOptionsBuilder) SetHint(hint interface{}) *DeleteOneOptionsBuilder { do.Opts = append(do.Opts, func(opts *DeleteOneOptions) error { opts.Hint = hint @@ -122,10 +121,9 @@ func (do *DeleteManyOptionsBuilder) List() []func(*DeleteManyOptions) error { return do.Opts } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. -// For previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (do *DeleteManyOptionsBuilder) SetCollation(c *Collation) *DeleteManyOptionsBuilder { do.Opts = append(do.Opts, func(opts *DeleteManyOptions) error { opts.Collation = c @@ -149,14 +147,14 @@ func (do *DeleteManyOptionsBuilder) SetComment(comment interface{}) *DeleteManyO return do } -// SetHint sets the value for the Hint field. Specifies the index to use for the operation. -// This should either be the index name as a string or the index specification as a document. -// This option is only valid for MongoDB versions >= 4.4. Server versions >= 3.4 will return an -// error if this option is specified. For server versions < 3.4, the driver will return a -// client-side error if this option is specified. The driver will return an error if this option -// is specified during an unacknowledged write operation. The driver will return an error if the -// hint parameter is a multi-key map. The default value is nil, which means that no hint will -// be sent. +// SetHint sets the value for the Hint field. Specifies the index to use for the +// operation. This should either be the index name as a string or the index +// specification as a document. This option is only valid for MongoDB versions +// >= 4.4. Server versions < 4.4 will return an error if this option is +// specified. The driver will return an error if this option is specified during +// an unacknowledged write operation. The driver will return an error if the +// hint parameter is a multi-key map. The default value is nil, which means that +// no hint will be sent. func (do *DeleteManyOptionsBuilder) SetHint(hint interface{}) *DeleteManyOptionsBuilder { do.Opts = append(do.Opts, func(opts *DeleteManyOptions) error { opts.Hint = hint diff --git a/mongo/options/distinctoptions.go b/mongo/options/distinctoptions.go index 0b9167d5d0..3449ecee36 100644 --- a/mongo/options/distinctoptions.go +++ b/mongo/options/distinctoptions.go @@ -33,11 +33,9 @@ func (do *DistinctOptionsBuilder) List() []func(*DistinctOptions) error { return do.Opts } -// SetCollation sets the value for the Collation field. Specifies a collation to use -// for string comparisons during the operation. This option is only valid for MongoDB -// versions >= 3.4. For previous server versions, the driver will return an error if -// this option is used. The default value is nil, which means the default collation -// of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (do *DistinctOptionsBuilder) SetCollation(c *Collation) *DistinctOptionsBuilder { do.Opts = append(do.Opts, func(opts *DistinctOptions) error { opts.Collation = c diff --git a/mongo/options/findoptions.go b/mongo/options/findoptions.go index 92701c9dd5..ea627900ea 100644 --- a/mongo/options/findoptions.go +++ b/mongo/options/findoptions.go @@ -52,11 +52,11 @@ func (f *FindOptionsBuilder) List() []func(*FindOptions) error { return f.Opts } -// SetAllowDiskUse sets the value for the AllowDiskUse field. AllowDiskUse specifies whether the -// server can write temporary data to disk while executing the Find operation. This option is only -// valid for MongoDB versions >= 4.4. Server versions >= 3.2 will report an error if this option -// is specified. For server versions < 3.2, the driver will return a client-side error if this -// option is specified. The default value is false. +// SetAllowDiskUse sets the value for the AllowDiskUse field. AllowDiskUse +// specifies whether the server can write temporary data to disk while executing +// the Find operation. This option is only valid for MongoDB versions >= 4.4. +// Server versions < 4.4 will return an error if this option is specified. The +// default value is false. func (f *FindOptionsBuilder) SetAllowDiskUse(b bool) *FindOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOptions) error { opts.AllowDiskUse = &b @@ -86,10 +86,10 @@ func (f *FindOptionsBuilder) SetBatchSize(i int32) *FindOptionsBuilder { return f } -// SetCollation sets the value for the Collation field. Collation specifies a collation to use for -// string comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. -// For previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Collation specifies a +// collation to use for string comparisons during the operation. The default +// value is nil, which means the default collation of the collection will be +// used. func (f *FindOptionsBuilder) SetCollation(collation *Collation) *FindOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOptions) error { opts.Collation = collation @@ -167,11 +167,11 @@ func (f *FindOptionsBuilder) SetMax(max interface{}) *FindOptionsBuilder { return f } -// SetMaxAwaitTime sets the value for the MaxAwaitTime field. MaxAwaitTime is the maximum amount of -// time that the server should wait for new documents to satisfy a tailable cursor query. This -// option is only valid for tailable await cursors (see the CursorType option for more information) -// and MongoDB versions >= 3.2. For other cursor types or previous server versions, this option -// is ignored. +// SetMaxAwaitTime sets the value for the MaxAwaitTime field. MaxAwaitTime is +// the maximum amount of time that the server should wait for new documents to +// satisfy a tailable cursor query. This option is only valid for tailable await +// cursors (see the CursorType option for more information). For other cursor +// types, this option is ignored. func (f *FindOptionsBuilder) SetMaxAwaitTime(d time.Duration) *FindOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOptions) error { opts.MaxAwaitTime = &d @@ -314,10 +314,9 @@ func (f *FindOneOptionsBuilder) SetAllowPartialResults(b bool) *FindOneOptionsBu return f } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For -// previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (f *FindOneOptionsBuilder) SetCollation(collation *Collation) *FindOneOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOneOptions) error { opts.Collation = collation @@ -471,8 +470,7 @@ func (f *FindOneAndReplaceOptionsBuilder) List() []func(*FindOneAndReplaceOption } // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, writes -// executed as part of the operation will opt out of document-level validation on the server. This -// option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. The +// executed as part of the operation will opt out of document-level validation on the server. The // default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for more // information about document validation. func (f *FindOneAndReplaceOptionsBuilder) SetBypassDocumentValidation(b bool) *FindOneAndReplaceOptionsBuilder { @@ -485,10 +483,9 @@ func (f *FindOneAndReplaceOptionsBuilder) SetBypassDocumentValidation(b bool) *F return f } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. -// For previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (f *FindOneAndReplaceOptionsBuilder) SetCollation(collation *Collation) *FindOneAndReplaceOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOneAndReplaceOptions) error { opts.Collation = collation @@ -633,11 +630,10 @@ func (f *FindOneAndUpdateOptionsBuilder) List() []func(*FindOneAndUpdateOptions) return f.Opts } -// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a set of filters -// specifying to which array elements an update should apply. This option is only valid for -// MongoDB versions >= 3.6. For previous server versions, the driver will return an error if -// this option is used. The default value is nil, which means the update will apply to all -// array elements. +// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a +// set of filters specifying to which array elements an update should apply. The +// default value is nil, which means the update will apply to all array +// elements. func (f *FindOneAndUpdateOptionsBuilder) SetArrayFilters(filters []interface{}) *FindOneAndUpdateOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOneAndUpdateOptions) error { opts.ArrayFilters = filters @@ -650,7 +646,6 @@ func (f *FindOneAndUpdateOptionsBuilder) SetArrayFilters(filters []interface{}) // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the server. -// This option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. // The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ // for more information about document validation. func (f *FindOneAndUpdateOptionsBuilder) SetBypassDocumentValidation(b bool) *FindOneAndUpdateOptionsBuilder { @@ -663,10 +658,9 @@ func (f *FindOneAndUpdateOptionsBuilder) SetBypassDocumentValidation(b bool) *Fi return f } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For -// previous server versions, the driver will return an error if this option is used. The default -// value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (f *FindOneAndUpdateOptionsBuilder) SetCollation(collation *Collation) *FindOneAndUpdateOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOneAndUpdateOptions) error { opts.Collation = collation @@ -807,10 +801,9 @@ func (f *FindOneAndDeleteOptionsBuilder) List() []func(*FindOneAndDeleteOptions) return f.Opts } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. -// For previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (f *FindOneAndDeleteOptionsBuilder) SetCollation(collation *Collation) *FindOneAndDeleteOptionsBuilder { f.Opts = append(f.Opts, func(opts *FindOneAndDeleteOptions) error { opts.Collation = collation diff --git a/mongo/options/indexoptions.go b/mongo/options/indexoptions.go index 48ddac0b63..b7b61c2edf 100644 --- a/mongo/options/indexoptions.go +++ b/mongo/options/indexoptions.go @@ -262,8 +262,7 @@ func (i *IndexOptionsBuilder) SetSparse(sparse bool) *IndexOptionsBuilder { // SetStorageEngine sets the value for the StorageEngine field. Specifies the // storage engine to use for the index. The value must be a document in the form // {<storage engine name>: <options>}. The default value is nil, which means that -// the default storage engine will be used. This option is only applicable for -// MongoDB versions >= 3.0 and is ignored for previous server versions. +// the default storage engine will be used. func (i *IndexOptionsBuilder) SetStorageEngine(engine interface{}) *IndexOptionsBuilder { i.Opts = append(i.Opts, func(opts *IndexOptions) error { opts.StorageEngine = engine @@ -424,8 +423,7 @@ func (i *IndexOptionsBuilder) SetBucketSize(bucketSize int32) *IndexOptionsBuild } // SetPartialFilterExpression sets the value for the PartialFilterExpression field. Sets -// a document that defines which collection documents the index should reference. This -// option is only valid for MongoDB versions >= 3.2 and is ignored for previous server versions. +// a document that defines which collection documents the index should reference. func (i *IndexOptionsBuilder) SetPartialFilterExpression(expression interface{}) *IndexOptionsBuilder { i.Opts = append(i.Opts, func(opts *IndexOptions) error { opts.PartialFilterExpression = expression @@ -437,8 +435,7 @@ func (i *IndexOptionsBuilder) SetPartialFilterExpression(expression interface{}) } // SetCollation sets the value for the Collation field. Specifies the collation to use for -// string comparisons for the index. This option is only valid for MongoDB versions >= 3.4. -// For previous server versions, the driver will return an error if this option is used. +// string comparisons for the index. func (i *IndexOptionsBuilder) SetCollation(collation *Collation) *IndexOptionsBuilder { i.Opts = append(i.Opts, func(opts *IndexOptions) error { opts.Collation = collation diff --git a/mongo/options/insertoptions.go b/mongo/options/insertoptions.go index 43b87470b9..61745600a9 100644 --- a/mongo/options/insertoptions.go +++ b/mongo/options/insertoptions.go @@ -33,8 +33,7 @@ func (ioo *InsertOneOptionsBuilder) List() []func(*InsertOneOptions) error { // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the -// server. This option is valid for MongoDB versions >= 3.2 and is ignored for previous server -// versions. The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ +// server. The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ // for more information about document validation. func (ioo *InsertOneOptionsBuilder) SetBypassDocumentValidation(b bool) *InsertOneOptionsBuilder { ioo.Opts = append(ioo.Opts, func(opts *InsertOneOptions) error { @@ -86,8 +85,7 @@ func (imo *InsertManyOptionsBuilder) List() []func(*InsertManyOptions) error { // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the -// server. This option is valid for MongoDB versions >= 3.2 and is ignored for previous server -// versions. The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ +// server. The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ // for more information about document validation. func (imo *InsertManyOptionsBuilder) SetBypassDocumentValidation(b bool) *InsertManyOptionsBuilder { imo.Opts = append(imo.Opts, func(opts *InsertManyOptions) error { diff --git a/mongo/options/replaceoptions.go b/mongo/options/replaceoptions.go index 0416d071b2..32caceff16 100644 --- a/mongo/options/replaceoptions.go +++ b/mongo/options/replaceoptions.go @@ -39,7 +39,6 @@ func (ro *ReplaceOptionsBuilder) List() []func(*ReplaceOptions) error { // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the server. -// This option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. // The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for // more information about document validation. func (ro *ReplaceOptionsBuilder) SetBypassDocumentValidation(b bool) *ReplaceOptionsBuilder { @@ -52,10 +51,9 @@ func (ro *ReplaceOptionsBuilder) SetBypassDocumentValidation(b bool) *ReplaceOpt return ro } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For -// previous server versions, the driver will return an error if this option is used. The -// default value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (ro *ReplaceOptionsBuilder) SetCollation(c *Collation) *ReplaceOptionsBuilder { ro.Opts = append(ro.Opts, func(opts *ReplaceOptions) error { opts.Collation = c @@ -79,14 +77,14 @@ func (ro *ReplaceOptionsBuilder) SetComment(comment interface{}) *ReplaceOptions return ro } -// SetHint sets the value for the Hint field. Specifies the index to use for the operation. -// This should either be the index name as a string or the index specification as a document. -// This option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will return -// an error if this option is specified. For server versions < 3.4, the driver will return a -// client-side error if this option is specified. The driver will return an error if this option -// is specified during an unacknowledged write operation. The driver will return an error if -// the hint parameter is a multi-key map. The default value is nil, which means that no hint -// will be sent. +// SetHint sets the value for the Hint field. Specifies the index to use for the +// operation. This should either be the index name as a string or the index +// specification as a document. This option is only valid for MongoDB versions +// >= 4.2. Server versions < 4.2 will return an error if this option is +// specified. The driver will return an error if this option is specified during +// an unacknowledged write operation. The driver will return an error if the +// hint parameter is a multi-key map. The default value is nil, which means that +// no hint will be sent. func (ro *ReplaceOptionsBuilder) SetHint(h interface{}) *ReplaceOptionsBuilder { ro.Opts = append(ro.Opts, func(opts *ReplaceOptions) error { opts.Hint = h diff --git a/mongo/options/updateoptions.go b/mongo/options/updateoptions.go index bbf721b221..f7b22e6f84 100644 --- a/mongo/options/updateoptions.go +++ b/mongo/options/updateoptions.go @@ -38,10 +38,10 @@ func (uo *UpdateOneOptionsBuilder) List() []func(*UpdateOneOptions) error { return uo.Opts } -// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a set of filters -// specifying to which array elements an update should apply. This option is only valid for MongoDB -// versions >= 3.6. For previous server versions, the driver will return an error if this option is -// used. The default value is nil, which means the update will apply to all array elements. +// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a +// set of filters specifying to which array elements an update should apply. The +// default value is nil, which means the update will apply to all array +// elements. func (uo *UpdateOneOptionsBuilder) SetArrayFilters(af []interface{}) *UpdateOneOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateOneOptions) error { opts.ArrayFilters = af @@ -54,7 +54,6 @@ func (uo *UpdateOneOptionsBuilder) SetArrayFilters(af []interface{}) *UpdateOneO // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the server. -// This option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. // The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for // more information about document validation. func (uo *UpdateOneOptionsBuilder) SetBypassDocumentValidation(b bool) *UpdateOneOptionsBuilder { @@ -67,10 +66,9 @@ func (uo *UpdateOneOptionsBuilder) SetBypassDocumentValidation(b bool) *UpdateOn return uo } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For -// previous server versions, the driver will return an error if this option is used. The default -// value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (uo *UpdateOneOptionsBuilder) SetCollation(c *Collation) *UpdateOneOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateOneOptions) error { opts.Collation = c @@ -94,13 +92,14 @@ func (uo *UpdateOneOptionsBuilder) SetComment(comment interface{}) *UpdateOneOpt return uo } -// SetHint sets the value for the Hint field. Specifies the index to use for the operation. This -// should either be the index name as a string or the index specification as a document. This -// option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will return an error -// if this option is specified. For server versions < 3.4, the driver will return a client-side -// error if this option is specified. The driver will return an error if this option is specified -// during an unacknowledged write operation. The driver will return an error if the hint parameter -// is a multi-key map. The default value is nil, which means that no hint will be sent. +// SetHint sets the value for the Hint field. Specifies the index to use for the +// operation. This should either be the index name as a string or the index +// specification as a document. This option is only valid for MongoDB versions +// >= 4.2. Server versions < 4.2 will return an error if this option is +// specified. The driver will return an error if this option is specified during +// an unacknowledged write operation. The driver will return an error if the +// hint parameter is a multi-key map. The default value is nil, which means that +// no hint will be sent. func (uo *UpdateOneOptionsBuilder) SetHint(h interface{}) *UpdateOneOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateOneOptions) error { opts.Hint = h @@ -184,10 +183,10 @@ func (uo *UpdateManyOptionsBuilder) List() []func(*UpdateManyOptions) error { return uo.Opts } -// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a set of filters -// specifying to which array elements an update should apply. This option is only valid for MongoDB -// versions >= 3.6. For previous server versions, the driver will return an error if this option is -// used. The default value is nil, which means the update will apply to all array elements. +// SetArrayFilters sets the value for the ArrayFilters field. ArrayFilters is a +// set of filters specifying to which array elements an update should apply. The +// default value is nil, which means the update will apply to all array +// elements. func (uo *UpdateManyOptionsBuilder) SetArrayFilters(af []interface{}) *UpdateManyOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateManyOptions) error { opts.ArrayFilters = af @@ -200,7 +199,6 @@ func (uo *UpdateManyOptionsBuilder) SetArrayFilters(af []interface{}) *UpdateMan // SetBypassDocumentValidation sets the value for the BypassDocumentValidation field. If true, // writes executed as part of the operation will opt out of document-level validation on the server. -// This option is valid for MongoDB versions >= 3.2 and is ignored for previous server versions. // The default value is false. See https://www.mongodb.com/docs/manual/core/schema-validation/ for // more information about document validation. func (uo *UpdateManyOptionsBuilder) SetBypassDocumentValidation(b bool) *UpdateManyOptionsBuilder { @@ -213,10 +211,9 @@ func (uo *UpdateManyOptionsBuilder) SetBypassDocumentValidation(b bool) *UpdateM return uo } -// SetCollation sets the value for the Collation field. Specifies a collation to use for string -// comparisons during the operation. This option is only valid for MongoDB versions >= 3.4. For -// previous server versions, the driver will return an error if this option is used. The default -// value is nil, which means the default collation of the collection will be used. +// SetCollation sets the value for the Collation field. Specifies a collation to +// use for string comparisons during the operation. The default value is nil, +// which means the default collation of the collection will be used. func (uo *UpdateManyOptionsBuilder) SetCollation(c *Collation) *UpdateManyOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateManyOptions) error { opts.Collation = c @@ -240,13 +237,14 @@ func (uo *UpdateManyOptionsBuilder) SetComment(comment interface{}) *UpdateManyO return uo } -// SetHint sets the value for the Hint field. Specifies the index to use for the operation. This -// should either be the index name as a string or the index specification as a document. This -// option is only valid for MongoDB versions >= 4.2. Server versions >= 3.4 will return an error -// if this option is specified. For server versions < 3.4, the driver will return a client-side -// error if this option is specified. The driver will return an error if this option is specified -// during an unacknowledged write operation. The driver will return an error if the hint parameter -// is a multi-key map. The default value is nil, which means that no hint will be sent. +// SetHint sets the value for the Hint field. Specifies the index to use for the +// operation. This should either be the index name as a string or the index +// specification as a document. This option is only valid for MongoDB versions +// >= 4.2. Server versions < 4.2 will return an error if this option is +// specified. The driver will return an error if this option is specified during +// an unacknowledged write operation. The driver will return an error if the +// hint parameter is a multi-key map. The default value is nil, which means that +// no hint will be sent. func (uo *UpdateManyOptionsBuilder) SetHint(h interface{}) *UpdateManyOptionsBuilder { uo.Opts = append(uo.Opts, func(opts *UpdateManyOptions) error { opts.Hint = h diff --git a/mongo/results.go b/mongo/results.go index d8407ef5c0..0a10dbaffe 100644 --- a/mongo/results.go +++ b/mongo/results.go @@ -220,11 +220,10 @@ type CollectionSpecification struct { // The type of the collection. This will either be "collection" or "view". Type string - // Whether or not the collection is readOnly. This will be false for MongoDB versions < 3.4. + // Whether or not the collection is readOnly. ReadOnly bool - // The collection UUID. This field will be nil for MongoDB versions < 3.6. For versions 3.6 and higher, this will - // be a bson.Binary with Subtype 4. + // The collection UUID as a bson.Binary with subtype 4. UUID *bson.Binary // A document containing the options used to construct the collection. diff --git a/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.json b/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.json index caf31b3391..097203694e 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.json +++ b/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 4 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.yml b/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.yml index 0ad4462b9c..1de96154cc 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/discovered_standalone.yml @@ -5,7 +5,7 @@ phases: responses: - - "a:27017" - - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 4 } + - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 21 } outcome: events: diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.json b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.json index 950e32efe1..41d048729d 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.json +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.json @@ -19,7 +19,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.yml b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.yml index 6bb40e9bdf..e5ca9cd90d 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_no_primary.yml @@ -17,7 +17,7 @@ phases: - "a:27017" - "b:27017" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: events: - @@ -110,4 +110,3 @@ phases: hosts: [] passives: [] type: "PossiblePrimary" - diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.json b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.json index 2ad94d6e6a..3ccc127d1d 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.json +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.json @@ -18,7 +18,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.yml b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.yml index 8855585ca5..256895bb28 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_primary.yml @@ -16,7 +16,7 @@ phases: - "a:27017" - "b:27017" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: events: - @@ -109,4 +109,3 @@ phases: hosts: [] passives: [] type: "Unknown" - diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.json b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.json index ae28faa30c..dc6fbe7e7d 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.json +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.json @@ -69,7 +69,7 @@ "a:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.yml b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.yml index 2471f47680..25c006861a 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/replica_set_with_removal.yml @@ -50,7 +50,7 @@ phases: primary: "a:27017", hosts: [ "a:27017" ], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 } - - "b:27017" diff --git a/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.json b/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.json index 401c5d99c5..1f4e5c1d71 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.json +++ b/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.json @@ -18,7 +18,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.yml b/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.yml index 7a060128f3..69d0500de1 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/required_replica_set.yml @@ -14,7 +14,7 @@ phases: primary: "a:27017", hosts: [ "a:27017", "b:27017" ], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 } outcome: events: diff --git a/testdata/server-discovery-and-monitoring/monitoring/standalone.json b/testdata/server-discovery-and-monitoring/monitoring/standalone.json index 821a1525d4..f375a383ca 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/standalone.json +++ b/testdata/server-discovery-and-monitoring/monitoring/standalone.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/standalone.yml b/testdata/server-discovery-and-monitoring/monitoring/standalone.yml index d9f6bcfaf3..0c3ed64601 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/standalone.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/standalone.yml @@ -5,7 +5,7 @@ phases: responses: - - "a:27017" - - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 6 } + - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 21 } outcome: events: diff --git a/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.json b/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.json index 5958e2d26c..4d046ff8ed 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.json +++ b/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -21,7 +21,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.yml b/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.yml index 00c2e770b9..255ec2dd43 100644 --- a/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.yml +++ b/testdata/server-discovery-and-monitoring/monitoring/standalone_suppress_equal_description_changes.yml @@ -5,10 +5,10 @@ phases: responses: - - "a:27017" - - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 4 } + - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 21 } - - "a:27017" - - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 4 } + - { ok: 1, helloOk: true, isWritablePrimary: true, minWireVersion: 0, maxWireVersion: 21 } outcome: events: diff --git a/testdata/server-discovery-and-monitoring/rs/compatible.json b/testdata/server-discovery-and-monitoring/rs/compatible.json index 444b13e9d5..dfd5d57dfa 100644 --- a/testdata/server-discovery-and-monitoring/rs/compatible.json +++ b/testdata/server-discovery-and-monitoring/rs/compatible.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/rs/compatible.yml b/testdata/server-discovery-and-monitoring/rs/compatible.yml index 8b5d9f456a..ce17d7e302 100644 --- a/testdata/server-discovery-and-monitoring/rs/compatible.yml +++ b/testdata/server-discovery-and-monitoring/rs/compatible.yml @@ -12,7 +12,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, diff --git a/testdata/server-discovery-and-monitoring/rs/compatible_unknown.json b/testdata/server-discovery-and-monitoring/rs/compatible_unknown.json index cf92dd1ed3..95e03ea958 100644 --- a/testdata/server-discovery-and-monitoring/rs/compatible_unknown.json +++ b/testdata/server-discovery-and-monitoring/rs/compatible_unknown.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/compatible_unknown.yml b/testdata/server-discovery-and-monitoring/rs/compatible_unknown.yml index 643e849819..ed97ab31ac 100644 --- a/testdata/server-discovery-and-monitoring/rs/compatible_unknown.yml +++ b/testdata/server-discovery-and-monitoring/rs/compatible_unknown.yml @@ -12,7 +12,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/discover_arbiters.json b/testdata/server-discovery-and-monitoring/rs/discover_arbiters.json index 53709b0cee..803462b156 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_arbiters.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_arbiters.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_arbiters.yml b/testdata/server-discovery-and-monitoring/rs/discover_arbiters.yml index 67d29eadb5..5334bc8241 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_arbiters.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_arbiters.yml @@ -16,7 +16,7 @@ phases: [ arbiters: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json index 64fb49f4fc..e58d7c7fb4 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.yml index c7edb52b01..882dbb0f89 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.yml @@ -16,7 +16,7 @@ phases: [ arbiters: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_ghost.json b/testdata/server-discovery-and-monitoring/rs/discover_ghost.json index 2e24c83e0b..3b7fc836ec 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_ghost.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_ghost.json @@ -12,7 +12,7 @@ "isWritablePrimary": false, "isreplicaset": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_ghost.yml b/testdata/server-discovery-and-monitoring/rs/discover_ghost.yml index e613f684b4..7a9cbd5559 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_ghost.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_ghost.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: false, isreplicaset: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json index cf5fe83a54..1a8457983b 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json @@ -12,7 +12,7 @@ "isWritablePrimary": false, "isreplicaset": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.yml index 75ec3e64a9..61ba1eab56 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_ghost_replicaset.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: false, isreplicaset: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_hidden.json b/testdata/server-discovery-and-monitoring/rs/discover_hidden.json index e4a90f1f9c..10bd51edeb 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_hidden.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_hidden.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_hidden.yml b/testdata/server-discovery-and-monitoring/rs/discover_hidden.yml index 64ed1d82b9..f483255802 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_hidden.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_hidden.yml @@ -17,7 +17,7 @@ phases: [ hosts: ["c:27017", "d:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json index 04420596f0..63cf558675 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.yml index 614a39d482..8d496544d2 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_hidden_replicaset.yml @@ -17,7 +17,7 @@ phases: [ hosts: ["c:27017", "d:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_passives.json b/testdata/server-discovery-and-monitoring/rs/discover_passives.json index 30258409f6..0a292c675c 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_passives.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_passives.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -56,7 +56,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_passives.yml b/testdata/server-discovery-and-monitoring/rs/discover_passives.yml index 637d86d7f1..25419733cf 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_passives.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_passives.yml @@ -16,7 +16,7 @@ phases: [ passives: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -55,7 +55,7 @@ phases: [ passives: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.json index 266eaa5234..c48fd47625 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -56,7 +56,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.yml index a5ced995d3..d981280a2f 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_passives_replicaset.yml @@ -16,7 +16,7 @@ phases: [ passives: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -55,7 +55,7 @@ phases: [ passives: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_primary.json b/testdata/server-discovery-and-monitoring/rs/discover_primary.json index 2d1292bbd4..04e7a4984c 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_primary.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_primary.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_primary.yml b/testdata/server-discovery-and-monitoring/rs/discover_primary.yml index eaedf130ba..3c11e3e4f2 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_primary.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_primary.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.json index 54dfefba5f..3cdcfdcee2 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.yml index 7879701bb2..47831fa60a 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_primary_replicaset.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_rsother.json b/testdata/server-discovery-and-monitoring/rs/discover_rsother.json index 4ab25667f0..9c3b8d8b7d 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_rsother.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_rsother.json @@ -17,7 +17,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_rsother.yml b/testdata/server-discovery-and-monitoring/rs/discover_rsother.yml index d78e70c5d7..11c65863f4 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_rsother.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_rsother.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["c:27017", "d:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json index e3958d70ad..3da9efb066 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -34,7 +34,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.yml index 19159d1efe..c25d33ab2b 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_rsother_replicaset.yml @@ -17,7 +17,7 @@ phases: [ hosts: ["c:27017", "d:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -28,7 +28,7 @@ phases: [ hosts: ["c:27017", "d:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_secondary.json b/testdata/server-discovery-and-monitoring/rs/discover_secondary.json index 22325d4e03..64a1ce31e3 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_secondary.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_secondary.json @@ -17,7 +17,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_secondary.yml b/testdata/server-discovery-and-monitoring/rs/discover_secondary.yml index 184849d3ff..83af822eda 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_secondary.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_secondary.yml @@ -16,7 +16,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json b/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json index d903b6444d..d230f976a2 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json +++ b/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json @@ -17,7 +17,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.yml b/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.yml index c73a535f69..71229387cc 100644 --- a/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/rs/discover_secondary_replicaset.yml @@ -16,7 +16,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discovery.json b/testdata/server-discovery-and-monitoring/rs/discovery.json index 50e1269223..e9deaa7587 100644 --- a/testdata/server-discovery-and-monitoring/rs/discovery.json +++ b/testdata/server-discovery-and-monitoring/rs/discovery.json @@ -18,7 +18,7 @@ "c:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -59,7 +59,7 @@ "d:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -103,7 +103,7 @@ "e:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -147,7 +147,7 @@ "c:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/discovery.yml b/testdata/server-discovery-and-monitoring/rs/discovery.yml index 30c82e0cef..19be04897b 100644 --- a/testdata/server-discovery-and-monitoring/rs/discovery.yml +++ b/testdata/server-discovery-and-monitoring/rs/discovery.yml @@ -17,7 +17,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017", "c:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -63,7 +63,7 @@ phases: [ primary: "d:27017", hosts: ["b:27017", "c:27017", "d:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -113,7 +113,7 @@ phases: [ setName: "rs", hosts: ["b:27017", "c:27017", "d:27017", "e:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -165,7 +165,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017", "c:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/equal_electionids.json b/testdata/server-discovery-and-monitoring/rs/equal_electionids.json index 17df3207fa..f1deedf9f4 100644 --- a/testdata/server-discovery-and-monitoring/rs/equal_electionids.json +++ b/testdata/server-discovery-and-monitoring/rs/equal_electionids.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -39,7 +39,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/equal_electionids.yml b/testdata/server-discovery-and-monitoring/rs/equal_electionids.yml index 48bb683d64..17e8aa2c11 100644 --- a/testdata/server-discovery-and-monitoring/rs/equal_electionids.yml +++ b/testdata/server-discovery-and-monitoring/rs/equal_electionids.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, @@ -27,7 +27,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json b/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json index 4e02304c61..085e81e266 100644 --- a/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json +++ b/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json @@ -15,7 +15,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.yml b/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.yml index e97fbca05b..2ecd27ec7c 100644 --- a/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.yml +++ b/testdata/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.json b/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.json index f0539cb337..bda18d9f6f 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.json +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.yml b/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.yml index e4928f191d..2e46ff2951 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.yml +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_arbiter.yml @@ -12,7 +12,7 @@ phases: setName: "rs" hosts: ["a:27017", "b:27017"] minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 - - "b:27017" - ok: 1 diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.json b/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.json index 824e953f90..9d82e31682 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.json +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.yml b/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.yml index da1db790fe..c99badf4a3 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.yml +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_ghost.yml @@ -12,7 +12,7 @@ phases: setName: "rs" hosts: ["a:27017", "b:27017"] minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 - - "b:27017" - ok: 1 diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_other.json b/testdata/server-discovery-and-monitoring/rs/incompatible_other.json index 6f301ef5de..149ba01142 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_other.json +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_other.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/rs/incompatible_other.yml b/testdata/server-discovery-and-monitoring/rs/incompatible_other.yml index 98061c0a1f..16452e7b02 100644 --- a/testdata/server-discovery-and-monitoring/rs/incompatible_other.yml +++ b/testdata/server-discovery-and-monitoring/rs/incompatible_other.yml @@ -12,7 +12,7 @@ phases: setName: "rs" hosts: ["a:27017", "b:27017"] minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 - - "b:27017" - ok: 1 diff --git a/testdata/server-discovery-and-monitoring/rs/ls_timeout.json b/testdata/server-discovery-and-monitoring/rs/ls_timeout.json index 96389d3b76..c68790ddfd 100644 --- a/testdata/server-discovery-and-monitoring/rs/ls_timeout.json +++ b/testdata/server-discovery-and-monitoring/rs/ls_timeout.json @@ -20,7 +20,7 @@ "setName": "rs", "logicalSessionTimeoutMinutes": 3, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -58,7 +58,7 @@ "isWritablePrimary": false, "isreplicaset": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -104,7 +104,7 @@ "setName": "rs", "arbiterOnly": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -152,7 +152,7 @@ "setName": "rs", "logicalSessionTimeoutMinutes": 2, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -194,7 +194,7 @@ "hidden": true, "logicalSessionTimeoutMinutes": 1, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -244,7 +244,7 @@ "setName": "rs", "logicalSessionTimeoutMinutes": null, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/ls_timeout.yml b/testdata/server-discovery-and-monitoring/rs/ls_timeout.yml index 26679f339e..2cea00e99e 100644 --- a/testdata/server-discovery-and-monitoring/rs/ls_timeout.yml +++ b/testdata/server-discovery-and-monitoring/rs/ls_timeout.yml @@ -14,7 +14,7 @@ phases: [ setName: "rs", logicalSessionTimeoutMinutes: 3, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], outcome: { @@ -51,7 +51,7 @@ phases: [ isWritablePrimary: false, isreplicaset: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], outcome: { @@ -90,7 +90,7 @@ phases: [ setName: "rs", arbiterOnly: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { @@ -131,7 +131,7 @@ phases: [ setName: "rs", logicalSessionTimeoutMinutes: 2, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], outcome: { @@ -172,7 +172,7 @@ phases: [ hidden: true, logicalSessionTimeoutMinutes: 1, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], outcome: { @@ -214,7 +214,7 @@ phases: [ setName: "rs", logicalSessionTimeoutMinutes: null, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/member_reconfig.json b/testdata/server-discovery-and-monitoring/rs/member_reconfig.json index 0e2c2c462e..a05fed0efb 100644 --- a/testdata/server-discovery-and-monitoring/rs/member_reconfig.json +++ b/testdata/server-discovery-and-monitoring/rs/member_reconfig.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -49,7 +49,7 @@ "a:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/member_reconfig.yml b/testdata/server-discovery-and-monitoring/rs/member_reconfig.yml index 37e63bc059..a43a88d53f 100644 --- a/testdata/server-discovery-and-monitoring/rs/member_reconfig.yml +++ b/testdata/server-discovery-and-monitoring/rs/member_reconfig.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -52,7 +52,7 @@ phases: [ setName: "rs", hosts: ["a:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/member_standalone.json b/testdata/server-discovery-and-monitoring/rs/member_standalone.json index 0756003a89..db100db9f3 100644 --- a/testdata/server-discovery-and-monitoring/rs/member_standalone.json +++ b/testdata/server-discovery-and-monitoring/rs/member_standalone.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -40,7 +40,7 @@ "a:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/member_standalone.yml b/testdata/server-discovery-and-monitoring/rs/member_standalone.yml index 50c0056650..1be000ea4e 100644 --- a/testdata/server-discovery-and-monitoring/rs/member_standalone.yml +++ b/testdata/server-discovery-and-monitoring/rs/member_standalone.yml @@ -13,7 +13,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -44,7 +44,7 @@ phases: [ setName: "rs", hosts: ["a:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary.json b/testdata/server-discovery-and-monitoring/rs/new_primary.json index ed1a6245f9..1a84c69c91 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary.json +++ b/testdata/server-discovery-and-monitoring/rs/new_primary.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -50,7 +50,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary.yml b/testdata/server-discovery-and-monitoring/rs/new_primary.yml index 736dd06c5f..f2485a1863 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary.yml +++ b/testdata/server-discovery-and-monitoring/rs/new_primary.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -52,7 +52,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.json b/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.json index ccb3a41f75..509720d445 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.json +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -67,7 +67,7 @@ "$oid": "000000000000000000000002" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -114,7 +114,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.yml b/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.yml index dfebbd8561..5641cfda95 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.yml +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_new_electionid.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -54,7 +54,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000002"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -92,7 +92,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.json b/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.json index 415a0f66aa..96533c61ee 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.json +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -67,7 +67,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -114,7 +114,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.yml b/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.yml index 3ebc798b61..f269797112 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.yml +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_new_setversion.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -54,7 +54,7 @@ phases: [ setVersion: 2, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -92,7 +92,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json b/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json index d7b19cfe8f..774b3a5736 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json @@ -16,7 +16,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -49,7 +49,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.yml b/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.yml index ca6303cda9..dc6df9cd8b 100644 --- a/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -55,7 +55,7 @@ phases: [ hosts: ["a:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/non_rs_member.json b/testdata/server-discovery-and-monitoring/rs/non_rs_member.json index 538077ef09..6bf10bd628 100644 --- a/testdata/server-discovery-and-monitoring/rs/non_rs_member.json +++ b/testdata/server-discovery-and-monitoring/rs/non_rs_member.json @@ -10,7 +10,7 @@ "ok": 1, "helloOk": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/non_rs_member.yml b/testdata/server-discovery-and-monitoring/rs/non_rs_member.yml index c18b27ee3f..4e2f0b1be2 100644 --- a/testdata/server-discovery-and-monitoring/rs/non_rs_member.yml +++ b/testdata/server-discovery-and-monitoring/rs/non_rs_member.yml @@ -11,7 +11,7 @@ phases: [ ok: 1, helloOk: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/normalize_case.json b/testdata/server-discovery-and-monitoring/rs/normalize_case.json index 96a944f0c3..62915495e0 100644 --- a/testdata/server-discovery-and-monitoring/rs/normalize_case.json +++ b/testdata/server-discovery-and-monitoring/rs/normalize_case.json @@ -21,7 +21,7 @@ "C:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/normalize_case.yml b/testdata/server-discovery-and-monitoring/rs/normalize_case.yml index d8003ee375..a543ab72af 100644 --- a/testdata/server-discovery-and-monitoring/rs/normalize_case.yml +++ b/testdata/server-discovery-and-monitoring/rs/normalize_case.yml @@ -17,7 +17,7 @@ phases: [ passives: ["B:27017"], arbiters: ["C:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/normalize_case_me.json b/testdata/server-discovery-and-monitoring/rs/normalize_case_me.json index ab1720cefc..0d9ba6213e 100644 --- a/testdata/server-discovery-and-monitoring/rs/normalize_case_me.json +++ b/testdata/server-discovery-and-monitoring/rs/normalize_case_me.json @@ -22,7 +22,7 @@ "C:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -67,7 +67,7 @@ "C:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/normalize_case_me.yml b/testdata/server-discovery-and-monitoring/rs/normalize_case_me.yml index a0df3351a5..03ac43f314 100644 --- a/testdata/server-discovery-and-monitoring/rs/normalize_case_me.yml +++ b/testdata/server-discovery-and-monitoring/rs/normalize_case_me.yml @@ -18,7 +18,7 @@ phases: [ passives: ["B:27017"], arbiters: ["C:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -66,7 +66,7 @@ phases: [ passives: ["B:27017"], arbiters: ["C:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json b/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json index f1fa2e252e..9e7ccc6e7f 100644 --- a/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json +++ b/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json @@ -18,7 +18,7 @@ "setVersion": 1, "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], @@ -66,7 +66,7 @@ "$oid": "000000000000000000000002" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -116,7 +116,7 @@ "setVersion": 1, "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], @@ -167,7 +167,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.yml b/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.yml index 7e9bd55021..63f9699f22 100644 --- a/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.yml +++ b/testdata/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.yml @@ -15,7 +15,7 @@ phases: [ setVersion: 1, setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], @@ -57,7 +57,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000002"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], @@ -99,7 +99,7 @@ phases: [ setVersion: 1, setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], outcome: { @@ -142,7 +142,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.json b/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.json index 9c54b39856..e34280e88c 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -41,7 +41,7 @@ "isWritablePrimary": false, "isreplicaset": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.yml b/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.yml index dbf5b9289d..ee0158db0d 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_ghost.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -43,7 +43,7 @@ phases: [ isWritablePrimary: false, isreplicaset: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.json b/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.json index ac416e57d5..79510d9399 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -41,7 +41,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.yml b/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.yml index 6cdb077106..251f155277 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_mongos.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -43,7 +43,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.json b/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.json index a64524d0ca..abcc1e2d01 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -38,7 +38,7 @@ { "ok": 1, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.yml b/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.yml index abcc7fcfe3..9f6a0817bf 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_becomes_standalone.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -40,7 +40,7 @@ phases: [ ["a:27017", { ok: 1, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.json b/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.json index bf70ca3014..3b564d2c93 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -44,7 +44,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.yml b/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.yml index 00ed1c0a13..e49aa24911 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_changes_set_name.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -48,7 +48,7 @@ phases: [ hosts: ["a:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect.json b/testdata/server-discovery-and-monitoring/rs/primary_disconnect.json index 3db854f085..73a01a82a9 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect.yml b/testdata/server-discovery-and-monitoring/rs/primary_disconnect.yml index 9a49656549..84c88daa67 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json index 3a80b150fe..5a91188ea8 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -39,7 +39,7 @@ "$oid": "000000000000000000000002" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -115,7 +115,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -159,7 +159,7 @@ "$oid": "000000000000000000000003" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -203,7 +203,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.yml b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.yml index 0d7d294f97..391ec31213 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_electionid.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, @@ -27,7 +27,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000002"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -91,7 +91,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { @@ -127,7 +127,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000003"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { @@ -163,7 +163,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json index 32e03fb7d4..f7417ad77b 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -39,7 +39,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -115,7 +115,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -159,7 +159,7 @@ "$oid": "000000000000000000000002" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -203,7 +203,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.yml b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.yml index 41f2f8d7b7..57eeb573e4 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, @@ -27,7 +27,7 @@ phases: [ setVersion: 2, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -91,7 +91,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { @@ -127,7 +127,7 @@ phases: [ setVersion: 2, electionId: {"$oid": "000000000000000000000002"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { @@ -163,7 +163,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json b/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json index bc02cc9571..1ca72225a2 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json @@ -18,7 +18,7 @@ "setName": "rs", "primary": "b:27017", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -48,7 +48,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.yml b/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.yml index f5b536c01f..cebbe7d083 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.yml @@ -17,7 +17,7 @@ phases: [ setName: "rs", primary: "b:27017", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -45,7 +45,7 @@ phases: [ hosts: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.json b/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.json index 2d2c0f40d8..6bb6226f8a 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.json @@ -31,7 +31,7 @@ "ok": 1, "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ] diff --git a/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.yml b/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.yml index c24fd1a990..25ca1722e0 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_mismatched_me.yml @@ -22,6 +22,6 @@ phases: ok: 1 setName: rs minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 uri: 'mongodb://localhost:27017/?replicaSet=rs' diff --git a/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.json b/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.json index ac0d9374f0..ed28c48c87 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.json @@ -17,7 +17,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -51,7 +51,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -86,7 +86,7 @@ "c:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -127,7 +127,7 @@ "c:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.yml b/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.yml index de3f528fe9..aa2878d637 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_reports_new_member.yml @@ -17,7 +17,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -55,7 +55,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -93,7 +93,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017", "c:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -140,7 +140,7 @@ phases: [ primary: "b:27017", hosts: ["a:27017", "b:27017", "c:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json b/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json index 6dbd73dadc..798a648d19 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json @@ -17,7 +17,7 @@ "me": "a:27017", "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -52,7 +52,7 @@ "me": "c:27017", "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.yml b/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.yml index a78982c28e..e8bdb00f0f 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.yml @@ -16,7 +16,7 @@ phases: [ me: "a:27017", setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -53,7 +53,7 @@ phases: [ me : "c:27017", setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.json b/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.json index cc0691fb8c..1366e38996 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.json @@ -15,7 +15,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.yml b/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.yml index d4434522a9..3e463333e6 100644 --- a/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/primary_wrong_set_name.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/repeated.json b/testdata/server-discovery-and-monitoring/rs/repeated.json index 610aeae0ac..3ce0948ab8 100644 --- a/testdata/server-discovery-and-monitoring/rs/repeated.json +++ b/testdata/server-discovery-and-monitoring/rs/repeated.json @@ -18,7 +18,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -49,7 +49,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -84,7 +84,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -120,7 +120,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/repeated.yml b/testdata/server-discovery-and-monitoring/rs/repeated.yml index f651005bab..b9e14ed982 100644 --- a/testdata/server-discovery-and-monitoring/rs/repeated.yml +++ b/testdata/server-discovery-and-monitoring/rs/repeated.yml @@ -15,7 +15,7 @@ phases: hosts: ["a:27017", "c:27017"] setName: "rs" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: "a:27017": @@ -39,7 +39,7 @@ phases: helloOk: true isWritablePrimary: true minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: "a:27017": @@ -64,7 +64,7 @@ phases: hosts: ["a:27017", "c:27017"] setName: "rs" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: "a:27017": @@ -90,7 +90,7 @@ phases: hosts: ["a:27017", "c:27017"] setName: "rs" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: "a:27017": diff --git a/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.json b/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.json index 3148e1c141..1cd732b82f 100644 --- a/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.json +++ b/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.yml b/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.yml index 87e80bdb31..6bdf8cbe2d 100644 --- a/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.yml +++ b/testdata/server-discovery-and-monitoring/rs/replicaset_rsnp.yml @@ -11,7 +11,7 @@ phases: helloOk: true isWritablePrimary: true minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: # Server is removed because it's a standalone and the driver # started in RSNP topology diff --git a/testdata/server-discovery-and-monitoring/rs/response_from_removed.json b/testdata/server-discovery-and-monitoring/rs/response_from_removed.json index 87a66d9e72..fa46a14ceb 100644 --- a/testdata/server-discovery-and-monitoring/rs/response_from_removed.json +++ b/testdata/server-discovery-and-monitoring/rs/response_from_removed.json @@ -15,7 +15,7 @@ "a:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -46,7 +46,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/response_from_removed.yml b/testdata/server-discovery-and-monitoring/rs/response_from_removed.yml index 6ec66c8750..fc9961ce36 100644 --- a/testdata/server-discovery-and-monitoring/rs/response_from_removed.yml +++ b/testdata/server-discovery-and-monitoring/rs/response_from_removed.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -47,7 +47,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/sec_not_auth.json b/testdata/server-discovery-and-monitoring/rs/sec_not_auth.json index a39855e654..ccbe7a08af 100644 --- a/testdata/server-discovery-and-monitoring/rs/sec_not_auth.json +++ b/testdata/server-discovery-and-monitoring/rs/sec_not_auth.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -32,7 +32,7 @@ "c:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/sec_not_auth.yml b/testdata/server-discovery-and-monitoring/rs/sec_not_auth.yml index 09c75f9c78..507eb9d292 100644 --- a/testdata/server-discovery-and-monitoring/rs/sec_not_auth.yml +++ b/testdata/server-discovery-and-monitoring/rs/sec_not_auth.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -27,7 +27,7 @@ phases: [ setName: "rs", hosts: ["b:27017", "c:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json index 054425c84c..f27060533c 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json +++ b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -32,7 +32,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -59,7 +59,7 @@ { "ok": 0, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.yml b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.yml index de9048d401..b63c43f227 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.yml +++ b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -26,7 +26,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -59,7 +59,7 @@ phases: [ ok: 0, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json index 4c1cb011a5..9ffff58ef0 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json +++ b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json @@ -1,5 +1,5 @@ { - "description": "New primary", + "description": "Secondary ignored when ok is zero", "uri": "mongodb://a,b/?replicaSet=rs", "phases": [ { @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -32,7 +32,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -59,7 +59,7 @@ { "ok": 0, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.yml b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.yml index c7e605d662..796e7f668e 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.yml +++ b/testdata/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.yml @@ -1,4 +1,4 @@ -description: "New primary" +description: "Secondary ignored when ok is zero" uri: "mongodb://a,b/?replicaSet=rs" @@ -15,7 +15,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -26,7 +26,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -59,7 +59,7 @@ phases: [ ok: 0, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.json b/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.json index 6f1b9b5986..790e4bfca8 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.json +++ b/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.json @@ -32,7 +32,7 @@ "ok": 1, "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ] diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.yml b/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.yml index e5f0f9aceb..d359609d83 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.yml +++ b/testdata/server-discovery-and-monitoring/rs/secondary_mismatched_me.yml @@ -25,4 +25,4 @@ phases: ok: 1 setName: rs minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json index 8d2f152f59..1f86b50543 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json @@ -16,7 +16,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.yml b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.yml index 0121d631ce..60823815f0 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json index b7ef2d6d6a..6b89914151 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json +++ b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json @@ -16,7 +16,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -51,7 +51,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.yml b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.yml index acd471e78b..8d1990363c 100644 --- a/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.yml +++ b/testdata/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -53,7 +53,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json b/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json index c2e2fe5b9b..e62c6963ed 100644 --- a/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json +++ b/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json @@ -17,7 +17,7 @@ "setName": "rs", "setVersion": 2, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], @@ -56,7 +56,7 @@ "setName": "rs", "setVersion": 1, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.yml b/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.yml index 54bfa4d256..0fe6819aa7 100644 --- a/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.yml +++ b/testdata/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.yml @@ -15,7 +15,7 @@ phases: [ setName: "rs", setVersion: 2, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], @@ -52,7 +52,7 @@ phases: [ setName: "rs", setVersion: 1, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.json b/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.json index e9075f97f2..6de995518d 100644 --- a/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -45,7 +45,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.yml b/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.yml index 9c4140925d..2e1c1a551e 100644 --- a/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/stepdown_change_set_name.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -50,7 +50,7 @@ phases: [ hosts: ["a:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/too_new.json b/testdata/server-discovery-and-monitoring/rs/too_new.json index 0433d27a36..696246f8e1 100644 --- a/testdata/server-discovery-and-monitoring/rs/too_new.json +++ b/testdata/server-discovery-and-monitoring/rs/too_new.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/rs/too_new.yml b/testdata/server-discovery-and-monitoring/rs/too_new.yml index 52912826be..121286554e 100644 --- a/testdata/server-discovery-and-monitoring/rs/too_new.yml +++ b/testdata/server-discovery-and-monitoring/rs/too_new.yml @@ -12,7 +12,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, diff --git a/testdata/server-discovery-and-monitoring/rs/too_old.json b/testdata/server-discovery-and-monitoring/rs/too_old.json index c572b36680..8100a663f5 100644 --- a/testdata/server-discovery-and-monitoring/rs/too_old.json +++ b/testdata/server-discovery-and-monitoring/rs/too_old.json @@ -16,7 +16,7 @@ "b:27017" ], "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -30,9 +30,7 @@ "hosts": [ "a:27017", "b:27017" - ], - "minWireVersion": 999, - "maxWireVersion": 1000 + ] } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/too_old.yml b/testdata/server-discovery-and-monitoring/rs/too_old.yml index 6235ac8d6d..1fe611fbb9 100644 --- a/testdata/server-discovery-and-monitoring/rs/too_old.yml +++ b/testdata/server-discovery-and-monitoring/rs/too_old.yml @@ -10,7 +10,7 @@ phases: [ setName: "rs", hosts: ["a:27017", "b:27017"], minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, @@ -18,9 +18,7 @@ phases: [ isWritablePrimary: false, secondary: true, setName: "rs", - hosts: ["a:27017", "b:27017"], - minWireVersion: 999, - maxWireVersion: 1000 + hosts: ["a:27017", "b:27017"] }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.json b/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.json index cc19a961f2..c6ffb321ca 100644 --- a/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.json +++ b/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.yml b/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.yml index d0d8547f96..a9c5a24ee6 100644 --- a/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.yml +++ b/testdata/server-discovery-and-monitoring/rs/unexpected_mongos.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json b/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json index 5c58b65614..2f9b567b85 100644 --- a/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json +++ b/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json @@ -20,7 +20,7 @@ "$oid": "000000000000000000000001" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], @@ -64,7 +64,7 @@ "setName": "rs", "setVersion": 2, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], @@ -108,7 +108,7 @@ "$oid": "000000000000000000000002" }, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 7 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.yml b/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.yml index a0434eb45c..24d6accbe0 100644 --- a/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.yml +++ b/testdata/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.yml @@ -16,7 +16,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000001"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], @@ -53,7 +53,7 @@ phases: [ setName: "rs", setVersion: 2, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], @@ -91,7 +91,7 @@ phases: [ setVersion: 1, electionId: {"$oid": "000000000000000000000002"}, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 7 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/rs/wrong_set_name.json b/testdata/server-discovery-and-monitoring/rs/wrong_set_name.json index 9654ff7b79..d0764d24dc 100644 --- a/testdata/server-discovery-and-monitoring/rs/wrong_set_name.json +++ b/testdata/server-discovery-and-monitoring/rs/wrong_set_name.json @@ -17,7 +17,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/rs/wrong_set_name.yml b/testdata/server-discovery-and-monitoring/rs/wrong_set_name.yml index ae75d6f7e4..e7d3ace92d 100644 --- a/testdata/server-discovery-and-monitoring/rs/wrong_set_name.yml +++ b/testdata/server-discovery-and-monitoring/rs/wrong_set_name.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["b:27017", "c:27017"], setName: "wrong", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/compatible.json b/testdata/server-discovery-and-monitoring/sharded/compatible.json index e531db97f9..ceb0ec24c4 100644 --- a/testdata/server-discovery-and-monitoring/sharded/compatible.json +++ b/testdata/server-discovery-and-monitoring/sharded/compatible.json @@ -23,7 +23,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/compatible.yml b/testdata/server-discovery-and-monitoring/sharded/compatible.yml index 06d5182a5c..20519089f5 100644 --- a/testdata/server-discovery-and-monitoring/sharded/compatible.yml +++ b/testdata/server-discovery-and-monitoring/sharded/compatible.yml @@ -17,7 +17,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.json b/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.json index 9e877a0840..bf7e57521c 100644 --- a/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.json +++ b/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.yml b/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.yml index f44a2970dd..1e8adc6c5c 100644 --- a/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.yml +++ b/testdata/server-discovery-and-monitoring/sharded/discover_single_mongos.yml @@ -13,7 +13,7 @@ phases: isWritablePrimary: true msg: "isdbgrid" minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: diff --git a/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json b/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json index 93fa398d52..3da0f84ca2 100644 --- a/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json +++ b/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json @@ -13,7 +13,7 @@ "msg": "isdbgrid", "logicalSessionTimeoutMinutes": 1, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -25,7 +25,7 @@ "msg": "isdbgrid", "logicalSessionTimeoutMinutes": 2, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -56,7 +56,7 @@ "msg": "isdbgrid", "logicalSessionTimeoutMinutes": 1, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -67,7 +67,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.yml b/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.yml index 7f78d0d6c6..62ae97f057 100644 --- a/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.yml +++ b/testdata/server-discovery-and-monitoring/sharded/ls_timeout_mongos.yml @@ -15,7 +15,7 @@ phases: [ msg: "isdbgrid", logicalSessionTimeoutMinutes: 1, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -26,7 +26,7 @@ phases: [ msg: "isdbgrid", logicalSessionTimeoutMinutes: 2, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -63,7 +63,7 @@ phases: [ msg: "isdbgrid", logicalSessionTimeoutMinutes: 1, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -73,7 +73,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.json b/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.json index 50a93eda5f..29b3351869 100644 --- a/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.json +++ b/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -23,7 +23,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -76,7 +76,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.yml b/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.yml index c4393d85b1..c384b3be11 100644 --- a/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.yml +++ b/testdata/server-discovery-and-monitoring/sharded/mongos_disconnect.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -24,7 +24,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], @@ -85,7 +85,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ], diff --git a/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.json b/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.json index 311592d715..ae0c2d9cde 100644 --- a/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.json +++ b/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -23,7 +23,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.yml b/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.yml index 0a49d64249..6311605a89 100644 --- a/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.yml +++ b/testdata/server-discovery-and-monitoring/sharded/multiple_mongoses.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -24,7 +24,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.json b/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.json index d74375ebbf..4698f576d5 100644 --- a/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.json +++ b/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -26,7 +26,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.yml b/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.yml index ab25349bda..aa604f1100 100644 --- a/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.yml +++ b/testdata/server-discovery-and-monitoring/sharded/non_mongos_removed.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { @@ -25,7 +25,7 @@ phases: [ hosts: ["b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/too_new.json b/testdata/server-discovery-and-monitoring/sharded/too_new.json index c4e984ddec..4b997d2163 100644 --- a/testdata/server-discovery-and-monitoring/sharded/too_new.json +++ b/testdata/server-discovery-and-monitoring/sharded/too_new.json @@ -21,9 +21,7 @@ "ok": 1, "helloOk": true, "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 7, - "maxWireVersion": 900 + "msg": "isdbgrid" } ] ], diff --git a/testdata/server-discovery-and-monitoring/sharded/too_new.yml b/testdata/server-discovery-and-monitoring/sharded/too_new.yml index 03032a4948..7d59cb4305 100644 --- a/testdata/server-discovery-and-monitoring/sharded/too_new.yml +++ b/testdata/server-discovery-and-monitoring/sharded/too_new.yml @@ -15,9 +15,7 @@ phases: [ ok: 1, helloOk: true, isWritablePrimary: true, - msg: "isdbgrid", - minWireVersion: 7, - maxWireVersion: 900 + msg: "isdbgrid" }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/sharded/too_old.json b/testdata/server-discovery-and-monitoring/sharded/too_old.json index 688e1db0f5..b918715ada 100644 --- a/testdata/server-discovery-and-monitoring/sharded/too_old.json +++ b/testdata/server-discovery-and-monitoring/sharded/too_old.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 2, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ diff --git a/testdata/server-discovery-and-monitoring/sharded/too_old.yml b/testdata/server-discovery-and-monitoring/sharded/too_old.yml index 925a8f55b8..a709934c2f 100644 --- a/testdata/server-discovery-and-monitoring/sharded/too_old.yml +++ b/testdata/server-discovery-and-monitoring/sharded/too_old.yml @@ -9,7 +9,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 2, - maxWireVersion: 6 + maxWireVersion: 21 }], ["b:27017", { ok: 1, diff --git a/testdata/server-discovery-and-monitoring/single/compatible.json b/testdata/server-discovery-and-monitoring/single/compatible.json index 302927598c..493d9b748e 100644 --- a/testdata/server-discovery-and-monitoring/single/compatible.json +++ b/testdata/server-discovery-and-monitoring/single/compatible.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/compatible.yml b/testdata/server-discovery-and-monitoring/single/compatible.yml index b84c1388c3..e183c7127d 100644 --- a/testdata/server-discovery-and-monitoring/single/compatible.yml +++ b/testdata/server-discovery-and-monitoring/single/compatible.yml @@ -8,7 +8,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.json b/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.json index 90676a8f9b..1461b4c469 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.json @@ -15,7 +15,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.yml index 18c01226a9..0cb73c50e2 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_external_ip.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["b:27017"], # Internal IP. setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.json b/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.json index 25fe965185..72be020862 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "msg": "isdbgrid", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.yml index 853ce57c17..e81c9aef9b 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_mongos.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, msg: "isdbgrid", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.json b/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.json index cd8660888a..82a51d390e 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.yml index 21e565fd9c..9a0f3996ca 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_replicaset.yml @@ -12,7 +12,7 @@ phases: isWritablePrimary: true setName: rs minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: "a:27017": diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json b/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json index e204956056..e06d284364 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json @@ -17,7 +17,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.yml index 7e262c9dbe..d9fa876655 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rsarbiter.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.json b/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.json index 409e8502b3..45eb1602fb 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.json @@ -16,7 +16,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.yml index 4ea0b1551f..85dcb30a7c 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rsprimary.yml @@ -15,7 +15,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.json b/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.json index 305f283b52..b1bef8a49f 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.json @@ -17,7 +17,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.yml index b0c4d1f218..2d7da65e41 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_rssecondary.yml @@ -16,7 +16,7 @@ phases: [ hosts: ["a:27017", "b:27017"], setName: "rs", minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.json b/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.json index b47278482a..e71ba07e74 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.yml index cd71087e4d..ab4cb02ad4 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_standalone.yml @@ -13,7 +13,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json b/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json index 71080e6810..8014a0a533 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json @@ -16,7 +16,7 @@ ], "setName": "wrong", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], @@ -45,7 +45,7 @@ ], "setName": "rs", "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.yml b/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.yml index f1e48dc419..46b476d049 100644 --- a/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.yml +++ b/testdata/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.yml @@ -11,7 +11,7 @@ phases: - b:27017 setName: wrong minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: a:27017: @@ -29,7 +29,7 @@ phases: - b:27017 setName: rs minWireVersion: 0 - maxWireVersion: 6 + maxWireVersion: 21 outcome: servers: a:27017: diff --git a/testdata/server-discovery-and-monitoring/single/discover_standalone.json b/testdata/server-discovery-and-monitoring/single/discover_standalone.json index 858cbdaf63..d78c81654b 100644 --- a/testdata/server-discovery-and-monitoring/single/discover_standalone.json +++ b/testdata/server-discovery-and-monitoring/single/discover_standalone.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/discover_standalone.yml b/testdata/server-discovery-and-monitoring/single/discover_standalone.yml index 49ebb14209..bc112d4eac 100644 --- a/testdata/server-discovery-and-monitoring/single/discover_standalone.yml +++ b/testdata/server-discovery-and-monitoring/single/discover_standalone.yml @@ -13,7 +13,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.json b/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.json index 87b3e4e8a1..236eabe00a 100644 --- a/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.json +++ b/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.json @@ -12,7 +12,7 @@ "isWritablePrimary": true, "logicalSessionTimeoutMinutes": 7, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.yml b/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.yml index 2926d95a9d..4747af6770 100644 --- a/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.yml +++ b/testdata/server-discovery-and-monitoring/single/ls_timeout_standalone.yml @@ -14,7 +14,7 @@ phases: [ isWritablePrimary: true, logicalSessionTimeoutMinutes: 7, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/not_ok_response.json b/testdata/server-discovery-and-monitoring/single/not_ok_response.json index 8e7c2a10e3..cfaac3564a 100644 --- a/testdata/server-discovery-and-monitoring/single/not_ok_response.json +++ b/testdata/server-discovery-and-monitoring/single/not_ok_response.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ], [ @@ -21,7 +21,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/not_ok_response.yml b/testdata/server-discovery-and-monitoring/single/not_ok_response.yml index 64103a5902..c1ae7d9875 100644 --- a/testdata/server-discovery-and-monitoring/single/not_ok_response.yml +++ b/testdata/server-discovery-and-monitoring/single/not_ok_response.yml @@ -13,7 +13,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }], ["a:27017", { @@ -22,7 +22,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/standalone_removed.json b/testdata/server-discovery-and-monitoring/single/standalone_removed.json index 57f8f861b1..675cdbb008 100644 --- a/testdata/server-discovery-and-monitoring/single/standalone_removed.json +++ b/testdata/server-discovery-and-monitoring/single/standalone_removed.json @@ -11,7 +11,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/standalone_removed.yml b/testdata/server-discovery-and-monitoring/single/standalone_removed.yml index 59b44b162e..c8404463f7 100644 --- a/testdata/server-discovery-and-monitoring/single/standalone_removed.yml +++ b/testdata/server-discovery-and-monitoring/single/standalone_removed.yml @@ -13,7 +13,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json b/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json index 46660fa8de..488cac4918 100644 --- a/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json +++ b/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json @@ -10,7 +10,7 @@ "ok": 1, "ismaster": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.yml b/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.yml index a18ecb70fc..82c6ccfa7b 100644 --- a/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.yml +++ b/testdata/server-discovery-and-monitoring/single/standalone_using_legacy_hello.yml @@ -12,7 +12,7 @@ phases: [ ok: 1, ismaster: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], diff --git a/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.json b/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.json index 58ae7d9de4..c3dd98cf62 100644 --- a/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.json +++ b/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.json @@ -1,5 +1,5 @@ { - "description": "Standalone with default maxWireVersion of 0 is upgraded to one with maxWireVersion 6", + "description": "Standalone with default maxWireVersion of 0 is upgraded to one with maxWireVersion 21", "uri": "mongodb://a", "phases": [ { @@ -35,7 +35,7 @@ "helloOk": true, "isWritablePrimary": true, "minWireVersion": 0, - "maxWireVersion": 6 + "maxWireVersion": 21 } ] ], diff --git a/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.yml b/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.yml index aed6bae6e0..87b72b9000 100644 --- a/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.yml +++ b/testdata/server-discovery-and-monitoring/single/too_old_then_upgraded.yml @@ -1,4 +1,4 @@ -description: "Standalone with default maxWireVersion of 0 is upgraded to one with maxWireVersion 6" +description: "Standalone with default maxWireVersion of 0 is upgraded to one with maxWireVersion 21" uri: "mongodb://a" phases: [ { @@ -29,7 +29,7 @@ phases: [ helloOk: true, isWritablePrimary: true, minWireVersion: 0, - maxWireVersion: 6 + maxWireVersion: 21 }] ], outcome: { diff --git a/testdata/server-discovery-and-monitoring/unified/hello-command-error.json b/testdata/server-discovery-and-monitoring/unified/hello-command-error.json index 9afea87e77..87958cb2c0 100644 --- a/testdata/server-discovery-and-monitoring/unified/hello-command-error.json +++ b/testdata/server-discovery-and-monitoring/unified/hello-command-error.json @@ -3,7 +3,7 @@ "schemaVersion": "1.4", "runOnRequirements": [ { - "minServerVersion": "4.9", + "minServerVersion": "4.4.7", "serverless": "forbid", "topologies": [ "single", diff --git a/testdata/server-discovery-and-monitoring/unified/hello-command-error.yml b/testdata/server-discovery-and-monitoring/unified/hello-command-error.yml index 3b1428deb0..1c9c079220 100644 --- a/testdata/server-discovery-and-monitoring/unified/hello-command-error.yml +++ b/testdata/server-discovery-and-monitoring/unified/hello-command-error.yml @@ -4,8 +4,8 @@ description: hello-command-error schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: [ single, replicaset, sharded ] diff --git a/testdata/server-discovery-and-monitoring/unified/hello-network-error.json b/testdata/server-discovery-and-monitoring/unified/hello-network-error.json index 55373c90cc..15ed2b605e 100644 --- a/testdata/server-discovery-and-monitoring/unified/hello-network-error.json +++ b/testdata/server-discovery-and-monitoring/unified/hello-network-error.json @@ -3,7 +3,7 @@ "schemaVersion": "1.4", "runOnRequirements": [ { - "minServerVersion": "4.9", + "minServerVersion": "4.4.7", "serverless": "forbid", "topologies": [ "single", diff --git a/testdata/server-discovery-and-monitoring/unified/hello-network-error.yml b/testdata/server-discovery-and-monitoring/unified/hello-network-error.yml index 92c8cf243d..5f29194fc6 100644 --- a/testdata/server-discovery-and-monitoring/unified/hello-network-error.yml +++ b/testdata/server-discovery-and-monitoring/unified/hello-network-error.yml @@ -4,8 +4,8 @@ description: hello-network-error schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: [ single, replicaset, sharded ] diff --git a/testdata/server-discovery-and-monitoring/unified/hello-timeout.yml b/testdata/server-discovery-and-monitoring/unified/hello-timeout.yml new file mode 100644 index 0000000000..2a3374d1e7 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/hello-timeout.yml @@ -0,0 +1,318 @@ +--- +description: hello-timeout + +schemaVersion: "1.4" + +runOnRequirements: + # failCommand appName requirements + - minServerVersion: "4.4" + serverless: forbid + topologies: [ single, replicaset, sharded ] + +createEntities: + - client: + id: &setupClient setupClient + useMultipleMongoses: false + +initialData: &initialData + - collectionName: &collectionName hello-timeout + databaseName: &databaseName sdam-tests + documents: [] + +tests: + - description: Network timeout on Monitor handshake + operations: + # Configure the initial handshake to fail with a timeout. + # Use times: 2 so that the RTT hello is blocked as well. + - name: failPoint + object: testRunner + arguments: + client: *setupClient + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - hello + - isMaster + appName: timeoutMonitorHandshakeTest + blockConnection: true + blockTimeMS: 1000 + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - serverDescriptionChangedEvent + - poolClearedEvent + uriOptions: + retryWrites: false + connectTimeoutMS: 250 + heartbeatFrequencyMS: 500 + appname: timeoutMonitorHandshakeTest + - database: + id: &database database + client: *client + databaseName: *databaseName + - collection: + id: &collection collection + database: *database + collectionName: *collectionName + # The network error on the initial handshake should mark the server + # Unknown (emitting a ServerDescriptionChangedEvent) and clear the pool. + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + serverDescriptionChangedEvent: + newDescription: + type: Unknown + count: 1 + # Perform an operation to ensure the node is discovered. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 1 + - _id: 2 + # We cannot assert the server was marked Unknown and pool was cleared an + # exact number of times because the RTT hello may or may not have + # triggered this failpoint as well. + # - name: assertEventCount + # object: testRunner + # arguments: + # event: ServerMarkedUnknownEvent + # count: 1 + # - name: assertEventCount + # object: testRunner + # arguments: + # event: PoolClearedEvent + # count: 1 + expectEvents: + - client: *client + eventType: command + events: + - commandStartedEvent: + command: + insert: hello-timeout + documents: + - _id: 1 + - _id: 2 + commandName: insert + databaseName: *databaseName + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - _id: 1 + - _id: 2 + + - description: Network timeout on Monitor check + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - serverDescriptionChangedEvent + - poolClearedEvent + uriOptions: + retryWrites: false + connectTimeoutMS: 750 + heartbeatFrequencyMS: 500 + appname: timeoutMonitorCheckTest + - database: + id: &database database + client: *client + databaseName: *databaseName + - collection: + id: &collection collection + database: *database + collectionName: *collectionName + # Perform an operation to ensure the node is discovered. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 1 + - _id: 2 + # Configure the next streaming hello check to fail with a timeout. + # Use "times: 4" to increase the probability that the Monitor check times + # out since the RTT hello may trigger this failpoint one or many times as + # well. + - name: failPoint + object: testRunner + arguments: + failPoint: + configureFailPoint: failCommand + mode: + times: 4 + data: + failCommands: + - hello + - isMaster + appName: timeoutMonitorCheckTest + blockConnection: true + # blockTimeMS is evaluated after the waiting for heartbeatFrequencyMS server-side, so this value only + # needs to be greater than connectTimeoutMS. The driver will wait for (500+750)ms and the server will + # respond after (500+1000)ms. + blockTimeMS: 1000 + client: *setupClient + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + serverDescriptionChangedEvent: + newDescription: + type: Unknown + count: 1 + # The network error on the next check should mark the server Unknown and + # clear the pool. + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + poolClearedEvent: {} + count: 1 + # Perform an operation to ensure the node is rediscovered. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 3 + - _id: 4 + # We cannot assert the server was marked Unknown and pool was cleared an + # exact number of times because the RTT hello may have triggered this + # failpoint one or many times as well. + + expectEvents: + - client: *client + eventType: command + events: + - commandStartedEvent: + command: + insert: hello-timeout + documents: + - _id: 1 + - _id: 2 + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + insert: hello-timeout + documents: + - _id: 3 + - _id: 4 + commandName: insert + databaseName: *databaseName + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - _id: 1 + - _id: 2 + - _id: 3 + - _id: 4 + + - description: Driver extends timeout while streaming + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - commandStartedEvent + - serverDescriptionChangedEvent + - poolClearedEvent + uriOptions: + retryWrites: false + connectTimeoutMS: 250 + heartbeatFrequencyMS: 500 + appname: extendsTimeoutTest + - database: + id: &database database + client: *client + databaseName: *databaseName + - collection: + id: &collection collection + database: *database + collectionName: *collectionName + # Perform an operation to ensure the node is discovered. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 1 + - _id: 2 + # Wait for multiple monitor checks to complete. + - name: wait + object: testRunner + arguments: + ms: 2000 + # Perform an operation to ensure the node is still selectable. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 3 + - _id: 4 + # Assert that the server was never marked Unknown and the pool was never + # cleared. + - name: assertEventCount + object: testRunner + arguments: + client: *client + event: + serverDescriptionChangedEvent: + newDescription: + type: Unknown + count: 0 + - name: assertEventCount + object: testRunner + arguments: + client: *client + event: + poolClearedEvent: {} + count: 0 + expectEvents: + - client: *client + eventType: command + events: + - commandStartedEvent: + command: + insert: hello-timeout + documents: + - _id: 1 + - _id: 2 + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + insert: hello-timeout + documents: + - _id: 3 + - _id: 4 + commandName: insert + databaseName: *databaseName + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - _id: 1 + - _id: 2 + - _id: 3 + - _id: 4 diff --git a/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.json b/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.json index be01143ca0..d9329646d4 100644 --- a/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.json +++ b/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.json @@ -3,7 +3,7 @@ "schemaVersion": "1.11", "runOnRequirements": [ { - "minServerVersion": "4.9", + "minServerVersion": "4.4", "serverless": "forbid", "topologies": [ "replicaset", @@ -588,4 +588,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.yml b/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.yml index 5795bc72d6..67cd7d3ae3 100644 --- a/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.yml +++ b/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.yml @@ -5,7 +5,7 @@ schemaVersion: "1.11" runOnRequirements: # failCommand appName requirements - - minServerVersion: "4.9" + - minServerVersion: "4.4" serverless: forbid topologies: [ replicaset, sharded ] @@ -338,3 +338,4 @@ tests: databaseName: *databaseName documents: - { _id: 1, a : bar } + diff --git a/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.json b/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.json new file mode 100644 index 0000000000..30c0657630 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.json @@ -0,0 +1,88 @@ +{ + "description": "loadbalanced-emit-topology-description-changed-before-close", + "schemaVersion": "1.20", + "runOnRequirements": [ + { + "topologies": [ + "load-balanced" + ], + "minServerVersion": "4.4" + } + ], + "tests": [ + { + "description": "Topology lifecycle", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "topologyDescriptionChangedEvent", + "topologyOpeningEvent", + "topologyClosedEvent" + ] + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "topologyDescriptionChangedEvent": {} + }, + "count": 2 + } + }, + { + "name": "close", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "sdam", + "events": [ + { + "topologyOpeningEvent": {} + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Unknown" + }, + "newDescription": {} + } + }, + { + "topologyDescriptionChangedEvent": { + "newDescription": { + "type": "LoadBalanced" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyClosedEvent": {} + } + ] + } + ] + } + ] +} diff --git a/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.yml b/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.yml new file mode 100644 index 0000000000..c919a8cf8b --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/loadbalanced-emit-topology-changed-before-close.yml @@ -0,0 +1,49 @@ +description: "loadbalanced-emit-topology-description-changed-before-close" + +schemaVersion: "1.20" + +runOnRequirements: + - topologies: + - load-balanced + minServerVersion: "4.4" # awaitable hello + +tests: + - description: "Topology lifecycle" + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - topologyDescriptionChangedEvent + - topologyOpeningEvent + - topologyClosedEvent + # ensure the topology has been fully discovered before closing the client. + # expected events are initial server discovery and server connect event. + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + topologyDescriptionChangedEvent: {} + count: 2 + - name: close + object: *client + expectEvents: + - client: *client + eventType: sdam + events: + - topologyOpeningEvent: {} + - topologyDescriptionChangedEvent: # unknown -> unknown w disconnected server + previousDescription: + type: "Unknown" + newDescription: {} + - topologyDescriptionChangedEvent: # unknown w disconnected server -> loadBalanced + newDescription: + type: "LoadBalanced" + - topologyDescriptionChangedEvent: # loadbalanced -> unknown + newDescription: + type: "Unknown" + - topologyClosedEvent: {} diff --git a/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.json b/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.json index 45440d2557..0ad3b0ceaa 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.json +++ b/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.json @@ -132,6 +132,22 @@ } } }, + { + "level": "debug", + "component": "topology", + "data": { + "message": "Topology description changed", + "topologyId": { + "$$exists": true + }, + "previousDescription": { + "$$exists": true + }, + "newDescription": { + "$$exists": true + } + } + }, { "level": "debug", "component": "topology", diff --git a/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.yml b/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.yml index 87ad4bcf5d..432ec354ed 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.yml +++ b/testdata/server-discovery-and-monitoring/unified/logging-loadbalanced.yml @@ -67,6 +67,13 @@ tests: topologyId: { $$exists: true } serverHost: { $$type: string } serverPort: { $$type: [int, long] } + - level: debug + component: topology + data: + message: "Topology description changed" + topologyId: { $$exists: true } + previousDescription: { $$exists: true } # loadBalanced topology + newDescription: { $$exists: true } # unknown topology - level: debug component: topology data: diff --git a/testdata/server-discovery-and-monitoring/unified/logging-replicaset.json b/testdata/server-discovery-and-monitoring/unified/logging-replicaset.json index 8522c14e19..e6738225cd 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-replicaset.json +++ b/testdata/server-discovery-and-monitoring/unified/logging-replicaset.json @@ -220,6 +220,22 @@ } } }, + { + "level": "debug", + "component": "topology", + "data": { + "message": "Topology description changed", + "topologyId": { + "$$exists": true + }, + "previousDescription": { + "$$exists": true + }, + "newDescription": { + "$$exists": true + } + } + }, { "level": "debug", "component": "topology", diff --git a/testdata/server-discovery-and-monitoring/unified/logging-replicaset.yml b/testdata/server-discovery-and-monitoring/unified/logging-replicaset.yml index 176c4e5e18..a0b856ec72 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-replicaset.yml +++ b/testdata/server-discovery-and-monitoring/unified/logging-replicaset.yml @@ -109,13 +109,6 @@ tests: topologyId: { $$exists: true } serverHost: { $$type: string } serverPort: { $$type: [int, long] } - # TODO(GODRIVER-2967): The following log message has been removed from - # the JSON analogue because it assumes that - # "TopologyDescriptionChangedEvent" should occur when a topolgoy is - # closed. This behavior is not clearly defined anywhere and some - # drivers support and some don't. - # - # Need to sync whenever GODRIVER-2967 is unblocked. - level: debug component: topology data: @@ -293,4 +286,4 @@ tests: serverPort: { $$type: [int, long] } driverConnectionId: { $$exists: true } durationMS: { $$type: [int, long] } - failure: { $$exists: true } + failure: { $$exists: true } \ No newline at end of file diff --git a/testdata/server-discovery-and-monitoring/unified/logging-sharded.json b/testdata/server-discovery-and-monitoring/unified/logging-sharded.json index 33e7ec4bfe..61b27f5be0 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-sharded.json +++ b/testdata/server-discovery-and-monitoring/unified/logging-sharded.json @@ -187,6 +187,22 @@ } } }, + { + "level": "debug", + "component": "topology", + "data": { + "message": "Topology description changed", + "topologyId": { + "$$exists": true + }, + "previousDescription": { + "$$exists": true + }, + "newDescription": { + "$$exists": true + } + } + }, { "level": "debug", "component": "topology", diff --git a/testdata/server-discovery-and-monitoring/unified/logging-sharded.yml b/testdata/server-discovery-and-monitoring/unified/logging-sharded.yml index f175ce0f90..19870878b9 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-sharded.yml +++ b/testdata/server-discovery-and-monitoring/unified/logging-sharded.yml @@ -97,13 +97,6 @@ tests: topologyId: { $$exists: true } serverHost: { $$type: string } serverPort: { $$type: [int, long] } - # TODO(GODRIVER-2967): The following log message has been removed from - # the JSON analogue because it assumes that - # "TopologyDescriptionChangedEvent" should occur when a topolgoy is - # closed. This behavior is not clearly defined anywhere and some - # drivers support and some don't. - # - # Need to sync whenever GODRIVER-2967 is unblocked. - level: debug component: topology data: @@ -252,4 +245,4 @@ tests: serverPort: { $$type: [int, long] } driverConnectionId: { $$exists: true } durationMS: { $$type: [int, long] } - failure: { $$exists: true } + failure: { $$exists: true } \ No newline at end of file diff --git a/testdata/server-discovery-and-monitoring/unified/logging-standalone.json b/testdata/server-discovery-and-monitoring/unified/logging-standalone.json index f27d651afc..1ee6dbe899 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-standalone.json +++ b/testdata/server-discovery-and-monitoring/unified/logging-standalone.json @@ -162,6 +162,22 @@ } } }, + { + "level": "debug", + "component": "topology", + "data": { + "message": "Topology description changed", + "topologyId": { + "$$exists": true + }, + "previousDescription": { + "$$exists": true + }, + "newDescription": { + "$$exists": true + } + } + }, { "level": "debug", "component": "topology", diff --git a/testdata/server-discovery-and-monitoring/unified/logging-standalone.yml b/testdata/server-discovery-and-monitoring/unified/logging-standalone.yml index 0b378cd2fc..80cf98a20e 100644 --- a/testdata/server-discovery-and-monitoring/unified/logging-standalone.yml +++ b/testdata/server-discovery-and-monitoring/unified/logging-standalone.yml @@ -84,13 +84,6 @@ tests: topologyId: { $$exists: true } serverHost: { $$type: string } serverPort: { $$type: [int, long] } - # TODO(GODRIVER-2967): The following log message has been removed from - # the JSON analogue because it assumes that - # "TopologyDescriptionChangedEvent" should occur when a topolgoy is - # closed. This behavior is not clearly defined anywhere and some - # drivers support and some don't. - # - # Need to sync whenever GODRIVER-2967 is unblocked. - level: debug component: topology data: @@ -262,4 +255,4 @@ tests: serverPort: { $$type: [int, long] } driverConnectionId: { $$exists: true } durationMS: { $$type: [int, long] } - failure: { $$exists: true } + failure: { $$exists: true } \ No newline at end of file diff --git a/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.json b/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.json index 7e294baf66..bd9e9fcdec 100644 --- a/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.json +++ b/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.json @@ -3,7 +3,7 @@ "schemaVersion": "1.4", "runOnRequirements": [ { - "minServerVersion": "4.9", + "minServerVersion": "4.4.7", "serverless": "forbid", "topologies": [ "single" diff --git a/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.yml b/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.yml index 7d76174694..110e647c62 100644 --- a/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.yml +++ b/testdata/server-discovery-and-monitoring/unified/minPoolSize-error.yml @@ -4,8 +4,8 @@ description: minPoolSize-error schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: - single diff --git a/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.json b/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.json new file mode 100644 index 0000000000..3147a07a1e --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.json @@ -0,0 +1,242 @@ +{ + "description": "rediscover-quickly-after-step-down", + "schemaVersion": "1.4", + "runOnRequirements": [ + { + "minServerVersion": "4.4", + "serverless": "forbid", + "topologies": [ + "replicaset" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "setupClient" + } + }, + { + "database": { + "id": "adminDatabase", + "client": "setupClient", + "databaseName": "admin" + } + } + ], + "initialData": [ + { + "collectionName": "test-replSetStepDown", + "databaseName": "sdam-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ], + "tests": [ + { + "description": "Rediscover quickly after replSetStepDown", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "poolClearedEvent", + "commandStartedEvent" + ], + "uriOptions": { + "appname": "replSetStepDownTest", + "heartbeatFrequencyMS": 60000, + "serverSelectionTimeoutMS": 5000, + "w": "majority" + } + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "sdam-tests" + } + }, + { + "collection": { + "id": "collection", + "database": "database", + "collectionName": "test-replSetStepDown" + } + } + ] + } + }, + { + "name": "insertMany", + "object": "collection", + "arguments": { + "documents": [ + { + "_id": 3 + }, + { + "_id": 4 + } + ] + } + }, + { + "name": "recordTopologyDescription", + "object": "testRunner", + "arguments": { + "client": "client", + "id": "topologyDescription" + } + }, + { + "name": "assertTopologyType", + "object": "testRunner", + "arguments": { + "topologyDescription": "topologyDescription", + "topologyType": "ReplicaSetWithPrimary" + } + }, + { + "name": "runCommand", + "object": "adminDatabase", + "arguments": { + "command": { + "replSetFreeze": 0 + }, + "readPreference": { + "mode": "secondary" + }, + "commandName": "replSetFreeze" + } + }, + { + "name": "runCommand", + "object": "adminDatabase", + "arguments": { + "command": { + "replSetStepDown": 30, + "secondaryCatchUpPeriodSecs": 30, + "force": false + }, + "commandName": "replSetStepDown" + } + }, + { + "name": "waitForPrimaryChange", + "object": "testRunner", + "arguments": { + "client": "client", + "priorTopologyDescription": "topologyDescription", + "timeoutMS": 15000 + } + }, + { + "name": "insertMany", + "object": "collection", + "arguments": { + "documents": [ + { + "_id": 5 + }, + { + "_id": 6 + } + ] + } + }, + { + "name": "assertEventCount", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "poolClearedEvent": {} + }, + "count": 0 + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "command", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test-replSetStepDown", + "documents": [ + { + "_id": 3 + }, + { + "_id": 4 + } + ] + }, + "commandName": "insert", + "databaseName": "sdam-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "test-replSetStepDown", + "documents": [ + { + "_id": 5 + }, + { + "_id": 6 + } + ] + }, + "commandName": "insert", + "databaseName": "sdam-tests" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test-replSetStepDown", + "databaseName": "sdam-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + }, + { + "_id": 3 + }, + { + "_id": 4 + }, + { + "_id": 5 + }, + { + "_id": 6 + } + ] + } + ] + } + ] +} diff --git a/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.yml b/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.yml new file mode 100644 index 0000000000..f3e7509160 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/rediscover-quickly-after-step-down.yml @@ -0,0 +1,144 @@ +--- +description: rediscover-quickly-after-step-down + +schemaVersion: "1.4" + +runOnRequirements: + # 4.4 is required for streaming. + # A replica set is required for replSetStepDown. + - minServerVersion: "4.4" + serverless: forbid + topologies: + - replicaset + +createEntities: + - client: + id: &setupClient setupClient + - database: + id: &adminDatabase adminDatabase + client: *setupClient + databaseName: admin + +initialData: &initialData + - collectionName: &collectionName test-replSetStepDown + databaseName: &databaseName sdam-tests + documents: + - _id: 1 + - _id: 2 + +tests: + - description: Rediscover quickly after replSetStepDown + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - poolClearedEvent + - commandStartedEvent + uriOptions: + appname: replSetStepDownTest + # Configure a large heartbeatFrequencyMS + heartbeatFrequencyMS: 60000 + # Configure a much smaller server selection timeout so that the test + # will error when it cannot discover the new primary soon. + serverSelectionTimeoutMS: 5000 + w: majority + - database: + id: &database database + client: *client + databaseName: *databaseName + - collection: + id: &collection collection + database: *database + collectionName: *collectionName + # Discover the primary. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 3 + - _id: 4 + - name: recordTopologyDescription + object: testRunner + arguments: + client: *client + id: &topologyDescription topologyDescription + - name: assertTopologyType + object: testRunner + arguments: + topologyDescription: *topologyDescription + topologyType: ReplicaSetWithPrimary + # Unfreeze a secondary with replSetFreeze:0 to ensure a speedy election. + - name: runCommand + object: *adminDatabase + arguments: + command: + replSetFreeze: 0 + readPreference: + mode: secondary + commandName: replSetFreeze + # Run replSetStepDown on the meta client. + - name: runCommand + object: *adminDatabase + arguments: + command: + replSetStepDown: 30 + secondaryCatchUpPeriodSecs: 30 + force: false + commandName: replSetStepDown + - name: waitForPrimaryChange + object: testRunner + arguments: + client: *client + priorTopologyDescription: *topologyDescription + # We use a relatively large timeout here to workaround slow + # elections on Windows, possibly caused by SERVER-48154. + timeoutMS: 15000 + # Rediscover the new primary. + - name: insertMany + object: *collection + arguments: + documents: + - _id: 5 + - _id: 6 + # Assert that no pools were cleared. + - name: assertEventCount + object: testRunner + arguments: + client: *client + event: + poolClearedEvent: {} + count: 0 + expectEvents: + - client: *client + eventType: command + events: + - commandStartedEvent: + command: + insert: test-replSetStepDown + documents: + - _id: 3 + - _id: 4 + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + insert: test-replSetStepDown + documents: + - _id: 5 + - _id: 6 + commandName: insert + databaseName: *databaseName + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - _id: 1 + - _id: 2 + - _id: 3 + - _id: 4 + - _id: 5 + - _id: 6 diff --git a/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.json b/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.json new file mode 100644 index 0000000000..066a4ffee5 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.json @@ -0,0 +1,89 @@ +{ + "description": "replicaset-emit-topology-description-changed-before-close", + "schemaVersion": "1.20", + "runOnRequirements": [ + { + "topologies": [ + "replicaset" + ], + "minServerVersion": "4.4" + } + ], + "tests": [ + { + "description": "Topology lifecycle", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "topologyDescriptionChangedEvent", + "topologyOpeningEvent", + "topologyClosedEvent" + ] + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "topologyDescriptionChangedEvent": {} + }, + "count": 4 + } + }, + { + "name": "close", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "sdam", + "ignoreExtraEvents": false, + "events": [ + { + "topologyOpeningEvent": {} + }, + { + "topologyDescriptionChangedEvent": {} + }, + { + "topologyDescriptionChangedEvent": {} + }, + { + "topologyDescriptionChangedEvent": {} + }, + { + "topologyDescriptionChangedEvent": {} + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "ReplicaSetWithPrimary" + }, + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyClosedEvent": {} + } + ] + } + ] + } + ] +} diff --git a/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.yml b/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.yml new file mode 100644 index 0000000000..d0a1158ea9 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/replicaset-emit-topology-changed-before-close.yml @@ -0,0 +1,49 @@ +description: "replicaset-emit-topology-description-changed-before-close" + +schemaVersion: "1.20" + +runOnRequirements: + - topologies: + - replicaset + minServerVersion: "4.4" # awaitable hello + +tests: + - description: "Topology lifecycle" + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - topologyDescriptionChangedEvent + - topologyOpeningEvent + - topologyClosedEvent + # ensure the topology has been fully discovered before closing the client. + # expected events are initial server discovery and 3 server connect events. + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + topologyDescriptionChangedEvent: {} + count: 4 + - name: close + object: *client + expectEvents: + - client: *client + eventType: sdam + ignoreExtraEvents: false + events: + - topologyOpeningEvent: {} + - topologyDescriptionChangedEvent: {} # unknown -> replset no primary + - topologyDescriptionChangedEvent: {} # server connected + - topologyDescriptionChangedEvent: {} # server connected + - topologyDescriptionChangedEvent: {} # server connected + - topologyDescriptionChangedEvent: # replicaset -> unknown + previousDescription: + type: "ReplicaSetWithPrimary" + newDescription: + type: "Unknown" + - topologyClosedEvent: {} diff --git a/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.json b/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.json index 7d681b4f9e..4b492f7d85 100644 --- a/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.json +++ b/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.json @@ -444,6 +444,69 @@ ] } ] + }, + { + "description": "poll waits after successful heartbeat", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "uriOptions": { + "serverMonitoringMode": "poll", + "heartbeatFrequencyMS": 1000000 + }, + "useMultipleMongoses": false, + "observeEvents": [ + "serverHeartbeatStartedEvent", + "serverHeartbeatSucceededEvent" + ] + } + }, + { + "database": { + "id": "db", + "client": "client", + "databaseName": "sdam-tests" + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "serverHeartbeatSucceededEvent": {} + }, + "count": 1 + } + }, + { + "name": "wait", + "object": "testRunner", + "arguments": { + "ms": 500 + } + }, + { + "name": "assertEventCount", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "serverHeartbeatStartedEvent": {} + }, + "count": 1 + } + } + ] } ] } diff --git a/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.yml b/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.yml index 28c7853d04..5a81f0e1ad 100644 --- a/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.yml +++ b/testdata/server-discovery-and-monitoring/unified/serverMonitoringMode.yml @@ -171,3 +171,43 @@ tests: # Wait for the second serverHeartbeatStartedEvent to ensure we do not stream. - *waitForSecondHeartbeatStarted expectEvents: *pollingStartedEvents + + - description: "poll waits after successful heartbeat" + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: client + uriOptions: + serverMonitoringMode: "poll" + heartbeatFrequencyMS: 1000000 + useMultipleMongoses: false + observeEvents: + - serverHeartbeatStartedEvent + - serverHeartbeatSucceededEvent + - database: + id: db + client: client + databaseName: sdam-tests + # Wait for the first serverHeartbeatSucceededEvent to ensure we start polling. + - name: waitForEvent + object: testRunner + arguments: + client: client + event: + serverHeartbeatSucceededEvent: {} + count: 1 + # Wait for a bit longer to ensure we wait heartbeatFrequencyMS before starting the next check. + - name: wait + object: testRunner + arguments: + ms: 500 + - name: assertEventCount + object: testRunner + arguments: + client: client + event: + serverHeartbeatStartedEvent: {} + count: 1 diff --git a/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.json b/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.json new file mode 100644 index 0000000000..98fb585531 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.json @@ -0,0 +1,108 @@ +{ + "description": "sharded-emit-topology-description-changed-before-close", + "schemaVersion": "1.20", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ], + "minServerVersion": "4.4" + } + ], + "tests": [ + { + "description": "Topology lifecycle", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "topologyDescriptionChangedEvent", + "topologyOpeningEvent", + "topologyClosedEvent" + ], + "useMultipleMongoses": true + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "topologyDescriptionChangedEvent": {} + }, + "count": 3 + } + }, + { + "name": "close", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "sdam", + "ignoreExtraEvents": false, + "events": [ + { + "topologyOpeningEvent": {} + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Unknown" + }, + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Unknown" + }, + "newDescription": { + "type": "Sharded" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Sharded" + }, + "newDescription": { + "type": "Sharded" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Sharded" + }, + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyClosedEvent": {} + } + ] + } + ] + } + ] +} diff --git a/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.yml b/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.yml new file mode 100644 index 0000000000..cb6cc5ad4d --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/sharded-emit-topology-changed-before-close.yml @@ -0,0 +1,62 @@ +description: "sharded-emit-topology-description-changed-before-close" + +schemaVersion: "1.20" + +runOnRequirements: + - topologies: + - sharded + minServerVersion: "4.4" # awaitable hello + +tests: + - description: "Topology lifecycle" + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - topologyDescriptionChangedEvent + - topologyOpeningEvent + - topologyClosedEvent + useMultipleMongoses: true + # ensure the topology has been fully discovered before closing the client. + # expected events are initial cluster type change from unknown to sharded and connect events + # for each of 2 servers + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + topologyDescriptionChangedEvent: {} + count: 3 + - name: close + object: *client + expectEvents: + - client: *client + eventType: sdam + ignoreExtraEvents: false + events: + - topologyOpeningEvent: {} + - topologyDescriptionChangedEvent: # unknown -> unknown w disconnected server + previousDescription: + type: "Unknown" + newDescription: + type: "Unknown" + - topologyDescriptionChangedEvent: # server connected + previousDescription: + type: "Unknown" + newDescription: + type: "Sharded" + - topologyDescriptionChangedEvent: # server connected + previousDescription: + type: "Sharded" + newDescription: + type: "Sharded" + - topologyDescriptionChangedEvent: # sharded -> unknown + previousDescription: + type: "Sharded" + newDescription: + type: "Unknown" + - topologyClosedEvent: {} diff --git a/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.json b/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.json new file mode 100644 index 0000000000..27b5444d54 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.json @@ -0,0 +1,97 @@ +{ + "description": "standalone-emit-topology-description-changed-before-close", + "schemaVersion": "1.20", + "runOnRequirements": [ + { + "topologies": [ + "single" + ], + "minServerVersion": "4.4" + } + ], + "tests": [ + { + "description": "Topology lifecycle", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "topologyDescriptionChangedEvent", + "topologyOpeningEvent", + "topologyClosedEvent" + ] + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "topologyDescriptionChangedEvent": {} + }, + "count": 2 + } + }, + { + "name": "close", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "sdam", + "ignoreExtraEvents": false, + "events": [ + { + "topologyOpeningEvent": {} + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Unknown" + }, + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Unknown" + }, + "newDescription": { + "type": "Single" + } + } + }, + { + "topologyDescriptionChangedEvent": { + "previousDescription": { + "type": "Single" + }, + "newDescription": { + "type": "Unknown" + } + } + }, + { + "topologyClosedEvent": {} + } + ] + } + ] + } + ] +} diff --git a/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.yml b/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.yml new file mode 100644 index 0000000000..20fa380bd5 --- /dev/null +++ b/testdata/server-discovery-and-monitoring/unified/standalone-emit-topology-changed-before-close.yml @@ -0,0 +1,55 @@ +description: "standalone-emit-topology-description-changed-before-close" + +schemaVersion: "1.20" + +runOnRequirements: + - topologies: + - single + minServerVersion: "4.4" # awaitable hello + +tests: + - description: "Topology lifecycle" + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client client + observeEvents: + - topologyDescriptionChangedEvent + - topologyOpeningEvent + - topologyClosedEvent + # ensure the topology has been fully discovered before closing the client. + # expected events are initial server discovery and server connect event. + - name: waitForEvent + object: testRunner + arguments: + client: *client + event: + topologyDescriptionChangedEvent: {} + count: 2 + - name: close + object: *client + expectEvents: + - client: *client + eventType: sdam + ignoreExtraEvents: false + events: + - topologyOpeningEvent: {} + - topologyDescriptionChangedEvent: # unknown -> unknown w disconnected server + previousDescription: + type: "Unknown" + newDescription: + type: "Unknown" + - topologyDescriptionChangedEvent: # unknown w disconnected server -> standalone + previousDescription: + type: "Unknown" + newDescription: + type: "Single" + - topologyDescriptionChangedEvent: # standalone -> unknown + previousDescription: + type: "Single" + newDescription: + type: "Unknown" + - topologyClosedEvent: {} diff --git a/x/mongo/driver/operation/aggregate.go b/x/mongo/driver/operation/aggregate.go index 396a569389..a0cd5bd25e 100644 --- a/x/mongo/driver/operation/aggregate.go +++ b/x/mongo/driver/operation/aggregate.go @@ -198,7 +198,7 @@ func (a *Aggregate) BypassDocumentValidation(bypassDocumentValidation bool) *Agg return a } -// Collation specifies a collation. This option is only valid for server versions 3.4 and above. +// Collation specifies a collation. func (a *Aggregate) Collation(collation bsoncore.Document) *Aggregate { if a == nil { a = new(Aggregate) diff --git a/x/mongo/driver/operation/create.go b/x/mongo/driver/operation/create.go index 840d0ba469..f9a406dbc6 100644 --- a/x/mongo/driver/operation/create.go +++ b/x/mongo/driver/operation/create.go @@ -151,7 +151,7 @@ func (c *Create) Capped(capped bool) *Create { return c } -// Collation specifies a collation. This option is only valid for server versions 3.4 and above. +// Collation specifies a collation. func (c *Create) Collation(collation bsoncore.Document) *Create { if c == nil { c = new(Create) diff --git a/x/mongo/driver/operation/delete.go b/x/mongo/driver/operation/delete.go index 39420efc58..e6f47042a8 100644 --- a/x/mongo/driver/operation/delete.go +++ b/x/mongo/driver/operation/delete.go @@ -277,8 +277,7 @@ func (d *Delete) Retry(retry driver.RetryMode) *Delete { } // Hint is a flag to indicate that the update document contains a hint. Hint is only supported by -// servers >= 4.4. Older servers >= 3.4 will report an error for using the hint option. For servers < -// 3.4, the driver will return an error if the hint option is used. +// servers >= 4.4. Older servers will report an error for using the hint option. func (d *Delete) Hint(hint bool) *Delete { if d == nil { d = new(Delete) diff --git a/x/mongo/driver/operation/update.go b/x/mongo/driver/operation/update.go index 186f946313..722c06ef94 100644 --- a/x/mongo/driver/operation/update.go +++ b/x/mongo/driver/operation/update.go @@ -207,8 +207,7 @@ func (u *Update) command(dst []byte, desc description.SelectedServer) ([]byte, e return dst, nil } -// BypassDocumentValidation allows the operation to opt-out of document level validation. Valid -// for server versions >= 3.2. For servers < 3.2, this setting is ignored. +// BypassDocumentValidation allows the operation to opt-out of document level validation. func (u *Update) BypassDocumentValidation(bypassDocumentValidation bool) *Update { if u == nil { u = new(Update) @@ -219,8 +218,7 @@ func (u *Update) BypassDocumentValidation(bypassDocumentValidation bool) *Update } // Hint is a flag to indicate that the update document contains a hint. Hint is only supported by -// servers >= 4.2. Older servers >= 3.4 will report an error for using the hint option. For servers < -// 3.4, the driver will return an error if the hint option is used. +// servers >= 4.2. Older servers will report an error for using the hint option. func (u *Update) Hint(hint bool) *Update { if u == nil { u = new(Update) @@ -230,8 +228,7 @@ func (u *Update) Hint(hint bool) *Update { return u } -// ArrayFilters is a flag to indicate that the update document contains an arrayFilters field. This option is only -// supported on server versions 3.6 and higher. For servers < 3.6, the driver will return an error. +// ArrayFilters is a flag to indicate that the update document contains an arrayFilters field. func (u *Update) ArrayFilters(arrayFilters bool) *Update { if u == nil { u = new(Update) diff --git a/x/mongo/driver/topology/fsm.go b/x/mongo/driver/topology/fsm.go index 3cc06656fc..530b2169e6 100644 --- a/x/mongo/driver/topology/fsm.go +++ b/x/mongo/driver/topology/fsm.go @@ -20,7 +20,7 @@ import ( var ( // MinSupportedMongoDBVersion is the version string for the lowest MongoDB version supported by the driver. - MinSupportedMongoDBVersion = "3.6" + MinSupportedMongoDBVersion = "4.0" // SupportedWireVersions is the range of wire versions supported by the driver. SupportedWireVersions = driverutil.NewVersionRange(driverutil.MinWireVersion, driverutil.MaxWireVersion) diff --git a/x/mongo/driver/topology/sdam_spec_test.go b/x/mongo/driver/topology/sdam_spec_test.go index 9186aae157..6c190dda13 100644 --- a/x/mongo/driver/topology/sdam_spec_test.go +++ b/x/mongo/driver/topology/sdam_spec_test.go @@ -462,11 +462,7 @@ func runTest(t *testing.T, directory string, filename string) { content, err := ioutil.ReadFile(filepath) assert.Nil(t, err, "ReadFile error: %v", err) - // Remove ".json" from filename. - filename = filename[:len(filename)-5] - testName := directory + "/" + filename + ":" - - t.Run(testName, func(t *testing.T) { + t.Run(directory+"/"+filename, func(t *testing.T) { var test testCase err = bson.UnmarshalExtJSON(content, false, &test) assert.Nil(t, err, "Unmarshal error: %v", err) diff --git a/x/mongo/driver/topology/topology_test.go b/x/mongo/driver/topology/topology_test.go index b4af40b920..205030f1e8 100644 --- a/x/mongo/driver/topology/topology_test.go +++ b/x/mongo/driver/topology/topology_test.go @@ -114,7 +114,7 @@ func TestServerSelection(t *testing.T) { } want := fmt.Errorf( "server at %s reports wire version %d, but this version of the Go driver requires "+ - "at least 6 (MongoDB 3.6)", + "at least 7 (MongoDB 4.0)", desc.Servers[0].Addr.String(), desc.Servers[0].WireVersion.Max, )