moped 1.5.2 → 1.5.3
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
- data/lib/moped/bson/object_id.rb +1 -1
- data/lib/moped/cluster.rb +3 -0
- data/lib/moped/errors.rb +1 -1
- data/lib/moped/node.rb +12 -1
- data/lib/moped/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76d85fae38ea0ef7558bf6961c620082e3792f8c
|
4
|
+
data.tar.gz: c166d20629d965e0db7dfba2a91b758eaba55083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7027124e3caefcc77952ae0f8af98690f877b67ae759a175fdd79b65c4e4b063106a15b3fdda1163ab3e506e4778e22833eae70abed95b7e88286ee4abee6508
|
7
|
+
data.tar.gz: 0a0eb20add7205c06e78be13f82861dc999a37376bf7f7de3d68f10853152c11853a217b25b43f7bbeb9247dfef6d292014feb416c8481691a3d7b6fcb4d96f1
|
data/lib/moped/bson/object_id.rb
CHANGED
data/lib/moped/cluster.rb
CHANGED
@@ -253,6 +253,9 @@ module Moped
|
|
253
253
|
warning(" MOPED: Connection failed to secondary node #{node.inspect}, trying next node.")
|
254
254
|
# That node's no good, so let's try the next one.
|
255
255
|
next
|
256
|
+
rescue Errors::ReplicaSetReconfigured
|
257
|
+
# That node's no good, so let's try the next one.
|
258
|
+
next
|
256
259
|
end
|
257
260
|
end
|
258
261
|
|
data/lib/moped/errors.rb
CHANGED
@@ -103,7 +103,7 @@ module Moped
|
|
103
103
|
NOT_MASTER = [ 13435, 13436, 10009]
|
104
104
|
|
105
105
|
# Error codes received around reconfiguration
|
106
|
-
CONNECTION_ERRORS_RECONFIGURATION = [ 15988, 10276, 11600, 9001 ]
|
106
|
+
CONNECTION_ERRORS_RECONFIGURATION = [ 15988, 10276, 11600, 9001, 13639, 10009, 11002 ]
|
107
107
|
|
108
108
|
# Replica set reconfigurations can be either in the form of an operation
|
109
109
|
# error with code 13435, or with an error message stating the server is
|
data/lib/moped/node.rb
CHANGED
@@ -502,7 +502,18 @@ module Moped
|
|
502
502
|
authenticate = Protocol::Commands::Authenticate.new(database, username, password, result["nonce"])
|
503
503
|
connection.write [authenticate]
|
504
504
|
result = connection.read.documents.first
|
505
|
-
|
505
|
+
|
506
|
+
unless result["ok"] == 1
|
507
|
+
# See if we had connectivity issues so we can retry
|
508
|
+
e = Errors::PotentialReconfiguration.new(authenticate, result)
|
509
|
+
if e.reconfiguring_replica_set?
|
510
|
+
raise Errors::ReplicaSetReconfigured.new(e.command, e.details)
|
511
|
+
elsif e.connection_failure?
|
512
|
+
raise Errors::ConnectionFailure.new(e.inspect)
|
513
|
+
end
|
514
|
+
|
515
|
+
raise Errors::AuthenticationFailure.new(authenticate, result)
|
516
|
+
end
|
506
517
|
auth[database] = [username, password]
|
507
518
|
end
|
508
519
|
|
data/lib/moped/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moped
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernerd Schaefer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A MongoDB driver for Ruby.
|
14
14
|
email:
|
@@ -83,17 +83,17 @@ require_paths:
|
|
83
83
|
- lib
|
84
84
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.2.
|
96
|
+
rubygems_version: 2.2.2
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: A MongoDB driver for Ruby.
|