Skip to content

linstor: do not use the same static ApiClient for all calls#9326

Merged
sureshanaparti merged 1 commit into
apache:4.18from
LINBIT:linstor-4.18-fix-static-apiclient
Jul 3, 2024
Merged

linstor: do not use the same static ApiClient for all calls#9326
sureshanaparti merged 1 commit into
apache:4.18from
LINBIT:linstor-4.18-fix-static-apiclient

Conversation

@rp-

@rp- rp- commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

Description

This PR fixes a race condition with multiple Linstor primary storages and different controller IP's.

The client.setBasePath() would overwrite the Linstor controller IP/host for all current client users. This is basically a race condition that triggered as soon as you had configured 2 different primary storages with different Linstor controllers.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Basic operations on a Linstor cluster with 2 different linstor controllers.

How did you try to break this feature and the system with this change?

The client.setBasePath() would overwrite the Linstor controller IP/host
for all current client users. This is basically a race condition
that triggered as soon as you had configured 2 different primary storages
with different Linstor controllers.
@rp-

rp- commented Jul 2, 2024

Copy link
Copy Markdown
Contributor Author

@DaanHoogland
this one is more critical and should be included into 4.19.1.0

@codecov

codecov Bot commented Jul 2, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 12.24%. Comparing base (983f164) to head (514c03c).

Files Patch % Lines
...cloudstack/storage/datastore/util/LinstorUtil.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.18    #9326   +/-   ##
=========================================
  Coverage     12.24%   12.24%           
- Complexity     9295     9297    +2     
=========================================
  Files          4699     4699           
  Lines        414347   414347           
  Branches      50906    50845   -61     
=========================================
+ Hits          50731    50741   +10     
+ Misses       357311   357300   -11     
- Partials       6305     6306    +1     
Flag Coverage Δ
unittests 12.24% <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.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@DaanHoogland this one is more critical and should be included into 4.19.1.0

cc @sureshanaparti

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan package

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@sureshanaparti sureshanaparti merged commit 121a35d into apache:4.18 Jul 3, 2024
@sureshanaparti

Copy link
Copy Markdown
Contributor

Merged based on the reviews, and tests on Linstor from the maintainer.

@rp- rp- deleted the linstor-4.18-fix-static-apiclient branch July 4, 2024 13:04
@rp-

rp- commented Jul 5, 2024

Copy link
Copy Markdown
Contributor Author

@DaanHoogland just curious, when will this be merged to 4.19 branch?

vishesh92 added a commit that referenced this pull request Jul 5, 2024
* 4.18:
  linstor: deleteAsync fallback to volume UUID if path not set yet (#9325)
  linstor: do not use the same static ApiClient for all calls (#9326)
@sureshanaparti

Copy link
Copy Markdown
Contributor

@DaanHoogland just curious, when will this be merged to 4.19 branch?

@rp- changes are merged to 4.19, please check.

@rp-

rp- commented Jul 5, 2024

Copy link
Copy Markdown
Contributor Author

@DaanHoogland just curious, when will this be merged to 4.19 branch?

@rp- changes are merged to 4.19, please check.

cool, they are there now, thanks

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 15, 2024
)

The client.setBasePath() would overwrite the Linstor controller IP/host
for all current client users. This is basically a race condition
that triggered as soon as you had configured 2 different primary storages
with different Linstor controllers.
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 15, 2024
* 4.18:
  linstor: deleteAsync fallback to volume UUID if path not set yet (apache#9325)
  linstor: do not use the same static ApiClient for all calls (apache#9326)
rp- added a commit to LINBIT/cloudstack that referenced this pull request Aug 21, 2024
)

The client.setBasePath() would overwrite the Linstor controller IP/host
for all current client users. This is basically a race condition
that triggered as soon as you had configured 2 different primary storages
with different Linstor controllers.
rp- added a commit to LINBIT/cloudstack that referenced this pull request Feb 24, 2026
)

The client.setBasePath() would overwrite the Linstor controller IP/host
for all current client users. This is basically a race condition
that triggered as soon as you had configured 2 different primary storages
with different Linstor controllers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants