Skip to content

khepri_cluster: Acquire lock before doing a read/modify/write on ?PT_STORE_IDS#337

Merged
dumbbell merged 1 commit into
v0.17.xfrom
protect-writes-to-PT_STORE_IDS-with-locks
Jul 22, 2025
Merged

khepri_cluster: Acquire lock before doing a read/modify/write on ?PT_STORE_IDS#337
dumbbell merged 1 commit into
v0.17.xfrom
protect-writes-to-PT_STORE_IDS-with-locks

Conversation

@dumbbell
Copy link
Copy Markdown
Collaborator

@dumbbell dumbbell commented Jul 22, 2025

Why

The code was reading the persistent term, adding/removing a key and writing the persistent term again.

When several stores are started and/or stopped in parallel, these unprotected concurent read/modify/write operations could cause some store properties to be lost in the process.

How

The code now acquires a local lock before proceeding with this read/modify/write.

…STORE_IDS

[Why]
The code was reading the persistent term, adding/removing a key and
writing the persistent term again.

When several stores are started and/or stopped in parallel, these
unprotected concurent read/modify/write operations could cause some
store properties to be lost in the process.

[How]
The code now acquires a local lock before proceeding with this
read/modify/write.
@dumbbell dumbbell added this to the v0.17.2 milestone Jul 22, 2025
@dumbbell dumbbell self-assigned this Jul 22, 2025
@dumbbell dumbbell added the bug Something isn't working label Jul 22, 2025
@dumbbell dumbbell changed the title khepri_cluster: Acquire lock before doing a read/modify/write on ?PT_… khepri_cluster: Acquire lock before doing a read/modify/write on ?PT_STORE_IDS Jul 22, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.41%. Comparing base (b1783bb) to head (2e2ff90).
Report is 2 commits behind head on v0.17.x.

Additional details and impacted files
@@             Coverage Diff             @@
##           v0.17.x     #337      +/-   ##
===========================================
- Coverage    89.59%   89.41%   -0.18%     
===========================================
  Files           22       22              
  Lines         3430     3439       +9     
===========================================
+ Hits          3073     3075       +2     
- Misses         357      364       +7     
Flag Coverage Δ
erlang-26 89.38% <100.00%> (-0.01%) ⬇️
erlang-27 89.38% <100.00%> (-0.15%) ⬇️
os-ubuntu-latest 89.41% <100.00%> (+0.02%) ⬆️
os-windows-latest 89.41% <100.00%> (-0.18%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dumbbell dumbbell marked this pull request as ready for review July 22, 2025 15:53
@dumbbell dumbbell merged commit 5ad9c14 into v0.17.x Jul 22, 2025
22 checks passed
@dumbbell dumbbell deleted the protect-writes-to-PT_STORE_IDS-with-locks branch July 22, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant