mongo 2.0.0.beta → 2.0.0.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +14 -1
- data/lib/mongo.rb +2 -1
- data/lib/mongo/auth.rb +2 -2
- data/lib/mongo/bulk_write.rb +52 -0
- data/lib/mongo/bulk_write/bulk_writable.rb +191 -0
- data/lib/mongo/bulk_write/deletable.rb +60 -0
- data/lib/mongo/bulk_write/insertable.rb +52 -0
- data/lib/mongo/bulk_write/ordered_bulk_write.rb +48 -0
- data/lib/mongo/bulk_write/replacable.rb +57 -0
- data/lib/mongo/bulk_write/unordered_bulk_write.rb +46 -0
- data/lib/mongo/bulk_write/updatable.rb +68 -0
- data/lib/mongo/client.rb +15 -2
- data/lib/mongo/cluster/topology/replica_set.rb +1 -1
- data/lib/mongo/cluster/topology/sharded.rb +1 -1
- data/lib/mongo/cluster/topology/standalone.rb +1 -1
- data/lib/mongo/cluster/topology/unknown.rb +1 -1
- data/lib/mongo/collection.rb +1 -1
- data/lib/mongo/collection/view/aggregation.rb +1 -1
- data/lib/mongo/collection/view/readable.rb +1 -1
- data/lib/mongo/collection/view/writable.rb +5 -5
- data/lib/mongo/cursor.rb +0 -2
- data/lib/mongo/error.rb +4 -3
- data/lib/mongo/error/{bulk_write_failure.rb → bulk_write_error.rb} +2 -2
- data/lib/mongo/error/invalid_bulk_operation.rb +2 -2
- data/lib/mongo/error/invalid_bulk_operation_type.rb +36 -0
- data/lib/mongo/error/{empty_batch.rb → multi_index_drop.rb} +5 -10
- data/lib/mongo/grid/file/metadata.rb +1 -8
- data/lib/mongo/grid/fs.rb +5 -5
- data/lib/mongo/index/view.rb +90 -34
- data/lib/mongo/operation.rb +0 -1
- data/lib/mongo/operation/aggregate.rb +2 -2
- data/lib/mongo/operation/aggregate/result.rb +4 -0
- data/lib/mongo/operation/bulk_delete/result.rb +2 -127
- data/lib/mongo/operation/bulk_insert/result.rb +2 -132
- data/lib/mongo/operation/bulk_update/result.rb +2 -142
- data/lib/mongo/operation/command.rb +1 -1
- data/lib/mongo/operation/executable.rb +3 -3
- data/lib/mongo/operation/list_collections/result.rb +0 -2
- data/lib/mongo/operation/map_reduce.rb +1 -1
- data/lib/mongo/operation/read/collections_info.rb +1 -1
- data/lib/mongo/operation/read/get_more.rb +1 -1
- data/lib/mongo/operation/read/indexes.rb +1 -1
- data/lib/mongo/operation/read/list_collections.rb +1 -1
- data/lib/mongo/operation/read/list_indexes.rb +1 -1
- data/lib/mongo/operation/read/query.rb +1 -1
- data/lib/mongo/operation/specifiable.rb +18 -1
- data/lib/mongo/operation/write.rb +2 -0
- data/lib/mongo/operation/write/bulk_delete.rb +5 -19
- data/lib/mongo/operation/write/bulk_insert.rb +9 -40
- data/lib/mongo/operation/write/bulk_mergable.rb +67 -0
- data/lib/mongo/operation/write/bulk_update.rb +5 -19
- data/lib/mongo/operation/write/command.rb +1 -1
- data/lib/mongo/operation/write/command/{ensure_index.rb → create_index.rb} +4 -9
- data/lib/mongo/operation/write/command/delete.rb +4 -4
- data/lib/mongo/operation/write/command/drop_index.rb +1 -1
- data/lib/mongo/operation/write/command/insert.rb +4 -4
- data/lib/mongo/operation/write/command/update.rb +4 -4
- data/lib/mongo/operation/write/create_index.rb +12 -7
- data/lib/mongo/operation/write/create_user.rb +1 -1
- data/lib/mongo/operation/write/delete.rb +1 -1
- data/lib/mongo/operation/write/drop_index.rb +1 -1
- data/lib/mongo/operation/write/insert.rb +1 -1
- data/lib/mongo/operation/write/legacy_bulk_mergable.rb +83 -0
- data/lib/mongo/operation/write/remove_user.rb +1 -1
- data/lib/mongo/operation/write/update.rb +1 -1
- data/lib/mongo/{bulk.rb → options.rb} +2 -2
- data/lib/mongo/options/mapper.rb +78 -0
- data/lib/mongo/server.rb +2 -2
- data/lib/mongo/server/connection_pool/queue.rb +1 -1
- data/lib/mongo/server/description.rb +1 -1
- data/lib/mongo/server/description/inspector.rb +1 -1
- data/lib/mongo/server_selector.rb +1 -1
- data/lib/mongo/socket/unix.rb +2 -4
- data/lib/mongo/version.rb +1 -1
- data/lib/mongo/write_concern/acknowledged.rb +15 -1
- data/lib/mongo/write_concern/normalizable.rb +0 -22
- data/lib/mongo/write_concern/unacknowledged.rb +12 -0
- data/spec/mongo/bulk/bulk_write_spec.rb +178 -91
- data/spec/mongo/collection/view/aggregation_spec.rb +14 -1
- data/spec/mongo/collection/view/explainable_spec.rb +1 -1
- data/spec/mongo/collection/view/map_reduce_spec.rb +2 -2
- data/spec/mongo/collection/view/readable_spec.rb +2 -2
- data/spec/mongo/collection/view/writable_spec.rb +7 -7
- data/spec/mongo/collection/view_spec.rb +14 -5
- data/spec/mongo/collection_spec.rb +5 -5
- data/spec/mongo/cursor_spec.rb +3 -3
- data/spec/mongo/database_spec.rb +4 -8
- data/spec/mongo/grid/fs_spec.rb +8 -8
- data/spec/mongo/index/view_spec.rb +139 -35
- data/spec/mongo/operation/aggregate_spec.rb +14 -22
- data/spec/mongo/operation/command_spec.rb +8 -16
- data/spec/mongo/operation/map_reduce_spec.rb +1 -1
- data/spec/mongo/operation/read/indexes_spec.rb +2 -2
- data/spec/mongo/operation/write/bulk_delete_spec.rb +1 -239
- data/spec/mongo/operation/write/bulk_insert_spec.rb +3 -234
- data/spec/mongo/operation/write/bulk_update_spec.rb +1 -289
- data/spec/mongo/operation/write/command/delete_spec.rb +0 -13
- data/spec/mongo/operation/write/command/insert_spec.rb +0 -14
- data/spec/mongo/operation/write/command/update_spec.rb +0 -14
- data/spec/mongo/operation/write/{ensure_index_spec.rb → create_index_spec.rb} +8 -26
- data/spec/mongo/operation/write/delete_spec.rb +1 -1
- data/spec/mongo/operation/write/drop_index_spec.rb +1 -1
- data/spec/mongo/operation/write/insert_spec.rb +3 -3
- data/spec/mongo/operation/write/update_spec.rb +1 -1
- data/spec/mongo/server_selection_spec.rb +2 -2
- data/spec/support/authorization.rb +4 -2
- data/spec/support/server_selection.rb +25 -8
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Nearest.yml +4 -10
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Nearest_non_matching.yml +6 -12
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Primary.yml +4 -6
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/PrimaryPreferred.yml +4 -10
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.yml +6 -12
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Secondary.yml +4 -10
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/SecondaryPreferred.yml +4 -10
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.yml +6 -12
- data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Secondary_non_matching.yml +6 -12
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Nearest.yml +9 -17
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Nearest_non_matching.yml +9 -17
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Primary.yml +6 -10
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/PrimaryPreferred.yml +11 -21
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.yml +11 -18
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Secondary.yml +31 -0
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/SecondaryPreferred.yml +31 -0
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.yml +29 -0
- data/spec/support/server_selection/selection/ReplicaSetWithPrimary/read/Secondary_non_matching.yml +26 -0
- data/spec/support/server_selection/selection/Sharded/read/SecondaryPreferred.yml +4 -10
- data/spec/support/server_selection/selection/Single/read/SecondaryPreferred.yml +2 -6
- data/spec/support/server_selection/selection/Unknown/read/SecondaryPreferred.yml +0 -2
- data/spec/support/shared/bulk_write.rb +109 -72
- metadata +29 -10
- metadata.gz.sig +0 -0
- data/lib/mongo/bulk/bulk_write.rb +0 -307
- data/lib/mongo/operation/batchable.rb +0 -103
@@ -82,12 +82,12 @@ describe Mongo::Operation::Write::Insert do
|
|
82
82
|
describe '#execute' do
|
83
83
|
|
84
84
|
before do
|
85
|
-
authorized_collection.indexes.
|
85
|
+
authorized_collection.indexes.create_one({ name: 1 }, { unique: true })
|
86
86
|
end
|
87
87
|
|
88
88
|
after do
|
89
|
-
authorized_collection.find.
|
90
|
-
authorized_collection.indexes.
|
89
|
+
authorized_collection.find.delete_many
|
90
|
+
authorized_collection.indexes.drop_one('name_1')
|
91
91
|
end
|
92
92
|
|
93
93
|
context 'when inserting a single document' do
|
@@ -28,7 +28,7 @@ describe 'Server Selection' do
|
|
28
28
|
address = Mongo::Address.new(server['address'])
|
29
29
|
Mongo::Server.new(address, Mongo::Event::Listeners.new).tap do |s|
|
30
30
|
allow(s).to receive(:average_round_trip_time).and_return(server['avg_rtt_ms'])
|
31
|
-
allow(s).to receive(:tags).and_return(server['
|
31
|
+
allow(s).to receive(:tags).and_return(server['tags'])
|
32
32
|
allow(s).to receive(:secondary?).and_return(server['type'] == 'RSSecondary')
|
33
33
|
allow(s).to receive(:primary?).and_return(server['type'] == 'RSPrimary')
|
34
34
|
end
|
@@ -40,7 +40,7 @@ describe 'Server Selection' do
|
|
40
40
|
address = Mongo::Address.new(server['address'])
|
41
41
|
Mongo::Server.new(address, Mongo::Event::Listeners.new).tap do |s|
|
42
42
|
allow(s).to receive(:average_round_trip_time).and_return(server['avg_rtt_ms'])
|
43
|
-
allow(s).to receive(:tags).and_return(server['
|
43
|
+
allow(s).to receive(:tags).and_return(server['tags'])
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -74,7 +74,9 @@ TEST_USER = Mongo::Auth::User.new(
|
|
74
74
|
password: 'password',
|
75
75
|
roles: [
|
76
76
|
{ role: Mongo::Auth::Roles::READ_WRITE, db: TEST_DB },
|
77
|
-
{ role: Mongo::Auth::Roles::DATABASE_ADMIN, db: TEST_DB }
|
77
|
+
{ role: Mongo::Auth::Roles::DATABASE_ADMIN, db: TEST_DB },
|
78
|
+
{ role: Mongo::Auth::Roles::READ_WRITE, db: 'invalid_database' },
|
79
|
+
{ role: Mongo::Auth::Roles::DATABASE_ADMIN, db: 'invalid_database' }
|
78
80
|
]
|
79
81
|
)
|
80
82
|
|
@@ -95,7 +97,7 @@ TEST_READ_WRITE_USER = Mongo::Auth::User.new(
|
|
95
97
|
# The write concern to use in the tests.
|
96
98
|
#
|
97
99
|
# @since 2.0.0
|
98
|
-
WRITE_CONCERN = CONNECT == :
|
100
|
+
WRITE_CONCERN = (CONNECT == :replica_set) ? { w: ADDRESSES.size } : { w: 1 }
|
99
101
|
|
100
102
|
# Provides an authorized mongo client on the default test database for the
|
101
103
|
# default test user.
|
@@ -56,12 +56,6 @@ module Mongo
|
|
56
56
|
# @since 2.0.0
|
57
57
|
attr_reader :suitable_servers
|
58
58
|
|
59
|
-
# @return [ Array<Hash> ] in_latency_window The subset of suitable servers that falls
|
60
|
-
# within the allowable latency window.
|
61
|
-
#
|
62
|
-
# @since 2.0.0
|
63
|
-
attr_reader :in_latency_window
|
64
|
-
|
65
59
|
# @return [ Mongo::Cluster::Topology ] type The topology type.
|
66
60
|
#
|
67
61
|
# @since 2.0.0
|
@@ -80,8 +74,7 @@ module Mongo
|
|
80
74
|
@description = "#{@test['topology_description']['type']}: #{File.basename(file)}"
|
81
75
|
@read_preference = @test['read_preference']
|
82
76
|
@read_preference['mode'] = READ_PREFERENCES[@read_preference['mode']]
|
83
|
-
@candidate_servers = @test['
|
84
|
-
@eligible_servers = @test['eligible_servers']
|
77
|
+
@candidate_servers = @test['topology_description']['servers']
|
85
78
|
@suitable_servers = @test['suitable_servers']
|
86
79
|
@in_latency_window = @test['in_latency_window']
|
87
80
|
@type = TOPOLOGY_TYPES[@test['topology_description']['type']]
|
@@ -134,6 +127,30 @@ module Mongo
|
|
134
127
|
def invalid_server_preference?
|
135
128
|
read_preference['mode'] == 'Primary' && read_preference['tag_sets']
|
136
129
|
end
|
130
|
+
|
131
|
+
# The subset of suitable servers that falls within the allowable latency
|
132
|
+
# window.
|
133
|
+
# We have to correct for our server selection algorithm that adds the primary
|
134
|
+
# to the end of the list for SecondaryPreferred read preference mode.
|
135
|
+
#
|
136
|
+
# @example Get the list of suitable servers within the latency window.
|
137
|
+
# spec.in_latency_window
|
138
|
+
#
|
139
|
+
# @return [ Array<Hash> ] The servers within the latency window.
|
140
|
+
#
|
141
|
+
# @since 2.0.0
|
142
|
+
def in_latency_window
|
143
|
+
if read_preference['mode'] == :secondary_preferred && primary
|
144
|
+
return @in_latency_window.push(primary).uniq
|
145
|
+
end
|
146
|
+
@in_latency_window
|
147
|
+
end
|
148
|
+
|
149
|
+
private
|
150
|
+
|
151
|
+
def primary
|
152
|
+
@candidate_servers.find { |s| s['type'] == 'RSPrimary' }
|
153
|
+
end
|
137
154
|
end
|
138
155
|
end
|
139
156
|
end
|
@@ -6,25 +6,19 @@ topology_description:
|
|
6
6
|
address: b:27017
|
7
7
|
avg_rtt_ms: 5
|
8
8
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
9
|
+
tags:
|
10
|
+
data_center: nyc
|
11
11
|
- &2
|
12
12
|
address: c:27017
|
13
13
|
avg_rtt_ms: 100
|
14
14
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
15
|
+
tags:
|
16
|
+
data_center: nyc
|
17
17
|
operation: read
|
18
18
|
read_preference:
|
19
19
|
mode: Nearest
|
20
20
|
tag_sets:
|
21
21
|
- data_center: nyc
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers:
|
26
|
-
- *1
|
27
|
-
- *2
|
28
22
|
suitable_servers:
|
29
23
|
- *1
|
30
24
|
- *2
|
data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Nearest_non_matching.yml
CHANGED
@@ -2,26 +2,20 @@
|
|
2
2
|
topology_description:
|
3
3
|
type: ReplicaSetNoPrimary
|
4
4
|
servers:
|
5
|
-
-
|
6
|
-
address: b:27017
|
5
|
+
- address: b:27017
|
7
6
|
avg_rtt_ms: 5
|
8
7
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
address: c:27017
|
8
|
+
tags:
|
9
|
+
data_center: nyc
|
10
|
+
- address: c:27017
|
13
11
|
avg_rtt_ms: 100
|
14
12
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
13
|
+
tags:
|
14
|
+
data_center: nyc
|
17
15
|
operation: read
|
18
16
|
read_preference:
|
19
17
|
mode: Nearest
|
20
18
|
tag_sets:
|
21
19
|
- data_center: sf
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers: []
|
26
20
|
suitable_servers: []
|
27
21
|
in_latency_window: []
|
@@ -5,19 +5,17 @@ topology_description:
|
|
5
5
|
- address: b:27017
|
6
6
|
avg_rtt_ms: 5
|
7
7
|
type: RSSecondary
|
8
|
-
|
9
|
-
|
8
|
+
tags:
|
9
|
+
data_center: nyc
|
10
10
|
- address: c:27017
|
11
11
|
avg_rtt_ms: 100
|
12
12
|
type: RSSecondary
|
13
|
-
|
14
|
-
|
13
|
+
tags:
|
14
|
+
data_center: nyc
|
15
15
|
operation: read
|
16
16
|
read_preference:
|
17
17
|
mode: Primary
|
18
18
|
tag_sets:
|
19
19
|
- {}
|
20
|
-
candidate_servers: []
|
21
|
-
eligible_servers: []
|
22
20
|
suitable_servers: []
|
23
21
|
in_latency_window: []
|
@@ -6,25 +6,19 @@ topology_description:
|
|
6
6
|
address: b:27017
|
7
7
|
avg_rtt_ms: 5
|
8
8
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
9
|
+
tags:
|
10
|
+
data_center: nyc
|
11
11
|
- &2
|
12
12
|
address: c:27017
|
13
13
|
avg_rtt_ms: 100
|
14
14
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
15
|
+
tags:
|
16
|
+
data_center: nyc
|
17
17
|
operation: read
|
18
18
|
read_preference:
|
19
19
|
mode: PrimaryPreferred
|
20
20
|
tag_sets:
|
21
21
|
- {}
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers:
|
26
|
-
- *1
|
27
|
-
- *2
|
28
22
|
suitable_servers:
|
29
23
|
- *1
|
30
24
|
- *2
|
@@ -2,26 +2,20 @@
|
|
2
2
|
topology_description:
|
3
3
|
type: ReplicaSetNoPrimary
|
4
4
|
servers:
|
5
|
-
-
|
6
|
-
address: b:27017
|
5
|
+
- address: b:27017
|
7
6
|
avg_rtt_ms: 5
|
8
7
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
address: c:27017
|
8
|
+
tags:
|
9
|
+
data_center: nyc
|
10
|
+
- address: c:27017
|
13
11
|
avg_rtt_ms: 100
|
14
12
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
13
|
+
tags:
|
14
|
+
data_center: nyc
|
17
15
|
operation: read
|
18
16
|
read_preference:
|
19
17
|
mode: PrimaryPreferred
|
20
18
|
tag_sets:
|
21
19
|
- data_center: sf
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers: []
|
26
20
|
suitable_servers: []
|
27
21
|
in_latency_window: []
|
@@ -6,25 +6,19 @@ topology_description:
|
|
6
6
|
address: b:27017
|
7
7
|
avg_rtt_ms: 5
|
8
8
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
9
|
+
tags:
|
10
|
+
data_center: nyc
|
11
11
|
- &2
|
12
12
|
address: c:27017
|
13
13
|
avg_rtt_ms: 100
|
14
14
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
15
|
+
tags:
|
16
|
+
data_center: nyc
|
17
17
|
operation: read
|
18
18
|
read_preference:
|
19
19
|
mode: Secondary
|
20
20
|
tag_sets:
|
21
21
|
- data_center: nyc
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers:
|
26
|
-
- *1
|
27
|
-
- *2
|
28
22
|
suitable_servers:
|
29
23
|
- *1
|
30
24
|
- *2
|
data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/SecondaryPreferred.yml
CHANGED
@@ -6,25 +6,19 @@ topology_description:
|
|
6
6
|
address: b:27017
|
7
7
|
avg_rtt_ms: 5
|
8
8
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
9
|
+
tags:
|
10
|
+
data_center: nyc
|
11
11
|
- &2
|
12
12
|
address: c:27017
|
13
13
|
avg_rtt_ms: 100
|
14
14
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
15
|
+
tags:
|
16
|
+
data_center: nyc
|
17
17
|
operation: read
|
18
18
|
read_preference:
|
19
19
|
mode: SecondaryPreferred
|
20
20
|
tag_sets:
|
21
21
|
- data_center: nyc
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers:
|
26
|
-
- *1
|
27
|
-
- *2
|
28
22
|
suitable_servers:
|
29
23
|
- *1
|
30
24
|
- *2
|
@@ -2,26 +2,20 @@
|
|
2
2
|
topology_description:
|
3
3
|
type: ReplicaSetNoPrimary
|
4
4
|
servers:
|
5
|
-
-
|
6
|
-
address: b:27017
|
5
|
+
- address: b:27017
|
7
6
|
avg_rtt_ms: 5
|
8
7
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
address: c:27017
|
8
|
+
tags:
|
9
|
+
data_center: nyc
|
10
|
+
- address: c:27017
|
13
11
|
avg_rtt_ms: 100
|
14
12
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
13
|
+
tags:
|
14
|
+
data_center: nyc
|
17
15
|
operation: read
|
18
16
|
read_preference:
|
19
17
|
mode: SecondaryPreferred
|
20
18
|
tag_sets:
|
21
19
|
- data_center: sf
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers: []
|
26
20
|
suitable_servers: []
|
27
21
|
in_latency_window: []
|
data/spec/support/server_selection/selection/ReplicaSetNoPrimary/read/Secondary_non_matching.yml
CHANGED
@@ -2,26 +2,20 @@
|
|
2
2
|
topology_description:
|
3
3
|
type: ReplicaSetNoPrimary
|
4
4
|
servers:
|
5
|
-
-
|
6
|
-
address: b:27017
|
5
|
+
- address: b:27017
|
7
6
|
avg_rtt_ms: 5
|
8
7
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
11
|
-
-
|
12
|
-
address: c:27017
|
8
|
+
tags:
|
9
|
+
data_center: nyc
|
10
|
+
- address: c:27017
|
13
11
|
avg_rtt_ms: 100
|
14
12
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
13
|
+
tags:
|
14
|
+
data_center: nyc
|
17
15
|
operation: read
|
18
16
|
read_preference:
|
19
17
|
mode: Secondary
|
20
18
|
tag_sets:
|
21
19
|
- data_center: sf
|
22
|
-
candidate_servers:
|
23
|
-
- *1
|
24
|
-
- *2
|
25
|
-
eligible_servers: []
|
26
20
|
suitable_servers: []
|
27
21
|
in_latency_window: []
|
@@ -6,36 +6,28 @@ topology_description:
|
|
6
6
|
address: b:27017
|
7
7
|
avg_rtt_ms: 5
|
8
8
|
type: RSSecondary
|
9
|
-
|
10
|
-
|
11
|
-
- &
|
9
|
+
tags:
|
10
|
+
data_center: nyc
|
11
|
+
- &3
|
12
12
|
address: c:27017
|
13
13
|
avg_rtt_ms: 100
|
14
14
|
type: RSSecondary
|
15
|
-
|
16
|
-
|
17
|
-
- &
|
15
|
+
tags:
|
16
|
+
data_center: nyc
|
17
|
+
- &2
|
18
18
|
address: a:27017
|
19
19
|
avg_rtt_ms: 26
|
20
20
|
type: RSPrimary
|
21
|
-
|
22
|
-
|
21
|
+
tags:
|
22
|
+
data_center: nyc
|
23
23
|
operation: read
|
24
24
|
read_preference:
|
25
25
|
mode: Nearest
|
26
26
|
tag_sets:
|
27
27
|
- data_center: nyc
|
28
|
-
candidate_servers:
|
29
|
-
- *1
|
30
|
-
- *2
|
31
|
-
- *3
|
32
|
-
eligible_servers:
|
33
|
-
- *1
|
34
|
-
- *2
|
35
|
-
- *3
|
36
28
|
suitable_servers:
|
37
29
|
- *1
|
38
|
-
- *3
|
39
30
|
- *2
|
31
|
+
- *3
|
40
32
|
in_latency_window:
|
41
33
|
- *1
|