diff --git a/session.go b/session.go index a600b95f3..7d59c6448 100644 --- a/session.go +++ b/session.go @@ -307,6 +307,19 @@ func (s *Session) init() error { close(connectedCh) } + // If we disable the initial host lookup, we need to still check if the + // cluster is using the newer system schema or not... however, if control + // connection is disable, we really have no choice, so we just make our + // best guess... + if !s.cfg.disableControlConn && s.cfg.DisableInitialHostLookup { + newer, _ := checkSystemSchema(s.control) + s.useSystemSchema = newer + } else { + version := s.ring.rrHost().Version() + s.useSystemSchema = version.AtLeast(3, 0, 0) + s.hasAggregatesAndFunctions = version.AtLeast(2, 2, 0) + } + // before waiting for them to connect, add them all to the policy so we can // utilize efficiencies by calling AddHosts if the policy supports it type bulkAddHosts interface { @@ -336,19 +349,6 @@ func (s *Session) init() error { go s.reconnectDownedHosts(s.cfg.ReconnectInterval) } - // If we disable the initial host lookup, we need to still check if the - // cluster is using the newer system schema or not... however, if control - // connection is disable, we really have no choice, so we just make our - // best guess... - if !s.cfg.disableControlConn && s.cfg.DisableInitialHostLookup { - newer, _ := checkSystemSchema(s.control) - s.useSystemSchema = newer - } else { - version := s.ring.rrHost().Version() - s.useSystemSchema = version.AtLeast(3, 0, 0) - s.hasAggregatesAndFunctions = version.AtLeast(2, 2, 0) - } - if s.pool.Size() == 0 { return ErrNoConnectionsStarted }