scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

Fix `populate()` workaround in tablet code #288

Open avelanarius opened 8 months ago

avelanarius commented 8 months ago

The current implementation has the following workaround:

https://github.com/scylladb/python-driver/commit/dfccfffa295d4b1ae2624c6753f67c514af31cd8#diff-96bfc85b77a504cf9f31ccf706cecb133eb418bc3e7a125e28bf5fa887d8c6b9R1789-R1796

    self.load_balancing_policy._tablets_routing_v1 = self.control_connection._tablets_routing_v1
    child_policy = self.load_balancing_policy.child_policy if hasattr(self.load_balancing_policy, 'child_policy') else None
    while child_policy is not None:
        if hasattr(child_policy, '_tablet_routing_v1'):
            child_policy._tablet_routing_v1 = self.control_connection._tablets_routing_v1
        child_policy = child_policy.child_policy if hasattr(child_policy, 'child_policy') else None

This used to be a populate() call, but this sometimes failed some tests in CI (not reproducible locally). We should investigate the reason why it did so.

Creating this issue so we won't forget about this problem.