Engage the LoadBalancingPolicy after the control connection

Description

Actually, the control connection picks its node using the default LBL configured with the cluster. This is a bit hacky cause at this time, we don´t have any host metadata. To get this working, the session.connect() needs to fake-add the contact points as hosts in the metadata. Those are incomplete and the host information are only available when peers and local tables are queried.

It would be better to separate this internally. The ControlConnection should use the contact points and try to connect to one of them using a round-robin pick. At this point, there is no host in the metadata. After a successful connection, the CC query the system tables and populate the host metadata accordingly. Now, the LBL is now ready to be used. After the initial control connection, the behavior of the CC reconnect mecanism should use the LBL as normal.

This change could potentially affect some users but not sure if those cases are related to a misuse of the cluster setup?

Environment

None

Pull Requests

None

Activity

Show:
Alexandre Dutra
February 19, 2020, 1:16 AM

For comparison, the Java driver has the notion of a wrapper around user-supplied LBPs that, among other things, serves the purpose of helping initializing the control connection. See .

Assignee

Unassigned

Reporter

Alan Boudreault

Fix versions

Labels

None

PM Priority

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

Py P-MAJOR-NEXT

Priority

Major