소스 검색

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 년 전
부모
커밋
f3999660fe
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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);
 
-        if (!$connection->isConnected() && $this->slaves) {
+        if (!$connection->isConnected() && ($this->slaves || $this->master)) {
             $this->assertConnectionRole(
                 $connection,
                 $this->strategy->isReadOperation($command) ? 'slave' : 'master'