mongo 2.19.2 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Rakefile +27 -154
- data/lib/mongo/cluster/topology/base.rb +16 -0
- data/lib/mongo/cluster.rb +27 -1
- data/lib/mongo/collection/view/iterable.rb +1 -0
- data/lib/mongo/collection.rb +27 -3
- data/lib/mongo/error/transactions_not_supported.rb +34 -0
- data/lib/mongo/error.rb +1 -0
- data/lib/mongo/grid/fs_bucket.rb +6 -0
- data/lib/mongo/monitoring/event/secure.rb +1 -1
- data/lib/mongo/operation/create_search_indexes/op_msg.rb +31 -0
- data/lib/mongo/operation/create_search_indexes.rb +15 -0
- data/lib/mongo/operation/drop_search_index/op_msg.rb +33 -0
- data/lib/mongo/operation/drop_search_index.rb +15 -0
- data/lib/mongo/operation/shared/executable.rb +43 -27
- data/lib/mongo/operation/shared/response_handling.rb +23 -25
- data/lib/mongo/operation/shared/specifiable.rb +7 -0
- data/lib/mongo/operation/update_search_index/op_msg.rb +34 -0
- data/lib/mongo/operation/update_search_index.rb +15 -0
- data/lib/mongo/operation.rb +3 -0
- data/lib/mongo/retryable/read_worker.rb +7 -6
- data/lib/mongo/retryable/write_worker.rb +7 -4
- data/lib/mongo/retryable.rb +2 -2
- data/lib/mongo/search_index/view.rb +232 -0
- data/lib/mongo/server/app_metadata/environment.rb +64 -9
- data/lib/mongo/server/app_metadata.rb +5 -4
- data/lib/mongo/server/description/features.rb +1 -0
- data/lib/mongo/server_selector/base.rb +32 -6
- data/lib/mongo/session/server_session/dirtyable.rb +52 -0
- data/lib/mongo/session/server_session.rb +3 -0
- data/lib/mongo/session/session_pool.rb +12 -18
- data/lib/mongo/session.rb +32 -0
- data/lib/mongo/uri.rb +0 -4
- data/lib/mongo/version.rb +1 -1
- data/lib/mongo.rb +1 -0
- data/mongo.gemspec +1 -7
- data/spec/atlas/atlas_connectivity_spec.rb +5 -9
- data/spec/atlas/operations_spec.rb +1 -5
- data/spec/faas/ruby-sam-app/Gemfile +9 -0
- data/spec/faas/ruby-sam-app/mongodb/Gemfile +4 -0
- data/spec/faas/ruby-sam-app/mongodb/app.rb +149 -0
- data/spec/faas/ruby-sam-app/template.yaml +48 -0
- data/spec/integration/client_side_encryption/corpus_spec.rb +10 -2
- data/spec/integration/retryable_reads_errors_spec.rb +161 -8
- data/spec/integration/retryable_writes_errors_spec.rb +156 -0
- data/spec/integration/search_indexes_prose_spec.rb +168 -0
- data/spec/lite_spec_helper.rb +32 -10
- data/spec/mongo/cluster_spec.rb +36 -0
- data/spec/mongo/collection/view/aggregation_spec.rb +6 -1
- data/spec/mongo/collection/view/explainable_spec.rb +2 -0
- data/spec/mongo/collection_crud_spec.rb +1 -1
- data/spec/mongo/operation/insert_spec.rb +1 -1
- data/spec/mongo/retryable/write_worker_spec.rb +39 -0
- data/spec/mongo/server/app_metadata/environment_spec.rb +135 -0
- data/spec/mongo/server/app_metadata_spec.rb +12 -2
- data/spec/mongo/server/connection_spec.rb +4 -0
- data/spec/mongo/session/session_pool_spec.rb +1 -16
- data/spec/mongo/session_transaction_spec.rb +15 -0
- data/spec/mongo/uri_spec.rb +0 -9
- data/spec/runners/crud/test.rb +0 -8
- data/spec/runners/crud.rb +1 -1
- data/spec/runners/transactions/test.rb +12 -3
- data/spec/runners/unified/assertions.rb +16 -3
- data/spec/runners/unified/crud_operations.rb +12 -0
- data/spec/runners/unified/search_index_operations.rb +63 -0
- data/spec/runners/unified/support_operations.rb +3 -5
- data/spec/runners/unified/test.rb +11 -2
- data/spec/shared/lib/mrss/docker_runner.rb +3 -0
- data/spec/shared/share/Dockerfile.erb +20 -69
- data/spec/shared/shlib/server.sh +1 -0
- data/spec/shared/shlib/set_env.sh +5 -28
- data/spec/spec_helper.rb +1 -1
- data/spec/spec_tests/data/client_side_encryption/explain.yml +2 -2
- data/spec/spec_tests/data/connection_string/invalid-uris.yml +0 -10
- data/spec/spec_tests/data/connection_string/valid-options.yml +13 -0
- data/spec/spec_tests/data/crud_unified/find-test-all-options.yml +348 -0
- data/spec/spec_tests/data/index_management/createSearchIndex.yml +64 -0
- data/spec/spec_tests/data/index_management/createSearchIndexes.yml +86 -0
- data/spec/spec_tests/data/index_management/dropSearchIndex.yml +43 -0
- data/spec/spec_tests/data/index_management/listSearchIndexes.yml +91 -0
- data/spec/spec_tests/data/index_management/updateSearchIndex.yml +46 -0
- data/spec/spec_tests/data/retryable_writes/unified/bulkWrite-serverErrors.yml +3 -6
- data/spec/spec_tests/data/retryable_writes/unified/insertOne-serverErrors.yml +3 -6
- data/spec/spec_tests/data/run_command_unified/runCommand.yml +319 -0
- data/spec/spec_tests/data/sessions_unified/driver-sessions-dirty-session-errors.yml +351 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +7 -7
- data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +3 -4
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +3 -3
- data/spec/spec_tests/index_management_unified_spec.rb +13 -0
- data/spec/spec_tests/run_command_unified_spec.rb +13 -0
- data/spec/spec_tests/sdam_unified_spec.rb +2 -0
- data/spec/support/constraints.rb +6 -0
- data/spec/support/faas/app/aws_lambda/mongodb/Gemfile.lock +19 -0
- data/spec/support/ocsp +1 -1
- data/spec/support/recording_logger.rb +27 -0
- data/spec/support/spec_config.rb +5 -0
- data.tar.gz.sig +0 -0
- metadata +1329 -1285
- metadata.gz.sig +3 -2
- data/spec/spec_tests/data/cmap/pool-clear-interrupt-immediately.yml +0 -49
|
@@ -143,7 +143,7 @@ tests:
|
|
|
143
143
|
- description: "readConcern majority with out stage"
|
|
144
144
|
runOnRequirements:
|
|
145
145
|
- minServerVersion: "4.1.0"
|
|
146
|
-
topologies: [ replicaset, sharded
|
|
146
|
+
topologies: [ replicaset, sharded ]
|
|
147
147
|
serverless: "forbid"
|
|
148
148
|
operations:
|
|
149
149
|
- name: aggregate
|
|
@@ -2,10 +2,6 @@ description: "poc-retryable-writes"
|
|
|
2
2
|
|
|
3
3
|
schemaVersion: "1.0"
|
|
4
4
|
|
|
5
|
-
runOnRequirements:
|
|
6
|
-
- minServerVersion: "3.6"
|
|
7
|
-
topologies: [ replicaset ]
|
|
8
|
-
|
|
9
5
|
createEntities:
|
|
10
6
|
- client:
|
|
11
7
|
id: &client0 client0
|
|
@@ -42,6 +38,9 @@ initialData:
|
|
|
42
38
|
|
|
43
39
|
tests:
|
|
44
40
|
- description: "FindOneAndUpdate is committed on first attempt"
|
|
41
|
+
runOnRequirements: &onPrimaryTransactionalWrite_requirements
|
|
42
|
+
- minServerVersion: "3.6"
|
|
43
|
+
topologies: [ replicaset ]
|
|
45
44
|
operations:
|
|
46
45
|
- name: failPoint
|
|
47
46
|
object: testRunner
|
|
@@ -65,6 +64,7 @@ tests:
|
|
|
65
64
|
- { _id: 2, x: 22 }
|
|
66
65
|
|
|
67
66
|
- description: "FindOneAndUpdate is not committed on first attempt"
|
|
67
|
+
runOnRequirements: *onPrimaryTransactionalWrite_requirements
|
|
68
68
|
operations:
|
|
69
69
|
- name: failPoint
|
|
70
70
|
object: testRunner
|
|
@@ -89,6 +89,7 @@ tests:
|
|
|
89
89
|
- { _id: 2, x: 22 }
|
|
90
90
|
|
|
91
91
|
- description: "FindOneAndUpdate is never committed"
|
|
92
|
+
runOnRequirements: *onPrimaryTransactionalWrite_requirements
|
|
92
93
|
operations:
|
|
93
94
|
- name: failPoint
|
|
94
95
|
object: testRunner
|
|
@@ -117,9 +118,7 @@ tests:
|
|
|
117
118
|
- minServerVersion: "4.0"
|
|
118
119
|
topologies: [ replicaset ]
|
|
119
120
|
- minServerVersion: "4.1.7"
|
|
120
|
-
|
|
121
|
-
# cluster backed by replica sets
|
|
122
|
-
topologies: [ sharded-replicaset ]
|
|
121
|
+
topologies: [ sharded ]
|
|
123
122
|
operations:
|
|
124
123
|
- name: failPoint
|
|
125
124
|
object: testRunner
|
|
@@ -192,6 +191,7 @@ tests:
|
|
|
192
191
|
mode: { times: 2 }
|
|
193
192
|
data:
|
|
194
193
|
failCommands: [ insert ]
|
|
194
|
+
errorLabels: [ RetryableWriteError ]
|
|
195
195
|
writeConcernError:
|
|
196
196
|
code: 91 # ShutdownInProgress
|
|
197
197
|
errmsg: "Replication is being shut down"
|
|
@@ -125,12 +125,11 @@ tests:
|
|
|
125
125
|
- description: "Dirty explicit session is discarded"
|
|
126
126
|
skipReason: RUBY-1813
|
|
127
127
|
# Original test specified retryWrites=true, but that is now the default.
|
|
128
|
-
# Retryable writes will require a sharded-replicaset, though.
|
|
129
128
|
runOnRequirements:
|
|
130
129
|
- minServerVersion: "4.0"
|
|
131
130
|
topologies: [ replicaset ]
|
|
132
131
|
- minServerVersion: "4.1.8"
|
|
133
|
-
topologies: [ sharded
|
|
132
|
+
topologies: [ sharded ]
|
|
134
133
|
operations:
|
|
135
134
|
- name: failPoint
|
|
136
135
|
object: testRunner
|
|
@@ -181,7 +180,7 @@ tests:
|
|
|
181
180
|
- commandStartedEvent: &insert_attempt
|
|
182
181
|
command:
|
|
183
182
|
insert: *collection0Name
|
|
184
|
-
documents:
|
|
183
|
+
documents:
|
|
185
184
|
- { _id: 2 }
|
|
186
185
|
ordered: true
|
|
187
186
|
lsid: { $$sessionLsid: *session0 }
|
|
@@ -192,7 +191,7 @@ tests:
|
|
|
192
191
|
- commandStartedEvent:
|
|
193
192
|
command:
|
|
194
193
|
insert: *collection0Name
|
|
195
|
-
documents:
|
|
194
|
+
documents:
|
|
196
195
|
- { _id: 3 }
|
|
197
196
|
ordered: true
|
|
198
197
|
lsid: { $$sessionLsid: *session0 }
|
|
@@ -6,7 +6,7 @@ runOnRequirements:
|
|
|
6
6
|
- minServerVersion: "4.0"
|
|
7
7
|
topologies: [ replicaset ]
|
|
8
8
|
- minServerVersion: "4.1.8"
|
|
9
|
-
topologies: [ sharded
|
|
9
|
+
topologies: [ sharded ]
|
|
10
10
|
|
|
11
11
|
createEntities:
|
|
12
12
|
- client:
|
|
@@ -51,7 +51,7 @@ tests:
|
|
|
51
51
|
- description: "explicitly create collection using create command"
|
|
52
52
|
runOnRequirements:
|
|
53
53
|
- minServerVersion: "4.3.4"
|
|
54
|
-
topologies: [ replicaset, sharded
|
|
54
|
+
topologies: [ replicaset, sharded ]
|
|
55
55
|
operations:
|
|
56
56
|
- name: dropCollection
|
|
57
57
|
object: *database0
|
|
@@ -109,7 +109,7 @@ tests:
|
|
|
109
109
|
- description: "create index on a non-existing collection"
|
|
110
110
|
runOnRequirements:
|
|
111
111
|
- minServerVersion: "4.3.4"
|
|
112
|
-
topologies: [ replicaset, sharded
|
|
112
|
+
topologies: [ replicaset, sharded ]
|
|
113
113
|
operations:
|
|
114
114
|
- name: dropCollection
|
|
115
115
|
object: *database0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
require 'runners/unified'
|
|
5
|
+
|
|
6
|
+
base = "#{CURRENT_PATH}/spec_tests/data/index_management"
|
|
7
|
+
INDEX_MANAGEMENT_UNIFIED_TESTS = Dir.glob("#{base}/**/*.yml").sort
|
|
8
|
+
|
|
9
|
+
# rubocop:disable RSpec/EmptyExampleGroup
|
|
10
|
+
describe 'index management unified spec tests' do
|
|
11
|
+
define_unified_spec_tests(base, INDEX_MANAGEMENT_UNIFIED_TESTS)
|
|
12
|
+
end
|
|
13
|
+
# rubocop:enable RSpec/EmptyExampleGroup
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# rubocop:todo all
|
|
3
|
+
|
|
4
|
+
require 'spec_helper'
|
|
5
|
+
|
|
6
|
+
require 'runners/unified'
|
|
7
|
+
|
|
8
|
+
base = "#{CURRENT_PATH}/spec_tests/data/run_command_unified"
|
|
9
|
+
RUN_COMMAND_UNIFIED_TESTS = Dir.glob("#{base}/**/*.yml").sort
|
|
10
|
+
|
|
11
|
+
describe 'runCommand unified spec tests' do
|
|
12
|
+
define_unified_spec_tests(base, RUN_COMMAND_UNIFIED_TESTS)
|
|
13
|
+
end
|
data/spec/support/constraints.rb
CHANGED
|
@@ -17,6 +17,12 @@ module Constraints
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
def forbid_x509_auth
|
|
21
|
+
before(:all) do
|
|
22
|
+
skip 'X.509 auth not allowed' if SpecConfig.instance.x509_auth?
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
20
26
|
def max_bson_version(version)
|
|
21
27
|
required_version = version.split('.').map(&:to_i)
|
|
22
28
|
actual_version = bson_version(required_version.length)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
bson (4.15.0)
|
|
5
|
+
mongo (2.19.1)
|
|
6
|
+
bson (>= 4.14.1, < 5.0.0)
|
|
7
|
+
|
|
8
|
+
PLATFORMS
|
|
9
|
+
arm64-darwin-22
|
|
10
|
+
x86_64-linux
|
|
11
|
+
|
|
12
|
+
DEPENDENCIES
|
|
13
|
+
mongo
|
|
14
|
+
|
|
15
|
+
RUBY VERSION
|
|
16
|
+
ruby 3.2.2p53
|
|
17
|
+
|
|
18
|
+
BUNDLED WITH
|
|
19
|
+
2.4.12
|
data/spec/support/ocsp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
../../.mod/drivers-evergreen-tools/.evergreen/ocsp
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# rubocop:todo all
|
|
3
|
+
|
|
4
|
+
require 'stringio'
|
|
5
|
+
|
|
6
|
+
# A "Logger-alike" class, quacking like ::Logger, used for recording messages
|
|
7
|
+
# as they are written to the log
|
|
8
|
+
class RecordingLogger < Logger
|
|
9
|
+
def initialize(*args, **kwargs)
|
|
10
|
+
@buffer = StringIO.new
|
|
11
|
+
super(@buffer, *args, **kwargs)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Accesses the raw contents of the log
|
|
15
|
+
#
|
|
16
|
+
# @return [ String ] the raw contents of the log
|
|
17
|
+
def contents
|
|
18
|
+
@buffer.string
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Returns the contents of the log as individual lines.
|
|
22
|
+
#
|
|
23
|
+
# @return [ Array<String> ] the individual log lines
|
|
24
|
+
def lines
|
|
25
|
+
contents.split(/\n/)
|
|
26
|
+
end
|
|
27
|
+
end
|
data/spec/support/spec_config.rb
CHANGED
|
@@ -172,6 +172,11 @@ class SpecConfig
|
|
|
172
172
|
!!ENV['SERVERLESS']
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
+
def kill_all_server_sessions?
|
|
176
|
+
!serverless? && # Serverless instances do not support killAllSessions command.
|
|
177
|
+
ClusterConfig.instance.fcv_ish >= '3.6'
|
|
178
|
+
end
|
|
179
|
+
|
|
175
180
|
# Test suite configuration
|
|
176
181
|
|
|
177
182
|
def client_debug?
|
data.tar.gz.sig
CHANGED
|
Binary file
|