Repository navigation
domain: add idle GC for cross-keyspace runtimes - #69013
Conversation
|
@D3Hunter I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
📝 WalkthroughWalkthroughThe PR implements periodic garbage collection for cross-keyspace runtimes by introducing ChangesCross-keyspace Runtime GC Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Hi @D3Hunter. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #69013 +/- ##
================================================
+ Coverage 76.3213% 76.6654% +0.3441%
================================================
Files 2041 2056 +15
Lines 562689 573121 +10432
================================================
+ Hits 429452 439386 +9934
+ Misses 132324 131942 -382
- Partials 913 1793 +880
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joechenrh, wjhuang2016 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:
|
|
/retest |
|
@D3Hunter: PRs from untrusted users cannot be marked as trusted with 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. |
|
/retest |
|
@D3Hunter: PRs from untrusted users cannot be marked as trusted with 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. |
|
/retest |
|
@D3Hunter: PRs from untrusted users cannot be marked as trusted with 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. |
What problem does this PR solve?
Issue Number: ref #68883
Problem Summary:
NextGen cross-keyspace runtimes can be created for DXF work and then become idle after their runtime handles are released. Each runtime owns resources such as the target keyspace store, session pool, schema syncer, etcd client, and background loops, so the cross-keyspace manager needs an idle reclamation path that keeps active holders alive while eventually closing released runtimes.
it's now wired up in this pr, we will do it in later pr
What changed and how does it work?
This PR adds an idle GC loop entrypoint to
crossks.Manager. The sweeper skips runtimes with active holders, skips entries that have never been released, and evicts entries whose last release is older than the idle timeout. Evicted runtimes are removed from the manager map while holding the manager lock, then their session managers are closed outside the lock.The change keeps
Release()idempotent, preserves active runtime ownership, allows a later acquire to create a fresh runtime after eviction, and documents the remaining directGetOrCreatecallers as temporary lifecycle-management exceptions until they can move toAcquire.Check List
Tests
make bazel_prepare./tools/check/failpoint-go-test.sh pkg/domain/crossks -run 'Test(AcquireRuntimeHandle|EvictRuntime|RuntimeHandleManagerCloseClosesAllEntriesRegardlessOfIdleTimeout|GCLoopExitsWhenContextCancelled)' -count=1 -tags=intest,deadlock,nextgenmake lintSide effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
New Features
Tests
Documentation
Chores