Browse Source

Fix bug during assertion of connection role.

ROLE was not being sent to master when still disconnected and with an
empty slaves pool preventing the client from checking the actual role
of the server upon connect().
Daniele Alessandri 9 years ago
parent
commit
f3999660fe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Connection/Aggregate/SentinelReplication.php

+ 1 - 1
src/Connection/Aggregate/SentinelReplication.php

@@ -535,7 +535,7 @@ class SentinelReplication implements ReplicationInterface
     {
     {
         $connection = $this->getConnectionInternal($command);
         $connection = $this->getConnectionInternal($command);
 
 
-        if (!$connection->isConnected() && $this->slaves) {
+        if (!$connection->isConnected() && ($this->slaves || $this->master)) {
             $this->assertConnectionRole(
             $this->assertConnectionRole(
                 $connection,
                 $connection,
                 $this->strategy->isReadOperation($command) ? 'slave' : 'master'
                 $this->strategy->isReadOperation($command) ? 'slave' : 'master'