Conversation
ref tikv#11260 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Preserve the barrier metrics and warnings from tikv#11259 without importing GC cache, watch, or keyspace removal features absent from this release. Bind metric collection and cleanup to the existing leader serving cycle. Adapt the regression tests to the release storage interface and read counts, retaining coverage for supported metadata states, leadership, and force deletion. Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds Prometheus metrics and warnings for old GC barriers, integrates metric state with GC advancement and leadership, and routes legacy service safe-point deletion through serialized GC manager logic. ChangesGC barrier metrics
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant PDServer
participant GCStateManager
participant barrierMetrics
participant Prometheus
PDServer->>GCStateManager: Become leader
GCStateManager->>barrierMetrics: Register current metrics
PDServer->>GCStateManager: Advance transaction safe point
GCStateManager->>barrierMetrics: Observe loaded barriers
Prometheus->>barrierMetrics: Scrape retained entries
barrierMetrics-->>Prometheus: Return qualifying barrier timestamps
Merge Risk: ⚪ Minimal · up to The barrier observability and force-deletion changes appear mergeable with no identified actionable risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/retest |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-nextgen-20251011 #11270 +/- ##
============================================================
+ Coverage 78.59% 78.65% +0.06%
============================================================
Files 491 491
Lines 66337 66504 +167
============================================================
+ Hits 52139 52312 +173
+ Misses 10425 10414 -11
- Partials 3773 3778 +5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@coderabbitai[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: coderabbitai[bot], JmPotato The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/hold |
What problem does this PR solve?
Old GC barriers can retain obsolete data and cause disk pressure. Operators need metrics and warnings identifying the retaining barriers.
Cherry-pick of #11259 to
release-nextgen-20251011, replacing the bot-generated PR with resolved conflicts.Issue Number: ref #11260, close #11268
What is changed and how does it work?
The metric is
pd_gc_barrier_timestamp_seconds{scope,keyspace_id,keyspace_name,barrier_id}. Writes alone do not discover barriers. Global barriers and NullKeyspace use an empty keyspace name. HTTP force deletion clears observations only after a successful storage commit.Both release branches lack the source branch's GC cache/watch and keyspace metadata removal APIs. This backport preserves the existing release APIs and adds the required leadership hooks; it omits callbacks and tests for the unavailable metadata removal operation. Transaction test wrappers and storage-read assertions match the release interfaces. Tests use Go 1.23-compatible WaitGroup and benchmark APIs.
Check List
Tests
make basic-testforpkg/gc,pkg/keyspace, andserver/api, with default and NextGen builds: passed.-race: passed.TestGetGCSafePointregression in both client discovery modes, with-raceunder default and NextGen builds: passed.make checkpassed forpkg/gc. The broader server/API check reports six existing lint findings in unchangedserver/gc_service.goandserver/api/{failpoint,plugin,plugin_disable}.gofiles.Code changes
Side effects
Related changes
Release note
Summary by CodeRabbit
New Features
Bug Fixes