Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host filter #567

Merged
merged 6 commits into from Oct 4, 2022
Merged

Host filter #567

merged 6 commits into from Oct 4, 2022

Commits on Oct 4, 2022

  1. transport: add the host_filter module

    Introduces the host_filter module. Host filters will be used for
    restricting the set of nodes towards which the driver should open
    connections. The following filters are implemented for the time being:
    
    - AcceptAllHostFilter: accepts all nodes,
    - AllowListHostFilter: only nodes from the provided list are accepted,
    - DcHostfilter: only nodes from given DC are accepted.
    piodul committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    914ff2d View commit details
    Browse the repository at this point in the history
  2. {session,session_config}: add host filter to session builder and config

    Now, it is possible to provide a HostFilter for a Session via
    SessionConfig or SessionBuilder.
    piodul committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    bb38722 View commit details
    Browse the repository at this point in the history
  3. node: make it possible to disable node's pool

    In order to make host filters effective the connection pool in Node is
    wrapped in an optional. Nodes disabled by the session's host filters
    will have the connection pool set to None.
    piodul committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    7efd309 View commit details
    Browse the repository at this point in the history
  4. cluster: use host filter by cluster worker

    Now, on topology refresh, nodes that are not accepted by the host
    filtered are created in disabled mode, i.e. they do not create a
    connection pool and do not establish any connections to the node.
    piodul committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    3342a0d View commit details
    Browse the repository at this point in the history
  5. topology: filter hosts for the control connection

    Now, the control connection is aware of the host filter and carefully
    tries to omit filtered out nodes.
    
    If the initial nodes list contained a node that is not accepted by the
    host filter and a control connection has been established to it, a
    warning will be printed and the driver will try to re-establish it to
    one of the accepted nodes.
    
    Additionally, in case of a mistake where an incorrect host filter is
    provided and all nodes are filtered out, a message is printed which
    points out the problem.
    piodul committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    0a4f948 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c2944af View commit details
    Browse the repository at this point in the history