Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
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
tsai
StackExchange.Redis
Commits
aa198df8
Commit
aa198df8
authored
May 08, 2017
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply per-primary round-robin when selecting replicas - fix #610
parent
d33ccfab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+4
-0
ServerSelectionStrategy.cs
...ange.Redis/StackExchange/Redis/ServerSelectionStrategy.cs
+4
-2
ReleaseNotes.md
docs/ReleaseNotes.md
+4
-0
No files found.
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
aa198df8
...
...
@@ -341,6 +341,10 @@ internal void AutoConfigure(PhysicalConnection connection)
}
}
int
_nextReplicaOffset
;
internal
uint
NextReplicaOffset
()
// used to round-robin between multiple replicas
=>
(
uint
)
System
.
Threading
.
Interlocked
.
Increment
(
ref
_nextReplicaOffset
);
internal
Task
Close
()
{
var
tmp
=
interactive
;
...
...
StackExchange.Redis/StackExchange/Redis/ServerSelectionStrategy.cs
View file @
aa198df8
...
...
@@ -240,9 +240,11 @@ private ServerEndPoint FindSlave(ServerEndPoint endpoint, RedisCommand command)
if
(
endpoint
.
IsSlave
&&
endpoint
.
IsSelectable
(
command
))
return
endpoint
;
var
slaves
=
endpoint
.
Slaves
;
for
(
int
i
=
0
;
i
<
slaves
.
Length
;
i
++)
var
len
=
slaves
.
Length
;
uint
startOffset
=
len
<=
1
?
0
:
endpoint
.
NextReplicaOffset
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
endpoint
=
slaves
[
i
];
endpoint
=
slaves
[
(
int
)(((
uint
)
i
+
startOffset
)
%
len
)
];
if
(
endpoint
.
IsSlave
&&
endpoint
.
IsSelectable
(
command
))
return
endpoint
;
}
return
null
;
...
...
docs/ReleaseNotes.md
View file @
aa198df8
# Release Notes
## 1.2.3
-
fix: when using
`redis-cluster`
with multiple replicas, use round-robin when selecting replica (#610)
## 1.2.2 (preview):
-
**UNAVAILABLE**
: .NET 4.0 support is not in this build, due to
[
a build issue
](
https://github.com/dotnet/cli/issues/5993
)
- looking into solutions
...
...
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