eBay / HomeStore

Storage Engine for block and key/value stores.
Apache License 2.0
23 stars 21 forks source link

Add protection for concurrent access to m_down_buffers #577

Closed koujl closed 3 weeks ago

koujl commented 3 weeks ago

Issue: https://github.com/eBay/HomeStore/issues/578

The down_buf has the real_up_buf (the meta buf) as its up_buffer, but cannot be found in the read_up_buf->m_down_buffers. The inconsistency is caused by unprotected concurrent writes to the vector m_down_buffers.

Add a mutex lock to IndexBuffer as well as extracting add/remove operations into member functions to make the vector thread-safe.

codecov-commenter commented 3 weeks ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 85.71429% with 5 lines in your changes missing coverage. Please review.

Project coverage is 67.30%. Comparing base (1a0cef8) to head (76fc41a). Report is 84 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/index/index_service.cpp 87.50% 1 Missing and 2 partials :warning:
src/lib/index/index_cp.cpp 75.00% 0 Missing and 1 partial :warning:
src/lib/index/wb_cache.cpp 85.71% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #577 +/- ## =========================================== + Coverage 56.51% 67.30% +10.79% =========================================== Files 108 109 +1 Lines 10300 10654 +354 Branches 1402 1454 +52 =========================================== + Hits 5821 7171 +1350 + Misses 3894 2787 -1107 - Partials 585 696 +111 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

koujl commented 3 weeks ago

Linked to https://github.com/eBay/HomeStore/issues/578