Skip to content
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

br: add chaos testing for advancer owner #58183

Merged
merged 5 commits into from
Dec 31, 2024

Conversation

Tristan1900
Copy link
Contributor

@Tristan1900 Tristan1900 commented Dec 12, 2024

What problem does this PR solve?

Issue Number: close #50458

Problem Summary:

What changed and how does it work?

Add a cycle to force to be owner and retire when using log advancer cmd. In the test we can start this debugging command and it will do this cycle repeatedly until exits. It creates a chaos scenario for advancer testing.
Also all the parameters in the advancer are exposed to the cmd already which is convenient. The advancer daemon running on TiDB domain will not be affected by any of these configs since they use default and cannot be configured.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Copy link

ti-chi-bot bot commented Dec 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 12, 2024
Copy link

tiprow bot commented Dec 12, 2024

Hi @Tristan1900. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

Signed-off-by: Wenqi Mou <[email protected]>
@Tristan1900 Tristan1900 force-pushed the expose-config-for-test branch from 2e8a8eb to 751f81c Compare December 12, 2024 01:53
@@ -11,18 +11,19 @@ import (
const (
flagBackoffTime = "backoff-time"
flagTickInterval = "tick-interval"
flagFullScanDiffTick = "full-scan-tick"
Copy link
Contributor Author

@Tristan1900 Tristan1900 Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed since not used

@@ -270,11 +270,6 @@ func (c *CheckpointAdvancer) WithCheckpoints(f func(*spans.ValueSortedFull)) {
f(c.checkpoints)
}

// only used for test
func (c *CheckpointAdvancer) NewCheckpoints(cps *spans.ValueSortedFull) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed since not used

@@ -149,7 +149,6 @@ func TestDaemon(t *testing.T) {
ow.RetireOwner()
req.False(ow.IsOwner())
app.AssertNotRunning(1 * time.Second)
ow.CampaignOwner()
Copy link
Contributor Author

@Tristan1900 Tristan1900 Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't need to campaign again to become leader since only one node

@@ -458,13 +457,6 @@ func (b *AtomicBool) UnmarshalText(text []byte) error {
return nil
}

// LogBackup is the config for log backup service.
// For now, it includes the embed advancer.
type LogBackup struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused

@Tristan1900 Tristan1900 marked this pull request as ready for review December 12, 2024 20:51
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 12, 2024
Signed-off-by: Wenqi Mou <[email protected]>
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 27.77778% with 39 lines in your changes missing coverage. Please review.

Project coverage is 74.6813%. Comparing base (d6b313f) to head (8e34b5e).
Report is 172 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58183        +/-   ##
================================================
+ Coverage   73.1461%   74.6813%   +1.5352%     
================================================
  Files          1675       1700        +25     
  Lines        461870     485247     +23377     
================================================
+ Hits         337840     362389     +24549     
+ Misses       103283     100775      -2508     
- Partials      20747      22083      +1336     
Flag Coverage Δ
integration 46.1031% <22.2222%> (?)
unit 72.4320% <27.7777%> (+0.1641%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 59.0998% <27.7777%> (+13.0924%) ⬆️

@Tristan1900
Copy link
Contributor Author

Tristan1900 commented Dec 22, 2024

tested manually using testbed
image

image

@Tristan1900
Copy link
Contributor Author

@BornChanger please take another look when you get a chance, thanks!

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 30, 2024
@@ -49,14 +57,19 @@ func DefineFlagsForCheckpointAdvancerConfig(f *pflag.FlagSet) {
"If the checkpoint lag is greater than how long, we would try to poll TiKV for checkpoints.")
f.Duration(flagCheckPointLagLimit, DefaultCheckPointLagLimit,
"The maximum lag could be tolerated for the checkpoint lag.")

// used for chaos testing
f.Duration(flagOwnershipCycleInterval, DefaultOwnershipCycleInterval,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we hide the parameter?

f.MarkHidden(flagOwnershipCycleInterval)

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 31, 2024
Copy link

ti-chi-bot bot commented Dec 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-30 06:38:40.113720139 +0000 UTC m=+332455.469724680: ☑️ agreed by BornChanger.
  • 2024-12-31 02:30:01.296278448 +0000 UTC m=+403936.652282987: ☑️ agreed by Leavrth.

Copy link

tiprow bot commented Dec 31, 2024

@Tristan1900: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 546eb1e link true /test fast_test_tiprow
tidb_parser_test 546eb1e link true /test tidb_parser_test

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.

Copy link

ti-chi-bot bot commented Dec 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, Leavrth, yudongusa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Dec 31, 2024
@Tristan1900
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Dec 31, 2024

@Tristan1900: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot merged commit a6cd5e7 into pingcap:master Dec 31, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

br: support log backup advancer operation
4 participants