From 868a08e4a10b8f60bb0fd5081e01d7b4d2d61b66 Mon Sep 17 00:00:00 2001 From: Dipesh Date: Tue, 13 Aug 2024 16:14:19 -0700 Subject: [PATCH 1/2] fix: set useSystemSchema before policy setup --- session.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/session.go b/session.go index a600b95f3..65b19154e 100644 --- a/session.go +++ b/session.go @@ -13,7 +13,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the Lficense. */ /* * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40 @@ -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 } From f7f680bdc895ed3fcfe5c7b0e4396d5de100f830 Mon Sep 17 00:00:00 2001 From: Dipesh Date: Tue, 13 Aug 2024 16:16:20 -0700 Subject: [PATCH 2/2] fix: typo --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index 65b19154e..7d59c6448 100644 --- a/session.go +++ b/session.go @@ -13,7 +13,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the Lficense. + * limitations under the License. */ /* * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40