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
247d08a9
Commit
247d08a9
authored
Oct 29, 2014
by
Max Stepanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ability to write to a non-readonly slave
parent
0cc1d8f9
Changes
4
Show 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 @
247d08a9
...
@@ -37,6 +37,11 @@ public partial interface IServer : IRedis
...
@@ -37,6 +37,11 @@ public partial interface IServer : IRedis
/// </summary>
/// </summary>
bool
IsSlave
{
get
;
}
bool
IsSlave
{
get
;
}
/// <summary>
/// Explicitly opt in for slave writes on writable slaves
/// </summary>
bool
AllowSlaveWrites
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Gets the operating mode of the connected server
/// Gets the operating mode of the connected server
/// </summary>
/// </summary>
...
...
StackExchange.Redis/StackExchange/Redis/PhysicalBridge.cs
View file @
247d08a9
...
@@ -770,7 +770,7 @@ private bool WriteMessageToServer(PhysicalConnection connection, Message message
...
@@ -770,7 +770,7 @@ private bool WriteMessageToServer(PhysicalConnection connection, Message message
{
{
var
cmd
=
message
.
Command
;
var
cmd
=
message
.
Command
;
bool
isMasterOnly
=
message
.
IsMasterOnly
();
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
);
throw
ExceptionFactory
.
MasterOnly
(
multiplexer
.
IncludeDetailInExceptions
,
message
.
Command
,
message
,
ServerEndPoint
);
}
}
...
...
StackExchange.Redis/StackExchange/Redis/RedisServer.cs
View file @
247d08a9
...
@@ -37,6 +37,12 @@ public RedisFeatures Features
...
@@ -37,6 +37,12 @@ public RedisFeatures Features
public
bool
IsSlave
{
get
{
return
server
.
IsSlave
;
}
}
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
ServerType
ServerType
{
get
{
return
server
.
ServerType
;
}
}
public
Version
Version
{
get
{
return
server
.
Version
;
}
}
public
Version
Version
{
get
{
return
server
.
Version
;
}
}
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
247d08a9
...
@@ -114,6 +114,8 @@ public long OperationCount
...
@@ -114,6 +114,8 @@ public long OperationCount
public
bool
SlaveReadOnly
{
get
{
return
slaveReadOnly
;
}
set
{
SetConfig
(
ref
slaveReadOnly
,
value
);
}
}
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
Version
Version
{
get
{
return
version
;
}
set
{
SetConfig
(
ref
version
,
value
);
}
}
public
int
WriteEverySeconds
{
get
{
return
writeEverySeconds
;
}
set
{
SetConfig
(
ref
writeEverySeconds
,
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