-
Notifications
You must be signed in to change notification settings - Fork 62
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
kmesh restart with config change #640
Conversation
Signed-off-by: let-bit <[email protected]>
Codecov ReportAttention: Patch coverage is
... and 12 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Signed-off-by: let-bit <[email protected]>
return nil | ||
} | ||
|
||
func (p *Processor) removeWorkloadResourceByUid(uid string) 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.
suggest renaming to removeWorkloadFromBpfMap to distinguish with remove from local cache
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.
In fact, the same interface is called by remove from local chace, I split it out and reused it .
} | ||
backendUid := p.hashName.StrToNum(uid) | ||
// for Pod to Pod access, Pod info stored in frontend map, when Pod offline, we need delete the related records | ||
if err = p.deletePodFrontendData(backendUid); err != 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.
cc @nlgwcy Is fixing this, but it think any one can merge first
bv = bpf.BackendValue{} | ||
) | ||
|
||
if kmeshbpf.GetStartType() == kmeshbpf.Normal { |
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.
Since we haven't support upgrade, to be safer shall we compare with RESTART
only?
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 change it
kmeshbpf.SetStartType(kmeshbpf.Normal) | ||
for str, num := range p.hashName.strToNum { | ||
if p.WorkloadCache.GetWorkloadByUid(str) == nil && p.ServiceCache.GetService(str) == nil { | ||
log.Debugf("GetWorkloadByUid and GetService nil:%v", str) |
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.
We cannot assume all the strs are service or pod, can we?
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 was careless here. I should add a check process in bpf_map.
cannot see how you make |
And you did not handle service delete |
When restarting, Status=Restart, and set it to Normal after execution to ensure that the function is only executed once. |
@lec-bit Address the comments and we can merge |
Signed-off-by: let-bit <[email protected]>
return | ||
} | ||
|
||
log.Infof("reload workload config from last start") |
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.
log.Infof("reload workload config from last start") | |
log.Infof("reload workload config from last epoch") |
kmeshbpf.SetStartType(kmeshbpf.Normal) | ||
|
||
// The record exists in the hashName file, exists in Backend or Service bpfmap, | ||
// and does not exist in cache. |
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.
Confusing
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 guess you mean when the str exists in hash file:
- if not in the userspace cache, we should delete it from bpf
Signed-off-by: let-bit <[email protected]>
/lgtm Thanks, this is a great improvement. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: