mongo 1.8.3.rc0 → 1.8.3.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/mongo/cursor.rb +10 -12
- data/lib/mongo/networking.rb +5 -3
- data/test/bson/bson_test.rb +73 -2
- data/test/bson/byte_buffer_test.rb +10 -1
- data/test/bson/timestamp_test.rb +5 -0
- data/test/functional/collection_test.rb +1 -1
- data/test/functional/timeout_test.rb +7 -8
- data/test/replica_set/basic_test.rb +2 -3
- data/test/replica_set/client_test.rb +3 -3
- data/test/replica_set/connection_test.rb +6 -2
- data/test/replica_set/count_test.rb +3 -3
- data/test/replica_set/cursor_test.rb +132 -31
- data/test/replica_set/insert_test.rb +2 -2
- data/test/replica_set/query_test.rb +4 -4
- data/test/replica_set/refresh_test.rb +29 -18
- data/test/replica_set/replication_ack_test.rb +10 -10
- data/test/test_helper.rb +2 -0
- data/test/tools/mongo_config.rb +6 -6
- metadata +30 -43
- metadata.gz.sig +0 -0
- data/test/replica_set/z_cluster_shutdown.rb +0 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dec398480b1b7ced8276797d36e9257fecbc1707
|
4
|
+
data.tar.gz: 735c75e4d0877dc57cfede2016201a121737af4b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fe1e61dcef314f5ea551c7e1f96ccbeae3aa7969d714c2774dd17a694912267b14f86a3f9c73ccea0d0a3f2b4e3ad72c319c46ab2c9a28001f7a005f7d1de87f
|
7
|
+
data.tar.gz: 37d440db17fd4820dabfecf12b4da396ec8912593ef15256fc86e8839a1e3e1952f12bb484165069e5a63dffd4cdcd3eff031393881867b3ce3fea73cb99cea3
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[travis-img]: https://secure.travis-ci.org/mongodb/mongo-ruby-driver.png
|
4
4
|
[travis-url]: http://travis-ci.org/mongodb/mongo-ruby-driver
|
5
|
-
[codeclimate-img]: https://codeclimate.com/
|
5
|
+
[codeclimate-img]: https://codeclimate.com/github/mongodb/mongo-ruby-driver.png
|
6
6
|
[codeclimate-url]: https://codeclimate.com/github/mongodb/mongo-ruby-driver
|
7
7
|
[jenkins-img]: https://jenkins.10gen.com/job/mongo-ruby-driver/badge/icon
|
8
8
|
[jenkins-url]: https://jenkins.10gen.com/job/mongo-ruby-driver/
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.8.3.
|
1
|
+
1.8.3.rc1
|
data/lib/mongo/cursor.rb
CHANGED
@@ -324,16 +324,11 @@ module Mongo
|
|
324
324
|
message.put_int(1)
|
325
325
|
message.put_long(@cursor_id)
|
326
326
|
log(:debug, "Cursor#close #{@cursor_id}")
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
:socket => socket
|
333
|
-
)
|
334
|
-
ensure
|
335
|
-
socket.checkin
|
336
|
-
end
|
327
|
+
@connection.send_message(
|
328
|
+
Mongo::Constants::OP_KILL_CURSORS,
|
329
|
+
message,
|
330
|
+
:pool => @pool
|
331
|
+
)
|
337
332
|
end
|
338
333
|
@cursor_id = 0
|
339
334
|
@closed = true
|
@@ -516,7 +511,7 @@ module Mongo
|
|
516
511
|
message.put_long(@cursor_id)
|
517
512
|
log(:debug, "cursor.refresh() for cursor #{@cursor_id}") if @logger
|
518
513
|
|
519
|
-
socket =
|
514
|
+
socket = @pool.checkout
|
520
515
|
|
521
516
|
begin
|
522
517
|
results, @n_received, @cursor_id = @connection.receive_message(
|
@@ -532,7 +527,9 @@ module Mongo
|
|
532
527
|
|
533
528
|
def checkout_socket_from_connection
|
534
529
|
begin
|
535
|
-
if @
|
530
|
+
if @pool
|
531
|
+
socket = @pool.checkout
|
532
|
+
elsif @command && !Mongo::Support::secondary_ok?(@selector)
|
536
533
|
socket = @connection.checkout_reader(:primary)
|
537
534
|
else
|
538
535
|
socket = @connection.checkout_reader(@read, @tag_sets, @acceptable_latency)
|
@@ -542,6 +539,7 @@ module Mongo
|
|
542
539
|
raise ex
|
543
540
|
end
|
544
541
|
@pool = socket.pool
|
542
|
+
#puts "checkout_socket_from_connection caller:#{caller[0][/:in `([^']+)'/,1]} self:#{self.object_id} @pool.port:#{@pool.port}"
|
545
543
|
socket
|
546
544
|
end
|
547
545
|
|
data/lib/mongo/networking.rb
CHANGED
@@ -26,10 +26,12 @@ module Mongo
|
|
26
26
|
add_message_headers(message, operation)
|
27
27
|
packed_message = message.to_s
|
28
28
|
|
29
|
-
sock =
|
29
|
+
sock = nil
|
30
|
+
pool = opts.fetch(:pool, nil)
|
30
31
|
begin
|
31
|
-
if
|
32
|
-
|
32
|
+
if pool
|
33
|
+
#puts "send_message pool.port:#{pool.port}"
|
34
|
+
sock = pool.checkout
|
33
35
|
else
|
34
36
|
sock ||= checkout_writer
|
35
37
|
end
|
data/test/bson/bson_test.rb
CHANGED
@@ -58,6 +58,68 @@ class BSONTest < Test::Unit::TestCase
|
|
58
58
|
assert_equal doc, @encoder.deserialize(bson)
|
59
59
|
end
|
60
60
|
|
61
|
+
def test_interface
|
62
|
+
doc = { 'a' => 1 }
|
63
|
+
bson = BSON.serialize(doc)
|
64
|
+
assert_equal doc, BSON.deserialize(bson)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_read_bson_document
|
68
|
+
bson_file_data_h_star = ["21000000075f6964005115883c3d75c94d3aa18b63016100000000000000f03f00"]
|
69
|
+
strio = StringIO.new(bson_file_data_h_star.pack('H*'))
|
70
|
+
bson = BSON.read_bson_document(strio)
|
71
|
+
doc = {"_id"=>BSON::ObjectId('5115883c3d75c94d3aa18b63'), "a"=>1.0}
|
72
|
+
assert_equal doc, bson
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_bson_ruby_interface
|
76
|
+
doc = { 'a' => 1 }
|
77
|
+
buf = BSON_RUBY.serialize(doc)
|
78
|
+
bson = BSON::BSON_RUBY.new
|
79
|
+
bson.instance_variable_set(:@buf, buf)
|
80
|
+
assert_equal [12, 0, 0, 0, 16, 97, 0, 1, 0, 0, 0, 0], bson.to_a
|
81
|
+
assert_equal "\f\x00\x00\x00\x10a\x00\x01\x00\x00\x00\x00", bson.to_s
|
82
|
+
assert_equal [12, 0, 0, 0, 16, 97, 0, 1, 0, 0, 0, 0], bson.unpack
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_bson_ruby_hex_dump
|
86
|
+
doc = { 'a' => 1 }
|
87
|
+
buf = BSON_RUBY.serialize(doc)
|
88
|
+
bson = BSON_RUBY.new
|
89
|
+
bson.instance_variable_set(:@buf, buf)
|
90
|
+
doc_hex_dump = " 0: 0C 00 00 00 10 61 00 01\n 8: 00 00 00 00"
|
91
|
+
assert_equal doc_hex_dump, bson.hex_dump
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_bson_ruby_dbref_not_used
|
95
|
+
buf = BSON::ByteBuffer.new
|
96
|
+
val = ns = 'namespace'
|
97
|
+
|
98
|
+
# Make a hole for the length
|
99
|
+
len_pos = buf.position
|
100
|
+
buf.put_int(0)
|
101
|
+
|
102
|
+
# Save the string
|
103
|
+
start_pos = buf.position
|
104
|
+
BSON::BSON_RUBY.serialize_cstr(buf, val)
|
105
|
+
end_pos = buf.position
|
106
|
+
|
107
|
+
# Put the string size in front
|
108
|
+
buf.put_int(end_pos - start_pos, len_pos)
|
109
|
+
|
110
|
+
# Go back to where we were
|
111
|
+
buf.position = end_pos
|
112
|
+
|
113
|
+
oid = ObjectId.new
|
114
|
+
buf.put_array(oid.to_a)
|
115
|
+
buf.rewind
|
116
|
+
|
117
|
+
bson = BSON::BSON_RUBY.new
|
118
|
+
bson.instance_variable_set(:@buf, buf)
|
119
|
+
|
120
|
+
assert_equal DBRef.new(ns, oid).to_s, bson.deserialize_dbref_data(buf).to_s
|
121
|
+
end
|
122
|
+
|
61
123
|
def test_require_hash
|
62
124
|
assert_raise_error InvalidDocument, "takes a Hash" do
|
63
125
|
BSON.serialize('foo')
|
@@ -191,8 +253,14 @@ class BSONTest < Test::Unit::TestCase
|
|
191
253
|
end
|
192
254
|
|
193
255
|
def test_code
|
194
|
-
|
256
|
+
code = Code.new('this.a.b < this.b')
|
257
|
+
assert_equal 17, code.length
|
258
|
+
assert_match /<BSON::Code:.*@data="this.a.b < this.b".*>/, code.inspect
|
259
|
+
doc = {'$where' => code}
|
195
260
|
assert_doc_pass(doc)
|
261
|
+
code = 'this.c.d < this.e'.to_bson_code # core_ext.rb
|
262
|
+
assert_equal BSON::Code, code.class
|
263
|
+
assert_equal code, code.to_bson_code
|
196
264
|
end
|
197
265
|
|
198
266
|
def test_code_with_symbol
|
@@ -343,8 +411,11 @@ class BSONTest < Test::Unit::TestCase
|
|
343
411
|
|
344
412
|
def test_dbref
|
345
413
|
oid = ObjectId.new
|
414
|
+
ns = 'namespace'
|
346
415
|
doc = {}
|
347
|
-
|
416
|
+
dbref = DBRef.new(ns, oid)
|
417
|
+
assert_equal({"$id"=>oid, "$ns"=>ns}, dbref.to_hash)
|
418
|
+
doc['dbref'] = dbref
|
348
419
|
bson = @encoder.serialize(doc)
|
349
420
|
doc2 = @encoder.deserialize(bson)
|
350
421
|
|
@@ -15,6 +15,16 @@ class ByteBufferTest < Test::Unit::TestCase
|
|
15
15
|
assert_equal 0, @buf.length
|
16
16
|
end
|
17
17
|
|
18
|
+
def test_initialize_with_string_and_clear
|
19
|
+
@buf = ByteBuffer.new("a")
|
20
|
+
assert_equal 1, @buf.size
|
21
|
+
assert_equal 1, @buf.position
|
22
|
+
@buf.clear
|
23
|
+
assert_equal 0, @buf.position
|
24
|
+
assert_equal "", @buf.to_s
|
25
|
+
assert_equal 0, @buf.size
|
26
|
+
end
|
27
|
+
|
18
28
|
def test_nil_get_returns_one_byte
|
19
29
|
@buf.put_array([1, 2, 3, 4])
|
20
30
|
@buf.rewind
|
@@ -202,5 +212,4 @@ class ByteBufferTest < Test::Unit::TestCase
|
|
202
212
|
assert_not_equal @buf, 123
|
203
213
|
assert_not_equal @buf, nil
|
204
214
|
end
|
205
|
-
|
206
215
|
end
|
data/test/bson/timestamp_test.rb
CHANGED
@@ -2,6 +2,11 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class TimestampTest < Test::Unit::TestCase
|
4
4
|
|
5
|
+
def test_timestamp_to_s
|
6
|
+
t1 = Timestamp.new(5000, 200)
|
7
|
+
assert_equal "seconds: 5000, increment: 200", t1.to_s
|
8
|
+
end
|
9
|
+
|
5
10
|
def test_timestamp_equality
|
6
11
|
t1 = Timestamp.new(5000, 200)
|
7
12
|
t2 = Timestamp.new(5000, 200)
|
@@ -840,7 +840,7 @@ class TestCollection < Test::Unit::TestCase
|
|
840
840
|
r = Code.new("function(k,vals) { return 1; }")
|
841
841
|
oh = BSON::OrderedHash.new
|
842
842
|
oh[:replace] = 'foo'
|
843
|
-
oh[:db] =
|
843
|
+
oh[:db] = MONGO_TEST_DB
|
844
844
|
res = @@test.map_reduce(m, r, :out => (oh))
|
845
845
|
assert res["result"]
|
846
846
|
assert res["counts"]
|
@@ -3,24 +3,24 @@ require 'test_helper'
|
|
3
3
|
class TestTimeout < Test::Unit::TestCase
|
4
4
|
def test_op_timeout
|
5
5
|
connection = standard_connection(:op_timeout => 1)
|
6
|
-
|
6
|
+
|
7
7
|
admin = connection.db('admin')
|
8
8
|
|
9
9
|
command = {:eval => "sleep(500)"}
|
10
10
|
# Should not timeout
|
11
11
|
assert admin.command(command)
|
12
|
-
|
12
|
+
|
13
13
|
# Should timeout
|
14
14
|
command = {:eval => "sleep(1500)"}
|
15
15
|
assert_raise Mongo::OperationTimeout do
|
16
|
-
admin.command(command)
|
16
|
+
admin.command(command)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_external_timeout_does_not_leave_socket_in_bad_state
|
21
21
|
client = Mongo::MongoClient.new
|
22
|
-
db = client[
|
23
|
-
coll = db['
|
22
|
+
db = client[MONGO_TEST_DB]
|
23
|
+
coll = db['timeout-tests']
|
24
24
|
|
25
25
|
# prepare the database
|
26
26
|
coll.drop
|
@@ -43,14 +43,13 @@ class TestTimeout < Test::Unit::TestCase
|
|
43
43
|
=begin
|
44
44
|
def test_ssl_op_timeout
|
45
45
|
connection = standard_connection(:op_timeout => 1, :ssl => true)
|
46
|
-
|
46
|
+
|
47
47
|
coll = connection.db(MONGO_TEST_DB).collection("test")
|
48
48
|
coll.insert({:a => 1})
|
49
|
-
|
50
49
|
# Should not timeout
|
51
50
|
assert coll.find_one({"$where" => "sleep(100); return true;"})
|
52
51
|
|
53
|
-
# Should timeout
|
52
|
+
# Should timeout
|
54
53
|
assert_raise Mongo::OperationTimeout do
|
55
54
|
coll.find_one({"$where" => "sleep(5 * 1000); return true;"})
|
56
55
|
end
|
@@ -65,9 +65,8 @@ class BasicTest < Test::Unit::TestCase
|
|
65
65
|
assert_equal @rs.primary_name, [client.host, client.port].join(':')
|
66
66
|
assert_equal client.host, client.primary_pool.host
|
67
67
|
assert_equal client.port, client.primary_pool.port
|
68
|
-
assert_equal
|
69
|
-
assert_equal
|
70
|
-
assert_equal 1, client.secondary_pools.length
|
68
|
+
assert_equal 2, client.secondaries.length
|
69
|
+
assert_equal 2, client.secondary_pools.length
|
71
70
|
assert_equal @rs.repl_set_name, client.replica_set_name
|
72
71
|
assert client.secondary_pools.include?(client.read_pool(:secondary))
|
73
72
|
assert_equal 90, client.refresh_interval
|
@@ -48,7 +48,7 @@ class ClientTest < Test::Unit::TestCase
|
|
48
48
|
|
49
49
|
def test_connect_with_primary_stepped_down
|
50
50
|
@client = MongoReplicaSetClient.new @rs.repl_set_seeds
|
51
|
-
@client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w =>
|
51
|
+
@client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w => 3})
|
52
52
|
assert @client[MONGO_TEST_DB]['bar'].find_one
|
53
53
|
|
54
54
|
primary = Mongo::MongoClient.new(*@client.primary)
|
@@ -66,7 +66,7 @@ class ClientTest < Test::Unit::TestCase
|
|
66
66
|
def test_connect_with_primary_killed
|
67
67
|
@client = MongoReplicaSetClient.new @rs.repl_set_seeds
|
68
68
|
assert @client.connected?
|
69
|
-
@client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w =>
|
69
|
+
@client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w => 3})
|
70
70
|
assert @client[MONGO_TEST_DB]['bar'].find_one
|
71
71
|
|
72
72
|
@rs.primary.kill(Signal.list['KILL'])
|
@@ -96,7 +96,7 @@ class ClientTest < Test::Unit::TestCase
|
|
96
96
|
|
97
97
|
#def test_connect_with_first_node_removed
|
98
98
|
# @client = MongoReplicaSetClient.new @rs.repl_set_seeds
|
99
|
-
# @client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w =>
|
99
|
+
# @client[MONGO_TEST_DB]['bar'].save({:a => 1}, {:w => 3})
|
100
100
|
#
|
101
101
|
# old_primary = [@client.primary_pool.host, @client.primary_pool.port]
|
102
102
|
# old_primary_conn = Mongo::MongoClient.new(*old_primary)
|
@@ -48,11 +48,13 @@ class ConnectionTest < Test::Unit::TestCase
|
|
48
48
|
ENV['MONGODB_URI'] = "mongodb://#{@rs.repl_set_seeds_uri}?replicaset=#{@rs.repl_set_name}"
|
49
49
|
@connection = ReplSetConnection.new
|
50
50
|
assert !@connection.nil?
|
51
|
-
assert_equal
|
51
|
+
assert_equal 3, @connection.seeds.length
|
52
52
|
assert_equal @rs.replicas[0].host, @connection.seeds[0][0]
|
53
53
|
assert_equal @rs.replicas[1].host, @connection.seeds[1][0]
|
54
|
+
assert_equal @rs.replicas[2].host, @connection.seeds[2][0]
|
54
55
|
assert_equal @rs.replicas[0].port, @connection.seeds[0][1]
|
55
56
|
assert_equal @rs.replicas[1].port, @connection.seeds[1][1]
|
57
|
+
assert_equal @rs.replicas[2].port, @connection.seeds[2][1]
|
56
58
|
assert_equal @rs.repl_set_name, @connection.replica_set_name
|
57
59
|
assert @connection.connected?
|
58
60
|
end
|
@@ -61,11 +63,13 @@ class ConnectionTest < Test::Unit::TestCase
|
|
61
63
|
ENV['MONGODB_URI'] = "mongodb://#{@rs.repl_set_seeds_uri}?replicaset=#{@rs.repl_set_name}"
|
62
64
|
@connection = Connection.from_uri
|
63
65
|
assert !@connection.nil?
|
64
|
-
assert_equal
|
66
|
+
assert_equal 3, @connection.seeds.length
|
65
67
|
assert_equal @rs.replicas[0].host, @connection.seeds[0][0]
|
66
68
|
assert_equal @rs.replicas[1].host, @connection.seeds[1][0]
|
69
|
+
assert_equal @rs.replicas[2].host, @connection.seeds[2][0]
|
67
70
|
assert_equal @rs.replicas[0].port, @connection.seeds[0][1]
|
68
71
|
assert_equal @rs.replicas[1].port, @connection.seeds[1][1]
|
72
|
+
assert_equal @rs.replicas[2].port, @connection.seeds[2][1]
|
69
73
|
assert_equal @rs.repl_set_name, @connection.replica_set_name
|
70
74
|
assert @connection.connected?
|
71
75
|
end
|
@@ -17,7 +17,7 @@ class ReplicaSetCountTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_correct_count_after_insertion_reconnect
|
20
|
-
@coll.insert({:a => 20}, :w =>
|
20
|
+
@coll.insert({:a => 20}, :w => 3, :wtimeout => 10000)
|
21
21
|
assert_equal 1, @coll.count
|
22
22
|
|
23
23
|
# Kill the current master node
|
@@ -32,7 +32,7 @@ class ReplicaSetCountTest < Test::Unit::TestCase
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_count_command_sent_to_primary
|
35
|
-
@coll.insert({:a => 20}, :w =>
|
35
|
+
@coll.insert({:a => 20}, :w => 3, :wtimeout => 10000)
|
36
36
|
count_before = @primary['admin'].command({:serverStatus => 1})['opcounters']['command']
|
37
37
|
assert_equal 1, @coll.count
|
38
38
|
count_after = @primary['admin'].command({:serverStatus => 1})['opcounters']['command']
|
@@ -40,7 +40,7 @@ class ReplicaSetCountTest < Test::Unit::TestCase
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_count_with_read
|
43
|
-
@coll.insert({:a => 20}, :w =>
|
43
|
+
@coll.insert({:a => 20}, :w => 3, :wtimeout => 10000)
|
44
44
|
count_before = @primary['admin'].command({:serverStatus => 1})['opcounters']['command']
|
45
45
|
assert_equal 1, @coll.count(:read => :secondary)
|
46
46
|
assert_equal 1, @coll.find({}, :read => :secondary).count()
|
@@ -6,24 +6,44 @@ class ReplicaSetCursorTest < Test::Unit::TestCase
|
|
6
6
|
ensure_cluster(:rs)
|
7
7
|
end
|
8
8
|
|
9
|
+
def test_get_more_primary
|
10
|
+
setup_client(:primary)
|
11
|
+
cursor_get_more_test(:primary)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_more_secondary
|
15
|
+
setup_client(:secondary)
|
16
|
+
cursor_get_more_test(:secondary)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_close_primary
|
20
|
+
setup_client(:primary)
|
21
|
+
kill_cursor_test(:primary)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_close_secondary
|
25
|
+
setup_client(:secondary)
|
26
|
+
kill_cursor_test(:secondary)
|
27
|
+
end
|
28
|
+
|
9
29
|
def test_cursors_get_closed
|
10
30
|
setup_client
|
11
|
-
|
31
|
+
assert_cursors_on_members
|
12
32
|
end
|
13
33
|
|
14
34
|
def test_cursors_get_closed_secondary
|
15
35
|
setup_client(:secondary)
|
16
|
-
|
36
|
+
assert_cursors_on_members(:secondary)
|
17
37
|
end
|
18
38
|
|
19
|
-
def
|
20
|
-
setup_client(:primary
|
21
|
-
|
39
|
+
def test_cursors_get_closed_secondary_query
|
40
|
+
setup_client(:primary)
|
41
|
+
assert_cursors_on_members(:secondary)
|
22
42
|
end
|
23
43
|
|
24
44
|
private
|
25
45
|
|
26
|
-
def setup_client(read=:primary
|
46
|
+
def setup_client(read=:primary)
|
27
47
|
route_read ||= read
|
28
48
|
# Setup ReplicaSet Connection
|
29
49
|
@client = MongoReplicaSetClient.new(@rs.repl_set_seeds, :read => read)
|
@@ -31,41 +51,122 @@ class ReplicaSetCursorTest < Test::Unit::TestCase
|
|
31
51
|
@db = @client.db(MONGO_TEST_DB)
|
32
52
|
@db.drop_collection("cursor_tests")
|
33
53
|
@coll = @db.collection("cursor_tests")
|
34
|
-
|
35
|
-
@coll.insert({:a => 1}, :w => 2)
|
36
|
-
@coll.insert({:b => 2}, :w => 2)
|
37
|
-
@coll.insert({:c => 3}, :w => 2)
|
38
|
-
|
39
|
-
# Pin reader
|
40
|
-
@coll.find_one
|
54
|
+
insert_docs
|
41
55
|
|
42
56
|
# Setup Direct Connections
|
43
57
|
@primary = Mongo::MongoClient.new(*@client.manager.primary)
|
44
|
-
@read = Mongo::MongoClient.new(*@client.manager.read_pool(route_read).host_port)
|
45
58
|
end
|
46
59
|
|
47
|
-
def
|
48
|
-
|
60
|
+
def insert_docs
|
61
|
+
@n_docs = 102 # batch size is 101
|
62
|
+
@n_docs.times do |i|
|
63
|
+
@coll.insert({ "x" => i }, :w => 3)
|
64
|
+
end
|
49
65
|
end
|
50
66
|
|
51
|
-
def
|
52
|
-
|
67
|
+
def set_read_client_and_tag(read)
|
68
|
+
read_opts = {:read => read}
|
69
|
+
@tag = (0...3).map{|i|i.to_s}.detect do |tag|
|
70
|
+
begin
|
71
|
+
read_opts[:tag_sets] = [{:node => tag}] unless read == :primary
|
72
|
+
cursor = @coll.find({}, read_opts)
|
73
|
+
cursor.next
|
74
|
+
pool = cursor.instance_variable_get(:@pool)
|
75
|
+
cursor.close
|
76
|
+
@read = Mongo::MongoClient.new(pool.host, pool.port, :slave_ok => true)
|
77
|
+
tag
|
78
|
+
rescue Mongo::ConnectionFailure
|
79
|
+
false
|
80
|
+
end
|
81
|
+
end
|
53
82
|
end
|
54
83
|
|
55
|
-
def
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
84
|
+
def route_query(read)
|
85
|
+
read_opts = {:read => read}
|
86
|
+
read_opts[:tag_sets] = [{:node => @tag}] unless read == :primary
|
87
|
+
object_id = BSON::ObjectId.new
|
88
|
+
read_opts[:comment] = object_id
|
89
|
+
|
90
|
+
# set profiling level to 2 on client and member to which the query will be routed
|
91
|
+
@client.db(MONGO_TEST_DB).profiling_level = :all
|
92
|
+
@client.secondaries.each do |node|
|
93
|
+
node = Mongo::MongoClient.new(node[0], node[1], :slave_ok => true)
|
94
|
+
node.db(MONGO_TEST_DB).profiling_level = :all
|
95
|
+
end
|
96
|
+
|
97
|
+
@cursor = @coll.find({}, read_opts)
|
98
|
+
@cursor.next
|
99
|
+
|
100
|
+
# on client and other members set profiling level to 0
|
101
|
+
@client.db(MONGO_TEST_DB).profiling_level = :off
|
102
|
+
@client.secondaries.each do |node|
|
103
|
+
node = Mongo::MongoClient.new(node[0], node[1], :slave_ok => true)
|
104
|
+
node.db(MONGO_TEST_DB).profiling_level = :off
|
105
|
+
end
|
106
|
+
# do a query on system.profile of the reader to see if it was used for the query
|
107
|
+
profiled_queries = @read.db(MONGO_TEST_DB).collection('system.profile').find({
|
108
|
+
'ns' => "#{MONGO_TEST_DB}.cursor_tests", "query.$comment" => object_id })
|
109
|
+
|
110
|
+
assert_equal 1, profiled_queries.count
|
111
|
+
end
|
61
112
|
|
62
|
-
|
63
|
-
|
64
|
-
|
113
|
+
# batch from send_initial_query is 101 documents
|
114
|
+
# check that you get n_docs back from the query, with the same port
|
115
|
+
def cursor_get_more_test(read=:primary)
|
116
|
+
set_read_client_and_tag(read)
|
117
|
+
10.times do
|
118
|
+
# assert that the query went to the correct member
|
119
|
+
route_query(read)
|
120
|
+
docs_count = 1
|
121
|
+
port = @cursor.instance_variable_get(:@pool).port
|
122
|
+
assert @cursor.alive?
|
123
|
+
while @cursor.has_next?
|
124
|
+
docs_count += 1
|
125
|
+
@cursor.next
|
126
|
+
assert_equal port, @cursor.instance_variable_get(:@pool).port
|
127
|
+
end
|
128
|
+
assert !@cursor.alive?
|
129
|
+
assert_equal @n_docs, docs_count
|
130
|
+
@cursor.close #cursor is already closed
|
131
|
+
end
|
132
|
+
end
|
65
133
|
|
66
|
-
|
67
|
-
|
68
|
-
|
134
|
+
# batch from get_more can be huge, so close after send_initial_query
|
135
|
+
def kill_cursor_test(read=:primary)
|
136
|
+
set_read_client_and_tag(read)
|
137
|
+
10.times do
|
138
|
+
# assert that the query went to the correct member
|
139
|
+
route_query(read)
|
140
|
+
cursor_id = @cursor.cursor_id
|
141
|
+
cursor_clone = @cursor.clone
|
142
|
+
assert_equal cursor_id, cursor_clone.cursor_id
|
143
|
+
assert @cursor.instance_variable_get(:@pool)
|
144
|
+
# .next was called once already and leave one for get more
|
145
|
+
(@n_docs-2).times { @cursor.next }
|
146
|
+
@cursor.close
|
147
|
+
# an exception confirms the cursor has indeed been closed
|
148
|
+
assert_raise Mongo::OperationFailure do
|
149
|
+
cursor_clone.next
|
150
|
+
end
|
151
|
+
end
|
69
152
|
end
|
70
153
|
|
71
|
-
|
154
|
+
def assert_cursors_on_members(read=:primary)
|
155
|
+
set_read_client_and_tag(read)
|
156
|
+
# assert that the query went to the correct member
|
157
|
+
route_query(read)
|
158
|
+
cursor_id = @cursor.cursor_id
|
159
|
+
cursor_clone = @cursor.clone
|
160
|
+
assert_equal cursor_id, cursor_clone.cursor_id
|
161
|
+
assert @cursor.instance_variable_get(:@pool)
|
162
|
+
port = @cursor.instance_variable_get(:@pool).port
|
163
|
+
while @cursor.has_next?
|
164
|
+
@cursor.next
|
165
|
+
assert_equal port, @cursor.instance_variable_get(:@pool).port
|
166
|
+
end
|
167
|
+
# an exception confirms the cursor has indeed been closed after query
|
168
|
+
assert_raise Mongo::OperationFailure do
|
169
|
+
cursor_clone.next
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
@@ -15,7 +15,7 @@ class ReplicaSetInsertTest < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_insert
|
18
|
-
@coll.save({:a => 20}, :w =>
|
18
|
+
@coll.save({:a => 20}, :w => 3)
|
19
19
|
|
20
20
|
@rs.primary.stop
|
21
21
|
|
@@ -40,7 +40,7 @@ class ReplicaSetInsertTest < Test::Unit::TestCase
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
@coll.save({:a => 80}, :w =>
|
43
|
+
@coll.save({:a => 80}, :w => 3)
|
44
44
|
@coll.find.each {|r| results << r}
|
45
45
|
[20, 30, 40, 50, 60, 70, 80].each do |a|
|
46
46
|
assert results.any? {|r| r['a'] == a}, "Could not find record for a => #{a} on second find"
|
@@ -15,9 +15,9 @@ class ReplicaSetQueryTest < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_query
|
18
|
-
@coll.save({:a => 20}, :w =>
|
19
|
-
@coll.save({:a => 30}, :w =>
|
20
|
-
@coll.save({:a => 40}, :w =>
|
18
|
+
@coll.save({:a => 20}, :w => 3)
|
19
|
+
@coll.save({:a => 30}, :w => 3)
|
20
|
+
@coll.save({:a => 40}, :w => 3)
|
21
21
|
results = []
|
22
22
|
@coll.find.each {|r| results << r}
|
23
23
|
[20, 30, 40].each do |a|
|
@@ -43,7 +43,7 @@ class ReplicaSetQueryTest < Test::Unit::TestCase
|
|
43
43
|
# primary, where it does not exist.
|
44
44
|
# def test_secondary_getmore
|
45
45
|
# 200.times do |i|
|
46
|
-
# @coll.save({:a => i}, :w =>
|
46
|
+
# @coll.save({:a => i}, :w => 3)
|
47
47
|
# end
|
48
48
|
# as = []
|
49
49
|
# # Set an explicit batch size, in case the default ever changes.
|
@@ -8,40 +8,51 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_connect_and_manual_refresh_with_secondaries_down
|
11
|
-
@rs.secondaries.
|
11
|
+
num_secondaries = @rs.secondaries.size
|
12
12
|
client = MongoReplicaSetClient.new(@rs.repl_set_seeds, :refresh_mode => false)
|
13
13
|
|
14
|
-
assert_equal
|
14
|
+
assert_equal num_secondaries, client.secondaries.size
|
15
15
|
assert client.connected?
|
16
16
|
assert_equal client.read_pool, client.primary_pool
|
17
17
|
|
18
|
-
|
18
|
+
@rs.secondaries.each {|s| s.stop}
|
19
|
+
|
19
20
|
client.refresh
|
20
|
-
|
21
|
+
assert client.secondaries.empty?
|
21
22
|
assert client.connected?
|
22
23
|
assert_equal client.read_pool, client.primary_pool
|
23
24
|
|
24
25
|
# Test no changes after restart until manual refresh
|
25
26
|
@rs.restart
|
26
|
-
|
27
|
+
assert client.secondaries.empty?
|
27
28
|
assert client.connected?
|
28
29
|
assert_equal client.read_pool, client.primary_pool
|
29
30
|
|
30
31
|
# Refresh and ensure state
|
31
32
|
client.refresh
|
32
33
|
assert_equal client.read_pool, client.primary_pool
|
33
|
-
assert_equal
|
34
|
+
assert_equal num_secondaries, client.secondaries.size
|
34
35
|
end
|
35
36
|
|
36
37
|
def test_automated_refresh_with_secondaries_down
|
37
|
-
@rs.secondaries.
|
38
|
+
num_secondaries = @rs.secondaries.size
|
38
39
|
client = MongoReplicaSetClient.new(@rs.repl_set_seeds,
|
39
40
|
:refresh_interval => 1, :refresh_mode => :sync, :read => :secondary_preferred)
|
40
41
|
|
41
42
|
# Ensure secondaries not available and read from primary
|
42
|
-
assert_equal
|
43
|
+
assert_equal num_secondaries, client.secondaries.size
|
43
44
|
assert client.connected?
|
44
|
-
assert client.
|
45
|
+
assert client.secondary_pools.include?(client.read_pool)
|
46
|
+
|
47
|
+
@rs.secondaries.each{|s| s.stop}
|
48
|
+
sleep(2)
|
49
|
+
|
50
|
+
client['foo']['bar'].find_one
|
51
|
+
|
52
|
+
assert client.secondaries.empty?
|
53
|
+
assert client.connected?
|
54
|
+
assert_equal client.read_pool, client.primary_pool
|
55
|
+
|
45
56
|
old_refresh_version = client.refresh_version
|
46
57
|
|
47
58
|
# Restart nodes and ensure refresh interval has passed
|
@@ -56,7 +67,7 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
|
|
56
67
|
|
57
68
|
assert client.refresh_version > old_refresh_version,
|
58
69
|
"Refresh version hasn't changed."
|
59
|
-
|
70
|
+
assert_equal num_secondaries, client.secondaries.size
|
60
71
|
"No secondaries have been added."
|
61
72
|
assert client.manager.read_pool != client.manager.primary,
|
62
73
|
"Read pool and primary pool are identical."
|
@@ -66,11 +77,11 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
|
|
66
77
|
client = MongoReplicaSetClient.new(@rs.repl_set_seeds,
|
67
78
|
:refresh_interval => 1, :refresh_mode => :sync)
|
68
79
|
|
69
|
-
num_secondaries = client.secondary_pools.
|
80
|
+
num_secondaries = client.secondary_pools.size
|
70
81
|
old_refresh_version = client.refresh_version
|
71
82
|
|
72
|
-
@rs.
|
73
|
-
sleep(
|
83
|
+
@rs.stop_secondary
|
84
|
+
sleep(2)
|
74
85
|
|
75
86
|
assert client.refresh_version == old_refresh_version,
|
76
87
|
"Refresh version has changed."
|
@@ -79,16 +90,16 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
|
|
79
90
|
|
80
91
|
assert client.refresh_version > old_refresh_version,
|
81
92
|
"Refresh version hasn't changed."
|
82
|
-
assert_equal num_secondaries - 1, client.secondaries.
|
83
|
-
assert_equal num_secondaries - 1, client.secondary_pools.
|
93
|
+
assert_equal num_secondaries - 1, client.secondaries.size
|
94
|
+
assert_equal num_secondaries - 1, client.secondary_pools.size
|
84
95
|
|
85
|
-
@rs.
|
96
|
+
@rs.restart
|
86
97
|
sleep(2)
|
87
98
|
|
88
99
|
client['foo']['bar'].find_one
|
89
100
|
|
90
|
-
assert_equal num_secondaries, client.secondaries.
|
91
|
-
assert_equal num_secondaries, client.secondary_pools.
|
101
|
+
assert_equal num_secondaries, client.secondaries.size
|
102
|
+
assert_equal num_secondaries, client.secondary_pools.size
|
92
103
|
end
|
93
104
|
=begin
|
94
105
|
def test_automated_refresh_with_removed_node
|
@@ -23,13 +23,13 @@ class ReplicaSetAckTest < Test::Unit::TestCase
|
|
23
23
|
|
24
24
|
def test_safe_mode_with_w_failure
|
25
25
|
assert_raise_error OperationFailure, "timeout" do
|
26
|
-
@col.insert({:foo => 1}, :w =>
|
26
|
+
@col.insert({:foo => 1}, :w => 4, :wtimeout => 1, :fsync => true)
|
27
27
|
end
|
28
28
|
assert_raise_error OperationFailure, "timeout" do
|
29
|
-
@col.update({:foo => 1}, {:foo => 2}, :w =>
|
29
|
+
@col.update({:foo => 1}, {:foo => 2}, :w => 4, :wtimeout => 1, :fsync => true)
|
30
30
|
end
|
31
31
|
assert_raise_error OperationFailure, "timeout" do
|
32
|
-
@col.remove({:foo => 2}, :w =>
|
32
|
+
@col.remove({:foo => 2}, :w => 4, :wtimeout => 1, :fsync => true)
|
33
33
|
end
|
34
34
|
assert_raise_error OperationFailure do
|
35
35
|
@col.insert({:foo => 3}, :w => "test-tag")
|
@@ -37,35 +37,35 @@ class ReplicaSetAckTest < Test::Unit::TestCase
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_safe_mode_replication_ack
|
40
|
-
@col.insert({:baz => "bar"}, :w =>
|
40
|
+
@col.insert({:baz => "bar"}, :w => 3, :wtimeout => 5000)
|
41
41
|
|
42
|
-
assert @col.insert({:foo => "0" * 5000}, :w =>
|
42
|
+
assert @col.insert({:foo => "0" * 5000}, :w => 3, :wtimeout => 5000)
|
43
43
|
assert_equal 2, @slave1[MONGO_TEST_DB]["test-sets"].count
|
44
44
|
|
45
|
-
assert @col.update({:baz => "bar"}, {:baz => "foo"}, :w =>
|
45
|
+
assert @col.update({:baz => "bar"}, {:baz => "foo"}, :w => 3, :wtimeout => 5000)
|
46
46
|
assert @slave1[MONGO_TEST_DB]["test-sets"].find_one({:baz => "foo"})
|
47
47
|
|
48
48
|
assert @col.insert({:foo => "bar"}, :w => "majority")
|
49
49
|
|
50
50
|
assert @col.insert({:bar => "baz"}, :w => :majority)
|
51
51
|
|
52
|
-
assert @col.remove({}, :w =>
|
52
|
+
assert @col.remove({}, :w => 3, :wtimeout => 5000)
|
53
53
|
assert_equal 0, @slave1[MONGO_TEST_DB]["test-sets"].count
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_last_error_responses
|
57
57
|
20.times { @col.insert({:baz => "bar"}) }
|
58
|
-
response = @db.get_last_error(:w =>
|
58
|
+
response = @db.get_last_error(:w => 3, :wtimeout => 5000)
|
59
59
|
assert response['ok'] == 1
|
60
60
|
assert response['lastOp']
|
61
61
|
|
62
62
|
@col.update({}, {:baz => "foo"})
|
63
|
-
response = @db.get_last_error(:w =>
|
63
|
+
response = @db.get_last_error(:w => 3, :wtimeout => 5000)
|
64
64
|
assert response['ok'] == 1
|
65
65
|
assert response['lastOp']
|
66
66
|
|
67
67
|
@col.remove({})
|
68
|
-
response = @db.get_last_error(:w =>
|
68
|
+
response = @db.get_last_error(:w => 3, :wtimeout => 5000)
|
69
69
|
assert response['ok'] == 1
|
70
70
|
assert response['n'] == 20
|
71
71
|
assert response['lastOp']
|
data/test/test_helper.rb
CHANGED
@@ -7,6 +7,8 @@ if RUBY_VERSION >= '1.9.0' && RUBY_ENGINE == 'ruby'
|
|
7
7
|
add_group "Mongo", 'lib/mongo'
|
8
8
|
add_group "BSON", 'lib/bson'
|
9
9
|
add_filter "/test/"
|
10
|
+
merge_timeout 3600
|
11
|
+
command_name ENV['SIMPLECOV_COMMAND_NAME'] if ENV.has_key?('SIMPLECOV_COMMAND_NAME')
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/test/tools/mongo_config.rb
CHANGED
@@ -25,7 +25,7 @@ end
|
|
25
25
|
module Mongo
|
26
26
|
class Config
|
27
27
|
DEFAULT_BASE_OPTS = { :host => 'localhost', :dbpath => 'data', :logpath => 'data/log'}
|
28
|
-
DEFAULT_REPLICA_SET = DEFAULT_BASE_OPTS.merge( :replicas =>
|
28
|
+
DEFAULT_REPLICA_SET = DEFAULT_BASE_OPTS.merge( :replicas => 3, :arbiters => 0 )
|
29
29
|
DEFAULT_SHARDED_SIMPLE = DEFAULT_BASE_OPTS.merge( :shards => 2, :configs => 1, :routers => 4 )
|
30
30
|
DEFAULT_SHARDED_REPLICA = DEFAULT_SHARDED_SIMPLE.merge( :replicas => 3, :arbiters => 0)
|
31
31
|
|
@@ -354,7 +354,7 @@ module Mongo
|
|
354
354
|
|
355
355
|
def repl_set_config
|
356
356
|
members = []
|
357
|
-
@config[:replicas].each{|s| members << { :_id => s[:_id], :host => "#{s[:host]}:#{s[:port]}" } }
|
357
|
+
@config[:replicas].each{|s| members << { :_id => s[:_id], :host => "#{s[:host]}:#{s[:port]}", :tags => { :node => s[:_id].to_s } } }
|
358
358
|
@config[:arbiters].each{|s| members << { :_id => s[:_id], :host => "#{s[:host]}:#{s[:port]}", :arbiterOnly => true } }
|
359
359
|
{
|
360
360
|
:_id => @config[:replicas].first[:replSet],
|
@@ -442,12 +442,12 @@ module Mongo
|
|
442
442
|
members_by_name(secondary_names)
|
443
443
|
end
|
444
444
|
|
445
|
-
def
|
446
|
-
primary.
|
445
|
+
def stop_primary
|
446
|
+
primary.stop
|
447
447
|
end
|
448
448
|
|
449
|
-
def
|
450
|
-
secondaries[rand(secondaries.length)].
|
449
|
+
def stop_secondary
|
450
|
+
secondaries[rand(secondaries.length)].stop
|
451
451
|
end
|
452
452
|
|
453
453
|
def replicas
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.3.
|
5
|
-
prerelease: 6
|
4
|
+
version: 1.8.3.rc1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tyler Brock
|
@@ -13,52 +12,43 @@ authors:
|
|
13
12
|
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain:
|
16
|
-
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
bVdUUXFVZE5iTm9HeXd3anRWQldmRGR3RlY4UG8xWGNOL0F0cElMT0pRZDlK
|
39
|
-
NzdJTklHR0NIeFpvCjZTT0hIYU5rbmxFOUgwdzZxMFNWeFpLWkk4LysyYzQ0
|
40
|
-
N1YwTnJISXcxUWhlMHRBR0o5VjF1M2t5OGd5eGUwU00KOHY3ekxGMlhsaVli
|
41
|
-
ZnVyWUl3a2NYczh5UG44Z2dBcEJJeTliWDZWSnhScy9sMitVdnF6YUhJRmFG
|
42
|
-
eS9GOC9HUApSTlR1WHNWRzVOREFDbzdRCi0tLS0tRU5EIENFUlRJRklDQVRF
|
43
|
-
LS0tLS0K
|
44
|
-
date: 2013-02-14 00:00:00.000000000 Z
|
15
|
+
- |
|
16
|
+
-----BEGIN CERTIFICATE-----
|
17
|
+
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
|
18
|
+
ZXItcnVieTEVMBMGCgmSJomT8ixkARkWBTEwZ2VuMRMwEQYKCZImiZPyLGQBGRYD
|
19
|
+
Y29tMB4XDTEzMDIwMTE0MTEzN1oXDTE0MDIwMTE0MTEzN1owQjEUMBIGA1UEAwwL
|
20
|
+
ZHJpdmVyLXJ1YnkxFTATBgoJkiaJk/IsZAEZFgUxMGdlbjETMBEGCgmSJomT8ixk
|
21
|
+
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANFdSAa8fRm1
|
22
|
+
bAM9za6Z0fAH4g02bqM1NGnw8zJQrE/PFrFfY6IFCT2AsLfOwr1maVm7iU1+kdVI
|
23
|
+
IQ+iI/9+E+ArJ+rbGV3dDPQ+SLl3mLT+vXjfjcxMqI2IW6UuVtt2U3Rxd4QU0kdT
|
24
|
+
JxmcPYs5fDN6BgYc6XXgUjy3m+Kwha2pGctdciUOwEfOZ4RmNRlEZKCMLRHdFP8j
|
25
|
+
4WTnJSGfXDiuoXICJb5yOPOZPuaapPSNXp93QkUdsqdKC32I+KMpKKYGBQ6yisfA
|
26
|
+
5MyVPPCzLR1lP5qXVGJPnOqUAkvEUfCahg7EP9tI20qxiXrR6TSEraYhIFXL0EGY
|
27
|
+
u8KAcPHm5KkCAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUW3dZsX70mlSM
|
28
|
+
CiPrZxAGA1vwfNcwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQCIa/Y6
|
29
|
+
xS7YWBxkn9WP0EMnJ3pY9vef9DTmLSi/2jz8PzwlKQ89zNTrqSUD8LoQZmBqCJBt
|
30
|
+
dKSQ/RUnaHJuxh8HWvWubP8EBYTuf+I1DFnRv648IF3MR1tCQumVL0XcYMvZcxBj
|
31
|
+
a/p+8DomWTQqUdNbNoGywwjtVBWfDdwFV8Po1XcN/AtpILOJQd9J77INIGGCHxZo
|
32
|
+
6SOHHaNknlE9H0w6q0SVxZKZI8/+2c447V0NrHIw1Qhe0tAGJ9V1u3ky8gyxe0SM
|
33
|
+
8v7zLF2XliYbfurYIwkcXs8yPn8ggApBIy9bX6VJxRs/l2+UvqzaHIFaFy/F8/GP
|
34
|
+
RNTuXsVG5NDACo7Q
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2013-02-27 00:00:00.000000000 Z
|
45
37
|
dependencies:
|
46
38
|
- !ruby/object:Gem::Dependency
|
47
39
|
name: bson
|
48
40
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
41
|
requirements:
|
51
42
|
- - ~>
|
52
43
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.8.3.
|
44
|
+
version: 1.8.3.rc1
|
54
45
|
type: :runtime
|
55
46
|
prerelease: false
|
56
47
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
48
|
requirements:
|
59
49
|
- - ~>
|
60
50
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.8.3.
|
51
|
+
version: 1.8.3.rc1
|
62
52
|
description: A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.
|
63
53
|
email: mongodb-dev@googlegroups.com
|
64
54
|
executables:
|
@@ -149,7 +139,6 @@ files:
|
|
149
139
|
- test/replica_set/read_preference_test.rb
|
150
140
|
- test/replica_set/refresh_test.rb
|
151
141
|
- test/replica_set/replication_ack_test.rb
|
152
|
-
- test/replica_set/z_cluster_shutdown.rb
|
153
142
|
- test/sharded_cluster/basic_test.rb
|
154
143
|
- test/test_helper.rb
|
155
144
|
- test/threading/basic_test.rb
|
@@ -172,27 +161,26 @@ files:
|
|
172
161
|
- test/unit/write_concern_test.rb
|
173
162
|
homepage: http://www.mongodb.org
|
174
163
|
licenses: []
|
164
|
+
metadata: {}
|
175
165
|
post_install_message:
|
176
166
|
rdoc_options: []
|
177
167
|
require_paths:
|
178
168
|
- lib
|
179
169
|
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
-
none: false
|
181
170
|
requirements:
|
182
|
-
- -
|
171
|
+
- - '>='
|
183
172
|
- !ruby/object:Gem::Version
|
184
173
|
version: '0'
|
185
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
175
|
requirements:
|
188
|
-
- -
|
176
|
+
- - '>'
|
189
177
|
- !ruby/object:Gem::Version
|
190
178
|
version: 1.3.1
|
191
179
|
requirements: []
|
192
180
|
rubyforge_project: mongo
|
193
|
-
rubygems_version:
|
181
|
+
rubygems_version: 2.0.0
|
194
182
|
signing_key:
|
195
|
-
specification_version:
|
183
|
+
specification_version: 4
|
196
184
|
summary: Ruby driver for MongoDB
|
197
185
|
test_files:
|
198
186
|
- test/auxillary/1.4_feature_test.rb
|
@@ -241,7 +229,6 @@ test_files:
|
|
241
229
|
- test/replica_set/read_preference_test.rb
|
242
230
|
- test/replica_set/refresh_test.rb
|
243
231
|
- test/replica_set/replication_ack_test.rb
|
244
|
-
- test/replica_set/z_cluster_shutdown.rb
|
245
232
|
- test/sharded_cluster/basic_test.rb
|
246
233
|
- test/test_helper.rb
|
247
234
|
- test/threading/basic_test.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
# mock test case to shutdown cluster for rake test:replica_set, must be last by file name sort order
|
4
|
-
class ZClusterShutdownTest < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
ensure_cluster(:rs)
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_cluster_shutdown
|
10
|
-
@@force_shutdown = true
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|