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
Fix the issue that io delay injected does not take effect #121
Conversation
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
This pr need queey's test. can you help to test it @mahjonp |
if err := utils.UnsetIoInjection(ctx, r.Client, pod, iochaos); err != nil { | ||
r.Log.Error(err, "failed to unset I/O injection", | ||
return true, nil | ||
}, cctx.Done()) |
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.
When network is not ok, Poll loop and cctx
timeout, wait.PollUntil
will return timeout err or nil?
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.
timeout err
Signed-off-by: cwen0 <cwenyin0@gmail.com>
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.
LGTM
scripts/init.sh
Outdated
} | ||
|
||
copy_scripts() { | ||
echo $1 |
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.
polish codes?
// input is closed, so lets signal one last time if we have any pending unsignalled events | ||
if signalled { | ||
// send final event, so we dont miss the trailing event after input chan close | ||
output <- struct{}{} |
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 comment on Coalescer
is inaccurate
// it signals on output chan with the last value from input chan
and why remove closing the output channel?
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.
Closing output channel maybe better.
- -original=/var/lib/tikv/data | ||
- -mountpoint=/var/lib/tikv/fuse-data | ||
- -original=/var/lib/tikv/fuse-data | ||
- -mountpoint=/var/lib/tikv/data |
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 arg name is misleading..
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.
@ethercflow PTAL
doc/sidecar_configmap.md
Outdated
This directory is usually set to the same level directory as the original directory. | ||
* **mountpoint**: defines the mountpoint to mount original directory. |
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.
Seems this description is contradictory with how it is used actually?
- -original=/var/lib/tikv/fuse-data
- -mountpoint=/var/lib/tikv/data
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, I will fix it.
@@ -187,6 +187,7 @@ func watchConfig(cfg *config.Config, stopCh <-chan struct{}) { | |||
case <-stopCh: | |||
close(sigChan) | |||
return | |||
default: |
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.
why add the default branch? this may cause there exist multiple configWatchers that notify the eventsCh at the same time?
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.
No, this branch
just used to restart configWatcher.Watch
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.
I misunderstood the stopCh before, I thought it was used by configWatcher to notify the outer goroutine that it had been finished.
If configWatcher.Watch
or eventsCh
first received the msg from stopCh before the outer goroutine, the configWatcher.Watch
will be restarted forever because case <- stopCh at line 187 won't receive msg again? how to solve this problem?
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.
stopCh
will be closed, so all receiver will receive this event.
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.
Got, that's ok
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.
Restarting is ok for ErrWatchChannelClosed case, is that ok for other err?
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.
rest lgtm
What's the reason of not support inject sidecar dynamically now? |
Signed-off-by: cwen0 <cwenyin0@gmail.com>
If the application was created, the data directory of the application was not empty, we can't use |
Codecov Report
@@ Coverage Diff @@
## master #121 +/- ##
=========================================
Coverage ? 29.96%
=========================================
Files ? 24
Lines ? 801
Branches ? 0
=========================================
Hits ? 240
Misses ? 530
Partials ? 31
Continue to review full report at Codecov.
|
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.
LGTM
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.
LGTM
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.
LGTM
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.
lgtm
Signed-off-by: cwen0 cwenyin0@gmail.com
What problem does this PR solve?
mountpoint
of the fuse serverchaosfs
container dynamically and only support injectchaosfs
container before the application created.If the application was created, the data directory of the application was not empty, we can't use 'fusermount' to mount it and we must rename it to
fuse-data
, but If we rename the data directory, there is a risk that the application will not start properly because the data directory cannot be found when the pod was restarted.Check List
Tests
Does this PR introduce a user-facing change?: