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

feat(bitmap): Move bitmap (port allocation tracking) to common libs. … #60

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

james-munson
Copy link
Contributor

@james-munson james-munson commented Aug 9, 2024

… Extend to avoid immediate reuse of freed.

Which issue(s) this PR fixes:

Part 1 of longhorn/longhorn#8598.
Part 2 would be to remove the duplicated bitmap code from other repos and point them at this one.

What this PR does / why we need it:

Special notes for your reviewer:

For a handy diff of the new code against the old instance-manager version, see https://github.com/longhorn/longhorn-instance-manager/pull/625/files#diff-c65bce8b6b1aef67ab3a2a6dcd87b0834084a68d06b9f1ce1f127ab8612df22a

Additional documentation or context

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.84%. Comparing base (b6ddc3e) to head (19ae6af).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   78.93%   79.84%   +0.91%     
==========================================
  Files          32       33       +1     
  Lines        1519     1583      +64     
==========================================
+ Hits         1199     1264      +65     
+ Misses        204      203       -1     
  Partials      116      116              
Flag Coverage Δ
unittests 79.84% <100.00%> (+0.91%) ⬆️

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.

Copy link

@ejweber ejweber left a comment

Choose a reason for hiding this comment

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

LGTM in principle.

  • One question that I think is only for my own understanding.
  • One nit for our standard error formatting conventions.

It looks like we have pretty strong checking for code coverage in this library compared to some of our other repos! The Codecov warnings are pretty pedantic here, but they seem like they can easily be covered by a few additional test cases with "bad" inputs. WDYT about handling them before merging?

bitmap/bitmap.go Outdated Show resolved Hide resolved
bitmap/bitmap.go Outdated Show resolved Hide resolved
@james-munson
Copy link
Contributor Author

james-munson commented Aug 15, 2024

@ejweber, thanks for the review. The gaps in coverage were there when I got there, but as you say, it is the work of a moment to cure that as well, so why not?

ejweber
ejweber previously approved these changes Aug 16, 2024
Copy link

@ejweber ejweber left a comment

Choose a reason for hiding this comment

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

LGTM.

@ejweber
Copy link

ejweber commented Aug 16, 2024

The merge is blocked here for a similar reason to longhorn/longhorn-ui#679 (comment). It looks like this repo is also configured to reguire GPG (or other) signing? I don't have access to the settings to check the details. Is this expected @derekbit / @innobead?

(BTW it is fine to wait for @PhanLe1010 or @shuo-wu to take a look as well before we merge. Eventually though, we will need to unblock this.)

bitmap/bitmap.go Show resolved Hide resolved
bitmap/bitmap.go Show resolved Hide resolved
@james-munson james-munson requested a review from shuo-wu August 16, 2024 21:15
@derekbit
Copy link
Member

The merge is blocked here for a similar reason to longhorn/longhorn-ui#679 (comment). It looks like this repo is also configured to reguire GPG (or other) signing? I don't have access to the settings to check the details. Is this expected @derekbit / @innobead?

(BTW it is fine to wait for @PhanLe1010 or @shuo-wu to take a look as well before we merge. Eventually though, we will need to unblock this.)

It looks like this repo is also configured to reguire GPG (or other) signing?

No, we don't need it and configure it.

Unfortunately, I'm encountering the same issue. Figuring out the root cause...
image

cc @innobead

bitmap/bitmap.go Show resolved Hide resolved
bitmap/bitmap.go Outdated Show resolved Hide resolved
bitmap/bitmap.go Show resolved Hide resolved
bitmap/bitmap.go Show resolved Hide resolved
bitmap/bitmap.go Outdated Show resolved Hide resolved
…e reuse

Signed-off-by: James Munson <james.munson@suse.com>
Copy link

@shuo-wu shuo-wu left a comment

Choose a reason for hiding this comment

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

In general LGTM

bitmap/bitmap_test.go Show resolved Hide resolved
@derekbit derekbit merged commit d0ebd0a into longhorn:main Aug 20, 2024
7 checks passed
@james-munson james-munson deleted the 8598-bitmap-offset branch August 20, 2024 16:05
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.

4 participants