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

Fix the problem of LockObtainFailedException while performing a rolling update #6543

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

JohnNiang
Copy link
Member

What type of PR is this?

/kind bug
/area core
/milestone 2.19.0

What this PR does / why we need it:

This PR refactors LuceneSearchEngine to let IndexWriter and SearcherManager load lazily to prevent LockObtainFailedException from performing a rolling update.

Which issue(s) this PR fixes:

Fixes #6541

Special notes for your reviewer:

  1. Use MySQL or PostgreSQL as database for Halo
  2. Start an instance of Halo
  3. Try to initialize Halo and search posts
  4. Change the server.port and start another instance of Halo
  5. Check the status of another instance

Does this PR introduce a user-facing change?

修复滚动更新时无法启动新的 Halo 实例的问题

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Aug 28, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.19.0 milestone Aug 28, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from guqing and LIlGG August 28, 2024 16:14
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Aug 28, 2024
Copy link

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 83.87097% with 10 lines in your changes missing coverage. Please review.

Project coverage is 57.77%. Comparing base (6cd8dc8) to head (74b7bb2).
Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
...run/halo/app/search/lucene/LuceneSearchEngine.java 83.87% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6543      +/-   ##
============================================
- Coverage     58.18%   57.77%   -0.41%     
- Complexity     3774     3876     +102     
============================================
  Files           651      669      +18     
  Lines         22125    22917     +792     
  Branches       1538     1594      +56     
============================================
+ Hits          12873    13241     +368     
- Misses         8641     9053     +412     
- Partials        611      623      +12     

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

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/approve

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2024
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2024
Copy link

f2c-ci-robot bot commented Aug 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing, ruibaby

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit 157b7ad into halo-dev:main Aug 29, 2024
8 checks passed
@JohnNiang JohnNiang deleted the refactor/locked-by-lucene branch September 2, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lucene全程加锁导致应用无法正常轮换
3 participants