Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
010dbf6c
Unverified
Commit
010dbf6c
authored
Mar 18, 2024
by
felipe
Committed by
GitHub
Mar 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(proxyd): use a specific redis instance for consensus_ha (#9877)
parent
56f3d1b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
config.go
proxyd/config.go
+1
-0
proxyd.go
proxyd/proxyd.go
+7
-3
No files found.
proxyd/config.go
View file @
010dbf6c
...
@@ -123,6 +123,7 @@ type BackendGroupConfig struct {
...
@@ -123,6 +123,7 @@ type BackendGroupConfig struct {
ConsensusHA
bool
`toml:"consensus_ha"`
ConsensusHA
bool
`toml:"consensus_ha"`
ConsensusHAHeartbeatInterval
TOMLDuration
`toml:"consensus_ha_heartbeat_interval"`
ConsensusHAHeartbeatInterval
TOMLDuration
`toml:"consensus_ha_heartbeat_interval"`
ConsensusHALockPeriod
TOMLDuration
`toml:"consensus_ha_lock_period"`
ConsensusHALockPeriod
TOMLDuration
`toml:"consensus_ha_lock_period"`
ConsensusHARedis
RedisConfig
`toml:"consensus_ha_redis"`
}
}
type
BackendGroupsConfig
map
[
string
]
*
BackendGroupConfig
type
BackendGroupsConfig
map
[
string
]
*
BackendGroupConfig
...
...
proxyd/proxyd.go
View file @
010dbf6c
...
@@ -335,8 +335,8 @@ func Start(config *Config) (*Server, func(), error) {
...
@@ -335,8 +335,8 @@ func Start(config *Config) (*Server, func(), error) {
var
tracker
ConsensusTracker
var
tracker
ConsensusTracker
if
bgcfg
.
ConsensusHA
{
if
bgcfg
.
ConsensusHA
{
if
redisClient
==
nil
{
if
bgcfg
.
ConsensusHARedis
.
URL
==
""
{
log
.
Crit
(
"
cant start - consensus high availability requires redis
"
)
log
.
Crit
(
"
must specify a consensus_ha_redis config when consensus_ha is true
"
)
}
}
topts
:=
make
([]
RedisConsensusTrackerOpt
,
0
)
topts
:=
make
([]
RedisConsensusTrackerOpt
,
0
)
if
bgcfg
.
ConsensusHALockPeriod
>
0
{
if
bgcfg
.
ConsensusHALockPeriod
>
0
{
...
@@ -345,7 +345,11 @@ func Start(config *Config) (*Server, func(), error) {
...
@@ -345,7 +345,11 @@ func Start(config *Config) (*Server, func(), error) {
if
bgcfg
.
ConsensusHAHeartbeatInterval
>
0
{
if
bgcfg
.
ConsensusHAHeartbeatInterval
>
0
{
topts
=
append
(
topts
,
WithLockPeriod
(
time
.
Duration
(
bgcfg
.
ConsensusHAHeartbeatInterval
)))
topts
=
append
(
topts
,
WithLockPeriod
(
time
.
Duration
(
bgcfg
.
ConsensusHAHeartbeatInterval
)))
}
}
tracker
=
NewRedisConsensusTracker
(
context
.
Background
(),
redisClient
,
bg
,
bg
.
Name
,
topts
...
)
consensusHARedisClient
,
err
:=
NewRedisClient
(
bgcfg
.
ConsensusHARedis
.
URL
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
tracker
=
NewRedisConsensusTracker
(
context
.
Background
(),
consensusHARedisClient
,
bg
,
bg
.
Name
,
topts
...
)
copts
=
append
(
copts
,
WithTracker
(
tracker
))
copts
=
append
(
copts
,
WithTracker
(
tracker
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment