mongo_ha 2.5.1 → 2.6.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
- data/README.md +2 -3
- data/lib/mongo_ha/retryable.rb +3 -3
- data/lib/mongo_ha/version.rb +1 -1
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 822b2ec13ca8329162bfaf447ca663ff229137dae3c62af4f49961214fc8cb7e
|
4
|
+
data.tar.gz: 4fbe1a4c3eb4eba1205fae605ba645dfee2afe2ca8bc4f2e7029fc6e2790f064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04d0fa19b81fc8344772def1a59fd59cd77ae4dbc0f66cf9580fbf76469f08513a0f209f479823572e4add5f1af8280c97e0b849e1d7d281c2e926ca39beeaee
|
7
|
+
data.tar.gz: 7bb1ac573453dd3cacdfeea55223e2b5010d6a98bdb7e20648754ad1cd748567d52bba225b59d6f19cad8e1892fc3050cfa84a85a12d676eed2f4eca21a67c02
|
data/README.md
CHANGED
@@ -9,11 +9,10 @@ Most of the features of this gem were accepted into the mongo-ruby-client gem. :
|
|
9
9
|
There are still a few outstanding changes that are only available with this gem:
|
10
10
|
* Retry on writes due to a master change.
|
11
11
|
* Retry on writes due to loss of network connectivity.
|
12
|
-
* Retry on reads during an operation failure other than when in a cluster.
|
13
12
|
|
14
13
|
## Note
|
15
14
|
|
16
|
-
It is recommended to use mongo_ha v2.
|
15
|
+
It is recommended to use `mongo_ha` v2.6 along with the Mongo Ruby Client v2.6 to get the latest HA capabilities.
|
17
16
|
|
18
17
|
## Overview
|
19
18
|
|
@@ -36,7 +35,7 @@ servers with reconnect attempts.
|
|
36
35
|
Add to Gemfile:
|
37
36
|
|
38
37
|
```ruby
|
39
|
-
gem 'mongo_ha', '~> 2.
|
38
|
+
gem 'mongo_ha', '~> 2.6'
|
40
39
|
```
|
41
40
|
|
42
41
|
Or for standalone environments
|
data/lib/mongo_ha/retryable.rb
CHANGED
@@ -2,21 +2,21 @@ require 'mongo/retryable'
|
|
2
2
|
|
3
3
|
module Mongo
|
4
4
|
module Retryable
|
5
|
-
def legacy_write_with_retry(server = nil)
|
5
|
+
def legacy_write_with_retry(server = nil, session = nil)
|
6
6
|
attempt = 0
|
7
7
|
begin
|
8
8
|
attempt += 1
|
9
9
|
yield(server || cluster.next_primary)
|
10
10
|
rescue Error::SocketError, Error::SocketTimeoutError => e
|
11
11
|
server = nil
|
12
|
-
raise(e) if attempt > cluster.max_read_retries
|
12
|
+
raise(e) if attempt > cluster.max_read_retries || (session && session.in_transaction?)
|
13
13
|
log_retry(e)
|
14
14
|
cluster.scan!
|
15
15
|
retry
|
16
16
|
rescue Error::OperationFailure => e
|
17
17
|
server = nil
|
18
18
|
raise(e) if attempt > cluster.max_read_retries
|
19
|
-
if e.write_retryable?
|
19
|
+
if e.write_retryable? && !(session && session.in_transaction?)
|
20
20
|
log_retry(e)
|
21
21
|
cluster.scan!
|
22
22
|
retry
|
data/lib/mongo_ha/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_ha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongo
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5.
|
19
|
+
version: 2.5.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.7'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.5.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
32
|
+
version: '2.7'
|
27
33
|
description: Automatic reconnects and recovery when replica-set changes, or connections
|
28
34
|
are lost, with transparent recovery
|
29
35
|
email:
|
@@ -57,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
63
|
version: '0'
|
58
64
|
requirements: []
|
59
65
|
rubyforge_project:
|
60
|
-
rubygems_version: 2.7.
|
66
|
+
rubygems_version: 2.7.7
|
61
67
|
signing_key:
|
62
68
|
specification_version: 4
|
63
69
|
summary: High availability for the mongo ruby driver
|