diff --git a/Cassandra.ThriftClient/Connections/ClusterConnection.cs b/Cassandra.ThriftClient/Connections/ClusterConnection.cs index 32efbc9..13a79c6 100644 --- a/Cassandra.ThriftClient/Connections/ClusterConnection.cs +++ b/Cassandra.ThriftClient/Connections/ClusterConnection.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Text; using SkbKontur.Cassandra.ThriftClient.Abstractions; @@ -60,7 +61,13 @@ public void WaitUntilSchemaAgreementIsReached(TimeSpan timeout) { var schemaAgreementCommand = new SchemaAgreementCommand(); commandExecutor.Execute(schemaAgreementCommand); - if (schemaAgreementCommand.Output.Count == 1) + if (schemaAgreementCommand.Output.ContainsKey(unreachableVersion)) + { + logger.Error("Found unreachable version"); + LogVersions(schemaAgreementCommand.Output); + } + + if (schemaAgreementCommand.Output.Keys.Count(x => x != unreachableVersion) == 1) return; LogVersions(schemaAgreementCommand.Output); } while (sw.Elapsed < timeout); @@ -76,6 +83,7 @@ private void LogVersions(IDictionary> versions) logger.Info(stringBuilder.ToString()); } + private const string unreachableVersion = "UNREACHABLE"; private readonly ICommandExecutor commandExecutor; private readonly ILog logger; }