Skip to content

[Storage] Fix batch remove in ServiceEvents to use the correct batch (BadgerDB, Pebble) #7323

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

Merged

Conversation

fxamacker
Copy link
Member

@fxamacker fxamacker commented Apr 17, 2025

Updates #6527

Currently, instead of using the given batch, ServiceEvents.BatchRemoveByBlockID() creates a new batch and uses the new batch to remove service events.

This PR fixes ServiceEvents.BatchRemoveByBlockID() by using the given batch to remove service events.

I found this while getting familiar with storage code related to BadgerDB and Pebble.

Currently, instead of using the given batch (transaction),
ServiceEvents.BatchRemoveByBlockID() creates a new batch
(transaction) and uses the new batch (transaction) to
remove service events.

This commit fixes ServiceEvents.BatchRemoveByBlockID() by
using the given batch to remove service events.
@fxamacker fxamacker requested review from zhangchiqing and a team April 17, 2025 23:48
@fxamacker fxamacker self-assigned this Apr 17, 2025
@fxamacker fxamacker requested a review from a team as a code owner April 17, 2025 23:48
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2025

Codecov Report

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

Project coverage is 41.24%. Comparing base (252128f) to head (7a85af7).

Files with missing lines Patch % Lines
storage/store/events.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7323      +/-   ##
==========================================
- Coverage   41.25%   41.24%   -0.01%     
==========================================
  Files        2193     2193              
  Lines      192006   192004       -2     
==========================================
- Hits        79210    79198      -12     
- Misses     106189   106201      +12     
+ Partials     6607     6605       -2     
Flag Coverage Δ
unittests 41.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.

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

Copy link
Member

@zhangchiqing zhangchiqing left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks for the fix, Faye!

@fxamacker fxamacker requested a review from a team April 18, 2025 22:41
@fxamacker fxamacker added this pull request to the merge queue Apr 24, 2025
Merged via the queue into master with commit 6a11d9e Apr 24, 2025
57 checks passed
@fxamacker fxamacker deleted the fxamacker/fix-service-events-remove-not-using-passed-rw branch April 24, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants