Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix token aware metadata fetching deadlock.
The token aware host policy needs to fetch schema metadata so it can hash row keys properly. Before the internal "control" conn was added, metadata.go would set Query().RoutingKey([]byte{}) before it performed the metadata queries so the metadata queries themselves didn't re-enter the token aware host selection code (and deadlock). The control conn still works most of the time, though, because the control conn performs queries directly on a conn object, bypassing the token aware selection stuff. That is, unless there is more than one page of metadata, since iter.next.fetch() executes the query via the session, which re-enters the token aware host selection code. Fix by setting RoutingKey to []byte{} on the control conn's queries. This is the same tactic the old code was using to avoid this problem.
- Loading branch information