-
Notifications
You must be signed in to change notification settings - Fork 77
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
[patch] [agent-NGT, sidecar] Improve S3 backup/recover behavior #556
[patch] [agent-NGT, sidecar] Improve S3 backup/recover behavior #556
Conversation
[CHATOPS:HELP] ChatOps commands.
|
Codecov Report
@@ Coverage Diff @@
## master #556 +/- ##
==========================================
- Coverage 11.75% 11.71% -0.04%
==========================================
Files 404 407 +3
Lines 20928 21207 +279
==========================================
+ Hits 2460 2485 +25
- Misses 18205 18445 +240
- Partials 263 277 +14
Continue to review full report at Codecov.
|
0d3560f
to
acbcb8f
Compare
833f237
to
daa7c7c
Compare
[WARNING:INTCFG] Changes in |
e796e86
to
6544d39
Compare
} | ||
if n.dvc == nil { | ||
n.dvc = new(vcaches) | ||
func (n *ngt) initNGT(opts ...core.Option) (err error) { |
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.
[golangci] reported by reviewdog 🐶
Function 'initNGT' is too long (103 > 60) (funlen)
pkg/agent/core/ngt/service/ngt.go
Outdated
if err != nil { | ||
return err | ||
} | ||
defer f.Close() |
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.
[golangci] reported by reviewdog 🐶
Error return value of f.Close
is not checked (errcheck)
pkg/agent/core/ngt/service/ngt.go
Outdated
|
||
eg, _ := errgroup.New(ctx) | ||
eg.Go(safety.RecoverFunc(func() (err error) { | ||
select { |
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.
[golangci] reported by reviewdog 🐶
S1000: should use a simple channel send/receive instead of select
with a single case (gosimple)
0c68d8a
to
ca58ce7
Compare
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
121eec7
to
a8db9be
Compare
[FORMAT] Updating license headers and formatting go codes triggered by rinx. |
@@ -25,7 +25,7 @@ jobs: | |||
- name: Check out code. | |||
uses: actions/checkout@v1 | |||
with: | |||
fetch-depth: 1 | |||
fetch-depth: 10 |
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.
could you please teach me about this change.
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.
sometimes this workflow fails on master branch because of failing to fetch commits.
https://github.com/vdaas/vald/actions/runs/164399448
To prevent this, it is better to fetch not only the latest commit.
pkg/agent/core/ngt/service/ngt.go
Outdated
} | ||
|
||
if !n.inMem && len(cfg.IndexPath) != 0 { | ||
n.path = cfg.IndexPath | ||
if in, ok := n.indexing.Load().(bool); !ok || in { |
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 we call New
method, indexing valueable always contains nil.
so I think the following is better 🤔
if in, ok := n.indexing.Load().(bool); !ok || in { | |
n.indexing.Store(false) |
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.
Thanks! i'll fix it.
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
Signed-off-by: Rintaro Okamura <[email protected]>
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: Rintaro Okamura [email protected]
Description:
sidecar now watches only changes in {index_path}/metadata.json and it triggers a backup process.
the
post_stop_timeout
has different meaning compared to before.in the post-stop process, sidecar also watches changes in {index_path}/metadata.json, and if there's changes in it, it creates a backup in S3. however, there's no changes within
post_stop_timeout
, also it starts to create a backup.7/13:
metadata.json now contains "is_invalid" field that indicates the backup files are valid or not.
if it is
true
, sidecar will not upload the backup files and terminate itself immediately.Related Issue:
#503 #551 #581
How Has This Been Tested?:
nothing
Environment:
Types of changes:
Changes to Core Features:
Checklist: