Skip to content

pd-ctl: add a gc-state command for keyspace GC troubleshooting #11013

Description

@wfxr

Feature Request

Describe your feature request related problem

The existing pd-ctl service-gc-safepoint command only exposes the legacy NullKeyspace/unified-GC view. When keyspace-level GC is enabled, each keyspace has independent GC state and GC barriers, but pd-ctl provides no way to inspect them for a specific keyspace or across all keyspaces.

This makes it difficult to troubleshoot why GC is blocked and which barrier is responsible. This is a focused follow-up to the unfinished gc-state pd-ctl subtask in #8978.

Describe the feature you'd like

Add a read-only gc-state command to pd-ctl that can show the GC state for:

  • A specified keyspace.
  • All keyspaces.

The output should include the relevant GC safe points and GC barriers so that operators can identify what is blocking GC.

Describe alternatives you've considered

Operators can call GetGCState or GetAllKeyspacesGCStates directly, but doing so is less convenient for operational troubleshooting.

Extending service-gc-safepoint was also considered, but that command represents the legacy service safe point and NullKeyspace semantics. A new gc-state command better matches the current GC state and GC barrier model.

Teachability, Documentation, Adoption, Migration Strategy

Document gc-state as the read-only troubleshooting command for inspecting per-keyspace and cluster-wide GC states. Keep the existing service-gc-safepoint command unchanged for backward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-typeIndicates an issue requires a type label.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions