-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
repository: Merge Workload Repository into master #57148
base: master
Are you sure you want to change the base?
Conversation
* domain: add repository worker Signed-off-by: xhe <[email protected]> * sessionctx, domain: add function gate Signed-off-by: xhe <[email protected]> * repository: refine context usage Signed-off-by: xhe <[email protected]> * repository: add recover and session getter Signed-off-by: xhe <[email protected]> * sessionctx: hide variable Signed-off-by: xhe <[email protected]> * fix bazel Signed-off-by: xhe <[email protected]> * fix check Signed-off-by: xhe <[email protected]> * repository: refine owner management Signed-off-by: xhe <[email protected]> * repository: free memref Signed-off-by: xhe <[email protected]> * fix check Signed-off-by: xhe <[email protected]> --------- Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]> Co-authored-by: Henry Baba-Weiss <[email protected]>
Signed-off-by: xhe <[email protected]> Co-authored-by: Will DeVries <[email protected]>
…pingcap#1277) Signed-off-by: xhe <[email protected]> Co-authored-by: xhe <[email protected]>
* repository: sample and snapshot threads Signed-off-by: xhe <[email protected]> * fix Signed-off-by: xhe <[email protected]> * fix Signed-off-by: xhe <[email protected]> * address comments Signed-off-by: xhe <[email protected]> * address comments Signed-off-by: xhe <[email protected]> * address coments Signed-off-by: xhe <[email protected]> * address coments Signed-off-by: xhe <[email protected]> * address comments Signed-off-by: xhe <[email protected]> * address comments Signed-off-by: xhe <[email protected]> * address comments Signed-off-by: xhe <[email protected]> --------- Signed-off-by: xhe <[email protected]>
…als. (pingcap#1317) * Add global variables to control sampling intervals in the Workload Repository. * Return error when etc client is not available. * Rework error messages. * Fix required comments. * Switch to using Ticker.Reset instead of restarting Fiber. * Use swap instead of load and store. * Make a couple of minor changes. * Fix issues
Signed-off-by: xhe <[email protected]>
* Wrap exit with a context.Context. * Remove getGlobalVar from Worker. * Seperate Repository from Domain. * Use RegisterSysVar instead of defining varibles in SysVar.go * Move samplingInterval and snapshotInterval to Worker. * Convert setRepositoryDest to a method of Worker. * Make Worker private to the repository package. * Add error handling in SetupRepository and disable repository. * Change to statically allocated worker class and enable repository. * Don't wait on exit channel for domain. * Stop the repository from cleanup in main.go. * Fix nits and move the error check for etcd later in start(). * Add comments on public methods. * Fix error message format.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @wddevries. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #57148 +/- ##
=================================================
- Coverage 72.9877% 56.8774% -16.1103%
=================================================
Files 1657 1814 +157
Lines 457574 646015 +188441
=================================================
+ Hits 333973 367437 +33464
- Misses 103093 253339 +150246
- Partials 20508 25239 +4731
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/ok-to-test |
@@ -10,6 +10,7 @@ go_library( | |||
"//pkg/config", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some test cases for it?
@wddevries: The following test failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
@wddevries: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the changes LGTM.
@@ -187,6 +187,8 @@ func (w *Worker) start(ctx context.Context) func() { | |||
return func() { | |||
w.owner = w.newOwner(ownerKey, promptKey) | |||
ticker := time.NewTicker(time.Second) | |||
w.owner.CampaignOwner() | |||
defer w.owner.CampaignCancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should w.owner.CampaignCancel()
be in stop()
instead? Seems like this would prematurely retire the owner while the worker is still active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, house keeper need this. owner campaign
is not a one-shot election, it is long-running.
Also we've assumed that newOwner
will call CampaignOwner
by default. And should not call CampaignOwner
twice(implementation of owner has no guard for invoking twice).
What problem does this PR solve?
Issue Number: ref #57147
Problem Summary:
This pull request merges in the Workload Repository code from the Serverless project. The project is not complete yet, and more testing remains to be done.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.