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
d44b99f8
Commit
d44b99f8
authored
Jan 20, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #117 from stepaside/master
Added ability to write to a non-readonly slave
parents
dbe1c4d0
247d08a9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
IServer.cs
StackExchange.Redis/StackExchange/Redis/IServer.cs
+6
-1
PhysicalBridge.cs
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
+1
-1
RedisServer.cs
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
+6
-0
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+2
-0
No files found.
StackExchange.Redis/StackExchange/Redis/IServer.cs
View file @
d44b99f8
...
...
@@ -37,6 +37,11 @@ public partial interface IServer : IRedis
/// </summary>
bool
IsSlave
{
get
;
}
/// <summary>
/// Explicitly opt in for slave writes on writable slaves
/// </summary>
bool
AllowSlaveWrites
{
get
;
set
;
}
/// <summary>
/// Gets the operating mode of the connected server
/// </summary>
...
...
@@ -46,7 +51,7 @@ public partial interface IServer : IRedis
/// Gets the version of the connected server
/// </summary>
Version
Version
{
get
;
}
/// <summary>
/// The CLIENT KILL command closes a given client connection identified by ip:port.
/// The ip:port should match a line returned by the CLIENT LIST command.
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
View file @
d44b99f8
...
...
@@ -753,7 +753,7 @@ private bool WriteMessageToServer(PhysicalConnection connection, Message message
{
var
cmd
=
message
.
Command
;
bool
isMasterOnly
=
message
.
IsMasterOnly
();
if
(
isMasterOnly
&&
serverEndPoint
.
IsSlave
)
if
(
isMasterOnly
&&
serverEndPoint
.
IsSlave
&&
(
serverEndPoint
.
SlaveReadOnly
||
!
serverEndPoint
.
AllowSlaveWrites
)
)
{
throw
ExceptionFactory
.
MasterOnly
(
multiplexer
.
IncludeDetailInExceptions
,
message
.
Command
,
message
,
ServerEndPoint
);
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
View file @
d44b99f8
...
...
@@ -37,6 +37,12 @@ public RedisFeatures Features
public
bool
IsSlave
{
get
{
return
server
.
IsSlave
;
}
}
public
bool
AllowSlaveWrites
{
get
{
return
server
.
AllowSlaveWrites
;
}
set
{
server
.
AllowSlaveWrites
=
value
;
}
}
public
ServerType
ServerType
{
get
{
return
server
.
ServerType
;
}
}
public
Version
Version
{
get
{
return
server
.
Version
;
}
}
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
d44b99f8
...
...
@@ -114,6 +114,8 @@ public long OperationCount
public
bool
SlaveReadOnly
{
get
{
return
slaveReadOnly
;
}
set
{
SetConfig
(
ref
slaveReadOnly
,
value
);
}
}
public
bool
AllowSlaveWrites
{
get
;
set
;
}
public
Version
Version
{
get
{
return
version
;
}
set
{
SetConfig
(
ref
version
,
value
);
}
}
public
int
WriteEverySeconds
{
get
{
return
writeEverySeconds
;
}
set
{
SetConfig
(
ref
writeEverySeconds
,
value
);
}
}
...
...
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