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

refactor: engine consolidates the replica related maps into a single one #208

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shuo-wu
Copy link
Contributor

@shuo-wu shuo-wu commented Aug 17, 2024

Which issue(s) this PR fixes:

Issue longhorn/longhorn#9244

What this PR does / why we need it:

Special notes for your reviewer:

Additional documentation or context

Longhorn 9244

Signed-off-by: Shuo Wu <shuo.wu@suse.com>
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 185 lines in your changes missing coverage. Please review.

Project coverage is 8.98%. Comparing base (e2b1279) to head (a6658cc).
Report is 2 commits behind head on main.

Files Patch % Lines
pkg/spdk/engine.go 0.00% 185 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #208   +/-   ##
=====================================
  Coverage   8.97%   8.98%           
=====================================
  Files         22      22           
  Lines       6994    6989    -5     
=====================================
  Hits         628     628           
+ Misses      6287    6282    -5     
  Partials      79      79           
Flag Coverage Δ
unittests 8.98% <0.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

for replicaName := range e.ReplicaAddressMap {
if e.ReplicaModeMap[replicaName] == types.ModeERR {
for replicaName, replicaStatus := range e.ReplicaStatusMap {
if replicaStatus.Mode != types.ModeRW && replicaStatus.Mode != types.ModeWO {
Copy link
Contributor

Choose a reason for hiding this comment

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

Slight logic change here in the case that Mode is unset and is "". But perhaps better, because it will be skipped, just as for ModeERR.

@shuo-wu shuo-wu marked this pull request as ready for review August 24, 2024 02:40
…aAdd start

Otherwise, the above e.checkAndUpdateInfoFromReplicaNoLock() call
will fail the rebuilding replica

Signed-off-by: Shuo Wu <shuo.wu@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants