Browse Source

Fixed CSHARP-273. If isMaster reports both arbiterOnly and passive true, only believe arbiterOnly and set passive to false.

pull/63/head
rstam 14 years ago
parent
commit
975ea705aa
  1. 3
      BsonUnitTests/BsonUnitTests.csproj
  2. 2
      Driver/Core/MongoServerInstance.cs

3
BsonUnitTests/BsonUnitTests.csproj

@ -181,9 +181,6 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram1.cd" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

2
Driver/Core/MongoServerInstance.cs

@ -221,6 +221,8 @@ namespace MongoDB.Driver {
isSecondary = isMasterResult.Response["secondary", false].ToBoolean();
isPassive = isMasterResult.Response["passive", false].ToBoolean();
isArbiter = isMasterResult.Response["arbiterOnly", false].ToBoolean();
// workaround for CSHARP-273
if (isPassive && isArbiter) { isPassive = false; }
if (!isPrimary && !slaveOk) {
throw new MongoConnectionException("Server is not a primary and SlaveOk is false.");
}

Loading…
Cancel
Save