Skip to content

storage: Refactor GC RPC API #7880

@bdarnell

Description

@bdarnell

The GC method is currently unique in that it is a range request which also contains keys in the body of the GCRequest. The DistSender is unaware of the keys in the body, so if it must split a GC request across ranges both sides get the full list of keys, including those outside their key span. The server side expects this and silently discards any keys that fall outside its span. However, this can mask errors such as the fact that we are unable to GC transaction records created by splits (#7652). It would be better to enforce that a GCRequest never contains keys outside its span.

We could do this in two ways:

  • Give DistSender a hook to allow it to partition the keys contained in GCRequest whenever it must truncate the Span.
  • Instead of one GCRequest containing a list of keys, replace GCRequest with a single-key GC operation. This makes it more consistent with other operations and allows DistSender to handle it naturally, although it might be somewhat less efficient. We shouldn't undertake this change until after moving to proposer-evaluated KV.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kv-clientRelating to the KV client and the KV interface.C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.E-starterMight be suitable for a starter project for new employees or team members.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions