Skip to content

Commit

Permalink
feat: tools-2967 Support Aerospike Database 7.2. (#44)
Browse files Browse the repository at this point in the history
* build(deps): tools-2967 update schema submodule to include Aerospike 7.2 schema

* build(deps): tools-2967 update management-lib to support server 7.2 configs

* ci: tools-2967  add server 7.2 test case

---------

Co-authored-by: Akash Chandra <[email protected]>
  • Loading branch information
dwelch-spike and a-spiker authored Sep 6, 2024
1 parent 14171d6 commit f13b744
Show file tree
Hide file tree
Showing 11 changed files with 219 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func loadAsConf(log logr.Logger, src []byte) (*asconfig.AsConfig, error) {

// TODO: Why doesn't the management lib do the map mutation? FromConfFile
// implies it does.
c, err := asconfig.FromConfFile(log, "", reader) // TODO: Remove "" when management lib merges PR #41
c, err := asconfig.FromConfFile(log, reader)
if err != nil {
return nil, fmt.Errorf("failed to parse asconfig file: %w", err)
}
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.21.7

require (
github.com/aerospike/aerospike-client-go/v7 v7.2.1
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240418222400-0d7c09d1b513
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240906065448-a8c2fffd7822
github.com/aerospike/tools-common-go v0.0.0-20240425222921-596724ec5926
github.com/bombsimon/logrusr/v4 v4.1.0
github.com/docker/docker v26.1.0+incompatible
Expand Down Expand Up @@ -69,5 +69,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/apimachinery v0.29.0 // indirect
)
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ github.com/aerospike/aerospike-client-go/v7 v7.2.1 h1:4A6CxgJMRlDnHx4ycyJ1a5lUzx
github.com/aerospike/aerospike-client-go/v7 v7.2.1/go.mod h1:sKfNsnAKgkGtAlYxdgWNOJm3ykm49s/p6xjEB/cX8/k=
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240418222400-0d7c09d1b513 h1:mqaKimj6pWkZaIWTMnoj1kSuzExUATwGa4FEO2L6NI0=
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240418222400-0d7c09d1b513/go.mod h1:o1TV3BTsAiuZ5HtZi9E4FgXqWRwjDzlkS4bfvfaAHLU=
github.com/aerospike/aerospike-management-lib v1.4.0 h1:wT0l3kwzXv5DV5Cd+hD0BQq3hjSIyaPX1HaUb1304TI=
github.com/aerospike/aerospike-management-lib v1.4.0/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240905090951-8ea933d560b0 h1:9GKn8wHq4NYR5n6Wc7iMzKPRvFmAGAEUdvV+Ksu46Ww=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240905090951-8ea933d560b0/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240906064606-6e4a29134fcf h1:euE/wjWK/MWAS32XKY7uZ/Ty2RSSvODyMxDgzau+kEo=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240906064606-6e4a29134fcf/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240906065448-a8c2fffd7822 h1:l/Bbw4Wb5CPAOscP7t2vGsMr40CSaHSC3s3F1Q1HkzQ=
github.com/aerospike/aerospike-management-lib v1.4.1-0.20240906065448-a8c2fffd7822/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/aerospike/tools-common-go v0.0.0-20240425222921-596724ec5926 h1:CqkNasGC/7x5JvYjCSuAVX/rG+nUgRQtXfxIURXo5OE=
github.com/aerospike/tools-common-go v0.0.0-20240425222921-596724ec5926/go.mod h1:Ig1lRynXx0tXNOY3MdtanTsKz1ifG/2AyDFMXn3RMTc=
github.com/bombsimon/logrusr/v4 v4.1.0 h1:uZNPbwusB0eUXlO8hIUwStE6Lr5bLN6IgYgG+75kuh4=
Expand Down Expand Up @@ -206,6 +214,8 @@ google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand All @@ -214,3 +224,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o=
k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis=
2 changes: 1 addition & 1 deletion schema/schemas
2 changes: 0 additions & 2 deletions testdata/cases/server71/server71.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ namespace ns1 {
index-type shmem
sindex-type shmem

evict-sys-memory-pct 80

default-read-touch-ttl-pct 50

storage-engine memory {
Expand Down
1 change: 0 additions & 1 deletion testdata/cases/server71/server71.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespaces:
type: device
- default-read-touch-ttl-pct: 50
evict-indexes-memory-pct: 50
evict-sys-memory-pct: 80
index-type:
type: shmem
indexes-memory-budget: 2147483648
Expand Down
12 changes: 12 additions & 0 deletions testdata/cases/server72/conf-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"Source":"testdata/cases/server71/server71.conf",
"Destination":"testdata/cases/server71/server71-res-.yaml",
"Expected":"testdata/cases/server71/server71.yaml",
"Arguments":["convert","--aerospike-version","7.1.0.0","--format","asconfig","--output","testdata/cases/server71/server71-res-.yaml"],
"SkipServerTest":false,
"ServerErrorAllowList":null,
"ServerImage":"aerospike.jfrog.io/docker-remote/aerospike/aerospike-server-enterprise-rc:7.1.0.0-rc3",
"DockerAuth":{"Username":"ASC_DOCKER_USER","Password":"ASC_DOCKER_PASS"}
}
]
103 changes: 103 additions & 0 deletions testdata/cases/server72/server72.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@

service {
cluster-name cl1

user root
group root
pidfile /dummy/file/path1

batch-max-requests 1000
tls-refresh-period 300S
}

logging {
console {
context any info
}
}

network {
service {
address any
port 3000
}

heartbeat {
mode multicast
multicast-group 127.0.0.1
port 9918




interval 150
timeout 10
}

fabric {
port 3001
}

info {
port 3003
}
}

namespace ns1 {
replication-factor 2

index-type shmem
sindex-type shmem

default-read-touch-ttl-pct 50

storage-engine memory {
data-size 32G
}

evict-indexes-memory-pct 50

indexes-memory-budget 2147483648

nsup-period 2048

set s1 {
default-read-touch-ttl-pct -1
}

active-rack 2
}

namespace ns2 {
replication-factor 2
index-type shmem
sindex-type shmem
default-read-touch-ttl-pct 0
storage-engine device {
device /dummy/mount/point1
evict-used-pct 70
stop-writes-used-pct 70
stop-writes-avail-pct 20
flush-size 2M

}

set s2 {
default-read-touch-ttl-pct 50
}
}

security {
default-password-file /dummy/file/path2
}

xdr {
dc dataCenter1 {
node-address-port 127.0.0.1 3000
namespace ns1 {
remote-namespace ns2
restrict-version-skipping true
skip-versions-within 2M
}
}
}
74 changes: 74 additions & 0 deletions testdata/cases/server72/server72.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
logging:
- any: info
name: console
namespaces:
- default-read-touch-ttl-pct: 0
index-type:
type: shmem
name: ns2
replication-factor: 2
sets:
- default-read-touch-ttl-pct: 50
name: s2
sindex-type:
type: shmem
storage-engine:
devices:
- /dummy/mount/point1
evict-used-pct: 70
flush-size: 2097152
stop-writes-avail-pct: 20
stop-writes-used-pct: 70
type: device
- active-rack: 2
default-read-touch-ttl-pct: 50
evict-indexes-memory-pct: 50
index-type:
type: shmem
indexes-memory-budget: 2147483648
name: ns1
nsup-period: 2048
replication-factor: 2
sets:
- default-read-touch-ttl-pct: -1
name: s1
sindex-type:
type: shmem
storage-engine:
data-size: 34359738368
type: memory
network:
fabric:
port: 3001
heartbeat:
interval: 150
mode: multicast
multicast-groups:
- 127.0.0.1
port: 9918
timeout: 10
info:
port: 3003
service:
addresses:
- any
port: 3000
security:
default-password-file: /dummy/file/path2
service:
batch-max-requests: 1000
cluster-name: cl1
group: root
pidfile: /dummy/file/path1
tls-refresh-period: 300
user: root
xdr:
dcs:
- name: dataCenter1
namespaces:
- name: ns1
remote-namespace: ns2
restrict-version-skipping: true
skip-versions-within: 120
node-address-ports:
- 127.0.0.1:3000
1 change: 1 addition & 0 deletions testdata/cases/server72/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"TestedVersion":"7.2.0.0-rc1","OriginallyUsedVersion":"7.2.0.0-rc1"}
12 changes: 12 additions & 0 deletions testdata/cases/server72/yaml-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"Source":"testdata/cases/server72/server72.yaml",
"Destination":"testdata/cases/server72/server72-res-.conf",
"Expected":"testdata/cases/server72/server72.conf",
"Arguments":["convert","--aerospike-version","7.2.0.0","--format","yaml","--output","testdata/cases/server72/server72-res-.conf"],
"SkipServerTest":false,
"ServerErrorAllowList":null,
"ServerImage":"aerospike.jfrog.io/docker-remote/aerospike/aerospike-server-enterprise-rc:7.2.0.0-rc1",
"DockerAuth":{"Username":"ASC_DOCKER_USER","Password":"ASC_DOCKER_PASS"}
}
]

0 comments on commit f13b744

Please sign in to comment.