Skip to content

Conversation

@csfmomo
Copy link
Contributor

@csfmomo csfmomo commented Mar 12, 2021

fix: Change version comparison from string to int and as well as the following 3 improvements.
1. Add more log in SyncHostNCVersion.
2. Remove unnecessary check for MarkIpsAsAvailable.
3. Auto formatting.

Reason for Change:
Logs are not sufficient enough to debug.

Issue Fixed:
After these logs got added, it will unsure whether host version got updated.
In another word, after log got added, we are clear whether select sentence after channel got executed porperly.

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #821 (a41a8d6) into master (4096ab1) will decrease coverage by 0.18%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
- Coverage   42.23%   42.04%   -0.19%     
==========================================
  Files         152      152              
  Lines       14335    14379      +44     
==========================================
- Hits         6054     6046       -8     
- Misses       7554     7596      +42     
- Partials      727      737      +10     

@csfmomo csfmomo force-pushed the fixChannel branch 2 times, most recently from 1600635 to 5fcd7e0 Compare March 15, 2021 20:58
@csfmomo csfmomo changed the title Add more log in SyncHostNCVersion. Change version comparison from string to int and add more log in SyncHostNCVersion. Mar 16, 2021
Copy link
Contributor

@ramiro-gamarra ramiro-gamarra left a comment

Choose a reason for hiding this comment

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

A test should be added to the function that failed previously

previousHostNCVersion := ncInfo.HostVersion
previousHostNCVersion, err := strconv.Atoi(ncInfo.HostVersion)
if err != nil {
logger.Printf("[MarkIpsAsAvailableUntransacted] Get int value from ncInfo.HostVersion %s failed for %v", ncInfo.HostVersion, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: better to use colon than for

[MarkIpsAsAvailableUntransacted] Get int value from ncInfo.HostVersion %s failed: %v

also, if it fails, the rest of the block should not execute, since it would be acting on previousHostNCVersion being 0. Probably should continue here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll return here.

… int to avoid bug when version 9 update to 10.

2. Add more log in SyncHostNCVersion.
3. Remove unnecessary check for MarkIpsAsAvailable.
4. Auto formatting.
@csfmomo csfmomo merged commit 580eb0c into master Mar 17, 2021
@csfmomo csfmomo deleted the fixChannel branch March 17, 2021 23:54
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.

3 participants