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

Make time chaos completely recoverable #2942

Merged
merged 85 commits into from
Apr 14, 2022

Conversation

Andrewmatilde
Copy link
Member

@Andrewmatilde Andrewmatilde commented Feb 25, 2022

What problem does this PR solve?

Time chaos cannot completely recover now.
Time chaos cannot combine chaos effect now.

What's changed and how it works?

Main:

  1. Add totally recover code to recover the chaos.
  2. Use tasks manager to combine time chaos effect , to ensure :
    After time_skew or recover_time_skew the status of target process will conform to the expected.
    Example: time_skew(1h) + time_skew(1h) + recover_(time_skew(1h)) -> time_skew(1h)

Other:
Add a nice common error package in pkg/cerr/..

Checklist

Tests

  • Unit test
  • E2E test

Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YangKeao
  • cwen0

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
# Conflicts:
#	pkg/chaosdaemon/pb/chaosdaemon.pb.go
#	pkg/chaosdaemon/server.go
#	pkg/chaosdaemon/time_server.go
#	pkg/time/fake_image.go
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
# Conflicts:
#	cmd/watchmaker/main_linux_amd64.go
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #2942 (3633ec6) into master (e3ff95e) will decrease coverage by 0.92%.
The diff coverage is 26.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2942      +/-   ##
==========================================
- Coverage   38.10%   37.18%   -0.93%     
==========================================
  Files         106      106              
  Lines        9359     9634     +275     
==========================================
+ Hits         3566     3582      +16     
- Misses       5481     5732     +251     
- Partials      312      320       +8     
Impacted Files Coverage Δ
pkg/chaosdaemon/tasks/key_lockmap.go 0.00% <0.00%> (ø)
pkg/chaosdaemon/tasks/pod_container_handler.go 0.00% <0.00%> (ø)
pkg/chaosdaemon/tasks/process_group_handler.go 0.00% <0.00%> (ø)
pkg/chaosdaemon/time_server.go 0.00% <0.00%> (-87.24%) ⬇️
pkg/chaosdaemon/tasks/task_manager.go 40.54% <30.76%> (-3.26%) ⬇️
pkg/time/time_skew.go 35.03% <35.03%> (ø)
pkg/time/fake_image_linux_amd64.go 48.27% <47.22%> (-3.29%) ⬇️
pkg/chaosdaemon/tasks/task_config_manager.go 47.36% <48.64%> (-4.96%) ⬇️
pkg/chaosdaemon/server.go 38.88% <100.00%> (+2.52%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20c111c...3633ec6. Read the comment docs.

Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
@cwen0 cwen0 self-requested a review April 2, 2022 09:21
pkg/chaosdaemon/tasks/pod_handler.go Outdated Show resolved Hide resolved
pkg/chaosdaemon/tasks/task_config_manager.go Show resolved Hide resolved
controllers/chaosimpl/timechaos/impl.go Outdated Show resolved Hide resolved
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
# Conflicts:
#	pkg/chaosdaemon/time_server_test.go
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

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

As I cannot come up with a better idea. LGTM

Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Signed-off-by: andrewmatilde <davis6813585853062@outlook.com>
Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM

@cwen0
Copy link
Member

cwen0 commented Apr 14, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 3633ec6

@ti-chi-bot ti-chi-bot merged commit 47edada into chaos-mesh:master Apr 14, 2022
@Andrewmatilde Andrewmatilde mentioned this pull request Apr 15, 2022
51 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants