|
@@ -283,6 +283,21 @@ func (s *Session) init() error {
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// AwaitSchemaAgreement will wait until schema versions across all nodes in the
|
|
|
|
|
+// cluster are the same (as seen from the point of view of the control connection).
|
|
|
|
|
+// The maximum amount of time this takes is governed
|
|
|
|
|
+// by the MaxWaitSchemaAgreement setting in the configuration (default: 60s).
|
|
|
|
|
+// AwaitSchemaAgreement returns an error in case schema versions are not the same
|
|
|
|
|
+// after the timeout specified in MaxWaitSchemaAgreement elapses.
|
|
|
|
|
+func (s *Session) AwaitSchemaAgreement(ctx context.Context) error {
|
|
|
|
|
+ if s.cfg.disableControlConn {
|
|
|
|
|
+ return errNoControl
|
|
|
|
|
+ }
|
|
|
|
|
+ return s.control.withConn(func(conn *Conn) *Iter {
|
|
|
|
|
+ return &Iter{err: conn.awaitSchemaAgreement(ctx)}
|
|
|
|
|
+ }).err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func (s *Session) reconnectDownedHosts(intv time.Duration) {
|
|
func (s *Session) reconnectDownedHosts(intv time.Duration) {
|
|
|
reconnectTicker := time.NewTicker(intv)
|
|
reconnectTicker := time.NewTicker(intv)
|
|
|
defer reconnectTicker.Stop()
|
|
defer reconnectTicker.Stop()
|