aerospike 2.21.1 → 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/aerospike/cluster.rb +6 -3
- data/lib/aerospike/command/admin_command.rb +1 -1
- data/lib/aerospike/command/command.rb +0 -6
- data/lib/aerospike/command/login_command.rb +3 -1
- data/lib/aerospike/connection/authenticate.rb +1 -1
- data/lib/aerospike/node_validator.rb +6 -1
- data/lib/aerospike/utils/buffer.rb +6 -0
- data/lib/aerospike/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ad4dc9000e94d5dc8b3c4404e2b68907ba935c196e4061a843f49ec8ad54378
|
4
|
+
data.tar.gz: b55b74f657f46946eccd2ea4005075424234c5d12fa5a9bf77416870c2246928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37a3fb668569cbe8ff16318847cd99588f7d54afd342f3d45e397bcf2a241d44c7b1f3f5b2cfe6d98978b65d0babf812d6d51bb5051d9cc6a1aef43845e48c65
|
7
|
+
data.tar.gz: 3c13ca332594f6edc7cafb4eb68aa996afca8d09436053c31f0faf97b3005f011fa97afeb037aa17bc3a0bc9fcb48cfdad22a20639860dada568433055d47d09
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [2.22.0] 2022-07-14
|
6
|
+
|
7
|
+
* **Fixes**
|
8
|
+
* [CLIENT-1785] Fix Client#read_users to avoid error. PR #112 Thanks to [Dotan Mor](https://github.com/dotan-mor)
|
9
|
+
* [CLIENT-1787] Support multiple DNS IPs during connection.
|
10
|
+
* [CLIENT-1789] Authentication Retry fails in certain conditions.
|
11
|
+
|
5
12
|
## [2.21.1] - 2022-06-21
|
6
13
|
|
7
14
|
This s hotfix release. It is recommended to upgrade your client if you use authentication.
|
data/lib/aerospike/cluster.rb
CHANGED
@@ -463,7 +463,7 @@ module Aerospike
|
|
463
463
|
count = -1
|
464
464
|
done = false
|
465
465
|
|
466
|
-
# will run until the cluster is
|
466
|
+
# will run until the cluster is stabilized
|
467
467
|
thr = Thread.new do
|
468
468
|
loop do
|
469
469
|
tend
|
@@ -475,14 +475,17 @@ module Aerospike
|
|
475
475
|
# Break if timed out
|
476
476
|
break if done
|
477
477
|
|
478
|
-
sleep(0.001) # sleep for a
|
478
|
+
sleep(0.001) # sleep for a millisecond
|
479
479
|
|
480
480
|
count = nodes.length
|
481
481
|
end
|
482
482
|
end
|
483
483
|
|
484
484
|
# wait for the thread to finish or timeout
|
485
|
-
|
485
|
+
# This will give the client up to 10 times the timeout duration to find
|
486
|
+
# a host and connect successfully eventually, in case the DNS
|
487
|
+
# returns multiple IPs and some of them are not reachable.
|
488
|
+
thr.join(@connection_timeout * 10)
|
486
489
|
done = true
|
487
490
|
sleep(0.001)
|
488
491
|
thr.kill if thr.alive?
|
@@ -840,12 +840,6 @@ module Aerospike
|
|
840
840
|
end
|
841
841
|
|
842
842
|
def size_buffer_sz(size)
|
843
|
-
# Corrupted data streams can result in a hug.length.
|
844
|
-
# Do a sanity check here.
|
845
|
-
if size > Buffer::MAX_BUFFER_SIZE
|
846
|
-
raise Aerospike::Exceptions::Parse.new("Invalid size for buffer: #{size}")
|
847
|
-
end
|
848
|
-
|
849
843
|
@data_buffer.resize(size)
|
850
844
|
end
|
851
845
|
|
@@ -38,6 +38,7 @@ module Aerospike
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def authenticate_new(conn, cluster)
|
41
|
+
@data_offset = 8
|
41
42
|
policy = cluster.client_policy
|
42
43
|
case policy.auth_mode
|
43
44
|
when Aerospike::AuthMode::EXTERNAL
|
@@ -125,6 +126,7 @@ module Aerospike
|
|
125
126
|
end
|
126
127
|
|
127
128
|
def authenticate_via_token(conn, cluster)
|
129
|
+
@data_offset = 8
|
128
130
|
policy = cluster.client_policy
|
129
131
|
if policy.auth_mode != Aerospike::AuthMode::PKI
|
130
132
|
write_header(AUTHENTICATE, 2)
|
@@ -144,7 +146,7 @@ module Aerospike
|
|
144
146
|
receive_size = (size & 0xFFFFFFFFFFFF) - HEADER_REMAINING
|
145
147
|
conn.read(@data_buffer, receive_size)
|
146
148
|
|
147
|
-
if result != 0
|
149
|
+
if result != 0
|
148
150
|
return if result == Aerospike::ResultCode::SECURITY_NOT_ENABLED
|
149
151
|
raise Exceptions::Aerospike.new(result, "Authentication failed")
|
150
152
|
end
|
@@ -40,6 +40,7 @@ module Aerospike
|
|
40
40
|
|
41
41
|
def get_hosts(address)
|
42
42
|
aliases = [get_alias(address, host.port)]
|
43
|
+
res = []
|
43
44
|
|
44
45
|
begin
|
45
46
|
conn = Cluster::CreateConnection.(@cluster, Host.new(address, host.port, host.tls_name))
|
@@ -61,11 +62,15 @@ module Aerospike
|
|
61
62
|
unless is_loopback?(address)
|
62
63
|
aliases = info_map[address_command].split(',').map { |addr| get_alias(*addr.split(':')) }
|
63
64
|
end
|
65
|
+
|
66
|
+
res = aliases.map { |al| Host.new(al[:address], al[:port], host.tls_name) }
|
67
|
+
rescue
|
68
|
+
# we don't care about the actual connection error; Just need to continue
|
64
69
|
ensure
|
65
70
|
conn.close if conn
|
66
71
|
end
|
67
72
|
|
68
|
-
|
73
|
+
res
|
69
74
|
end
|
70
75
|
|
71
76
|
def get_alias(address, port)
|
@@ -67,6 +67,12 @@ module Aerospike
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def resize(length)
|
70
|
+
# Corrupted data streams can result in a hug.length.
|
71
|
+
# Do a sanity check here.
|
72
|
+
if length > MAX_BUFFER_SIZE
|
73
|
+
raise Aerospike::Exceptions::Parse.new("Invalid size for buffer: #{length}")
|
74
|
+
end
|
75
|
+
|
70
76
|
if @buf.bytesize < length
|
71
77
|
@buf.concat("%0#{length - @buf.bytesize}d" % 0)
|
72
78
|
end
|
data/lib/aerospike/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aerospike
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Khosrow Afroozeh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|