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

*: enables elastic CPU limiter for all users of ExportRequest #96691

Merged
merged 1 commit into from
Feb 25, 2023

Commits on Feb 24, 2023

  1. *: enables elastic CPU limiter for all users of ExportRequest

    Previously, there was a strange coupling between the elastic CPU
    limiter and the `header.TargetBytes` DistSender limit set on each
    ExportRequest. Even if a request was preempted on exhausting its
    allotted CPU tokens, it would only return from kvserver by virtue
    of its `header.TargetBytes` being set to a non-zero value. Out of the
    four users of ExportRequest, only backup set this field to a sentinel
    value of 1 to limit the number of SSTs we send back in an ExportResponse.
    The remaining callers of ExportRequest would not return from the kvserver.
    Instead they would evaluate the request from the resume key immediately,
    not giving the scheduler a chance to take the goroutine off CPU.
    
    This change breaks this coupling by introducing a `resumeInfo` object that
    indicates whether the resumption was because we were over our CPU limit. If
    it was, we return an ExportResponse with our progress so far. This change
    shifts the burden of handling pagination to the client. This seems better than
    having the server sleep or wait around until its CPU tokens are replenished
    as the client would be left wondering why a request is taking so long.
    
    To that effect this change adds pagination support to the other callers of
    ExportRequest. Note, we do not set `SplitMidKey` at these other callsites
    yet. Thus, all pagination will happen at key boundaries in the ExportRequest.
    A follow-up will add support for `SplitMidKey` to these callers.
    
    Informs: cockroachdb#96684
    
    Release note: None
    adityamaru committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    4f9ec34 View commit details
    Browse the repository at this point in the history