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

roachtest/cdc: add buffered sender cdc_bench #130021

Closed
wants to merge 17 commits into from

Commits on Sep 3, 2024

  1. kvserver/rangefeed: add rangefeed level callback

    This patch adds RegisterRangefeedCleanUp to BufferedStream interface. Rangefeed
    level can register a cleanup callback that will be invoked after
    BufferedStream.Disconnect is called. Note that it might not be invoked
    immediately during SendBufferedError.
    
    Buffered registration has a dedicated goroutine to do cleanup. Unbuffered
    registration does not have a dedicated goroutine, so it relies on BufferedSender
    to invoke the callback when it disconnects.
    
    Part of: cockroachdb#129814
    Release note: none
    wenyihu6 committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    1628a40 View commit details
    Browse the repository at this point in the history
  2. kvserver/rangefeed: move helper functions to registry_helpers_test

    This patch moves helper functions to registry_helpers_test.
    
    Part of: cockroachdb#129814
    Release note: none
    wenyihu6 committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    96e4507 View commit details
    Browse the repository at this point in the history
  3. kvserver/rangefeed: refactor registry_helpers_test to facilitate futu…

    …re tests
    
    This patch refactors helper functions in registry_helpers_test.
    
    Part of: cockroachdb#129814
    Release note: none
    wenyihu6 committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    20cf558 View commit details
    Browse the repository at this point in the history
  4. kvserver/rangefeed: add unbuffered registration

    This patch adds unbufferedRegistration.
    
    UnbufferedRegistration is like BufferedRangefeed but uses BufferedStream to
    buffer live raft updates instead of a using buf channel and having a
    dedicated per-range per-registration goroutine to volley events to underlying
    grpc stream. Instead, there is only one BufferedStream for each incoming
    node.MuxRangefeed rpc call. BufferedStream is responsible for buffering and
    sending its updates to the underlying grpc stream in a dedicated goroutine
    O(node).
    
    Note that BufferedStreamSender is still left unimplemented. This commit doesn't
    add any tests for it yet. More tests will be added in future commits of this PR.
    
    Part of: cockroachdb#129814
    Release note: none
    wenyihu6 committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    7556690 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Configuration menu
    Copy the full SHA
    d80ca1d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    277f1b8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    67193be View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb2c4e3 View commit details
    Browse the repository at this point in the history
  5. kvserver/rangefeed: add unbuffered registration tests

    This patch adds more test cases for unbufferedRegistration.
    
    Closed: cockroachdb#126560
    Release note: none
    wenyihu6 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    1869050 View commit details
    Browse the repository at this point in the history
  6. kvserver/rangefeed: add newRetryErrBufferCapacityExceeded

    This patch refactors the error for kvpb.RangeFeedRetryError_REASON_SLOW_CONSUMER
    into newRetryErrBufferCapacityExceeded.
    
    Part of: cockroachdb#126560
    Release note: none
    wenyihu6 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    a275394 View commit details
    Browse the repository at this point in the history
  7. kvserver/rangefeed: add event queue

    This patch adds a new data structure eventQueue which is like a queue but uses a
    fixed size for the chunked linked list. Each chunk has a fixed size of 4096
    elements. This implementation uses sync.Pool to reduce the number of
    allocations.
    
    pushBack, popFront, len run in constant time. removeAll runs in linear time with
    respect to the number of elements in the queue. This structure is not safe for
    concurrent use.
    
    This is for future commits to include the queue in the BufferedSender to buffer
    events at the node level.
    
    Part of: cockroachdb#129813
    Release note: none
    wenyihu6 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    a45ccbb View commit details
    Browse the repository at this point in the history
  8. kvserver/rangefeed: add node level buffered sender

    This patch is the last step for reducing long-running O(ranges) goroutines in
    kvserver/rangefeed. It changes the BufferedSender to use a queue to buffer
    events before forwarding them to underlying grpc stream.
    
    Closed: cockroachdb#129813
    Release note: A new cluster setting
    `kv.rangefeed.buffered_stream_sender.enabled` can now be used to allow rangefeed
    to use buffered sender for all rangefeed feeds instead of buffering events
    separately per client per range.
    wenyihu6 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    b296b55 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5b81fef View commit details
    Browse the repository at this point in the history
  10. kvserver/rangefeed: add capacity to node level buffered sender

    This patch adds capacity to node level buffered sender which will shut down all
    registrations if the node level buffer had overflowed.
    
    Part of: cockroachdb#129813
    Release note: none
    
    TODO: add a larger test at the kvclient side to make sure error returned here is treated as a restart signal
    wenyihu6 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    671aaae View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1efd2f9 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. kvserver/rangefeed: add buffered sender cdc_bench

    to discuss: we can't use cluster settings to change things without involving buffered registration at the beginning
    wenyihu6 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    e248e60 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0d82f4 View commit details
    Browse the repository at this point in the history