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

pgwire: lift the PreServe() call to the server package #92578

Merged
merged 16 commits into from
Jan 9, 2023

Commits on Jan 8, 2023

  1. cli/demo: fix the port allocation

    Prior to this patch, we were unconditionally applying a port offset
    for secondary tenant servers, even when the port allocation for the KV
    node was randomized. This resulted in the demo cluster trying to
    reuse arbitrary TCP ports which may be already in use elsewhere in the
    system.
    
    This patch fixes it by ensuring that tenant servers also use random
    allocation when the KV node ports were randomly allocated in the first
    place.
    
    It also adds demo networking tests that verify this via the
    `--sql-port` / `--http-port` flags.
    
    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    f93343a View commit details
    Browse the repository at this point in the history
  2. cli/demo: deflake some interactive tests

    Some of the tests were not waiting for the prompt to start sending
    their input. This was causing the input to be lost in some cases.
    
    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    a139a83 View commit details
    Browse the repository at this point in the history
  3. pgwire: unexport ServerMetrics, rename to tenantSpecificMetrics

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    cdcbeda View commit details
    Browse the repository at this point in the history
  4. pgwire: fix typo in metric descriptions

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    cd68aa2 View commit details
    Browse the repository at this point in the history
  5. pgwire: simplify writeErr/sendErr

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    7e86a50 View commit details
    Browse the repository at this point in the history
  6. pgwire: create a framework for pre-serve connection logic

    This commit introduces `PreServeConnHandler`, which will
    handle the preparation of a SQL connection prior to handing it off to
    a specific tenant server.
    
    Release note (ops changes): The count of network bytes sent
    to report re-authentication errors to a SQL client is now
    reported via the metric `sql.pre_serve.bytesout` (instead of
    `sql.bytesout` previously). The count of pre-authentication errors
    is now reported via the metric `sql.pre_serve.conn.failures` (instead
    of `sql.conn.failures` previously).
    
    Release note (ops changes): The count of new SQL connections
    is now also reported on `sql.pre_serve.new_conns`.
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    1814c21 View commit details
    Browse the repository at this point in the history
  7. pgwire: lift readVersion + TLS handshake into the pre-serve handler

    Release note (ops change): The bytes read from SQL clients
    prior to authentication are now reported via the metric
    `sql.pre_serve.bytesin` (instead of `sql.bytesin` previously).
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    e42293f View commit details
    Browse the repository at this point in the history
  8. pgwire: make handleCancel unaware of conn/buf

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    54f789e View commit details
    Browse the repository at this point in the history
  9. pgwire: split parseClientProvidedSessionParameters

    We need the read/parse of the parameters to be tenant-independent,
    so the function cannot contain tenant-specific configuration.
    
    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    7bd4484 View commit details
    Browse the repository at this point in the history
  10. pgwire: split the pre-conn reserved memory account

    This commit extracts the memory reservation into
    a tenant-independent memory pool.
    
    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    c7dd014 View commit details
    Browse the repository at this point in the history
  11. pgwire: lift the pre-serve logic into a closure

    This demonstrates that the logic is tenant-independent
    and makes it ready to move into the PreServe() function.
    
    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    b5a2c43 View commit details
    Browse the repository at this point in the history
  12. pgwire: move PreServe() to its own method

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    e589e4b View commit details
    Browse the repository at this point in the history
  13. pgwire: move maybeUpgradeToSecureConn to pre_serve.go

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    7963983 View commit details
    Browse the repository at this point in the history
  14. pgwire: move readVersion to pre_serve.go

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    41fe579 View commit details
    Browse the repository at this point in the history
  15. pgwire: move the parsing logic for client opts to a new file

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    317b426 View commit details
    Browse the repository at this point in the history
  16. pgwire: lift the PreServe() call to the server package

    Release note: None
    knz committed Jan 8, 2023
    Configuration menu
    Copy the full SHA
    7eb7663 View commit details
    Browse the repository at this point in the history