Skip to content

SDSTOR-20656: clear wbc chunk selector - #179

Merged
nnastonen merged 3 commits into
eBay:dev/v6.xfrom
nnastonen:SDSTOR-20656_clear_wbc_chunk_selector
Oct 9, 2026
Merged

nnastonen merged 3 commits into
eBay:dev/v6.xfrom
nnastonen:SDSTOR-20656_clear_wbc_chunk_selector

Conversation

@nnastonen

@nnastonen nnastonen commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
  1. Create homestore with chunk selector
  2. Create btree1 and populate it
  3. Nodes get into wbc cache
  4. Destroy btree1 (wbc purge is not done, also volume's chunk bitmap is not cleared)
  5. Create btree2 and populate it
  6. Nodes get into wbc cache and we get cache corruption, duplicate inserts

This change makes chunk release asynchronous and defers returning the chunk to the free pool until cleanup is complete.

New flow:

  • detach the volume's chunk list from m_volume_chunks
  • run asynchronous cleanup for all the chunks
  • in cleanup, evict all allocated blkids for the chunks from WBC
  • [reset the chunks' block allocator state (bitmap)]
  • reinsert the chunks into m_per_dev_chunks

This PR also addresses this ticket SDSTOR-20651

@nnastonen
nnastonen force-pushed the SDSTOR-20656_clear_wbc_chunk_selector branch from 9acfaee to ba8fe6d Compare September 11, 2026 17:23
@nnastonen
nnastonen force-pushed the SDSTOR-20656_clear_wbc_chunk_selector branch 4 times, most recently from 19e725e to 319632c Compare September 16, 2026 11:45
@nnastonen
nnastonen force-pushed the SDSTOR-20656_clear_wbc_chunk_selector branch from 319632c to 30d232f Compare September 24, 2026 08:40
@codecov-commenter

codecov-commenter commented Sep 24, 2026 •

Copy link
Copy Markdown

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

Codecov Report

❌ Patch coverage is 52.57143% with 83 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (dev/v6.x@d2e0087). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/volume/volume_chunk_selector.cpp 52.00% 19 Missing and 53 partials ⚠️
src/lib/homeblks_impl.cpp 37.50% 3 Missing and 7 partials ⚠️
src/lib/volume/volume.cpp 66.66% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##             dev/v6.x     #179   +/-   ##
===========================================
  Coverage            ?   49.92%           
===========================================
  Files               ?       19           
  Lines               ?     1338           
  Branches            ?      588           
===========================================
  Hits                ?      668           
  Misses              ?      275           
  Partials            ?      395           

☔ View full report in Codecov by Harness.
📢 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.

@nnastonen
nnastonen force-pushed the SDSTOR-20656_clear_wbc_chunk_selector branch 3 times, most recently from 7ac8639 to 0be2076 Compare September 25, 2026 12:57
@nnastonen
nnastonen force-pushed the SDSTOR-20656_clear_wbc_chunk_selector branch from 0be2076 to c5d3a6a Compare October 1, 2026 12:03
@shosseinimotlagh
shosseinimotlagh requested a balanced review from Copilot October 1, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Resize races, destruction ordering, and FlatBuffers field placement can cause crashes or compatibility failures.

Review effort: Balanced
Findings: 3 High severity · 1 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Introduces asynchronous chunk cleanup to prevent WBC corruption when destroyed-volume chunks are reused, alongside configurable lazy allocation.

Changes:

  • Quiesces selection/resizing before WBC eviction, allocator reset, and chunk reuse.
  • Adds dynamic chunk-allocation configuration and CLI override.
  • Expands concurrency tests and bumps the package version.
File Description
README.md Documents the allocation CLI option.
conanfile.py Bumps version to 6.0.11.
src/​lib/​home_blks_config.fbs Adds the allocation setting.
src/​lib/​homeblks_impl.cpp Resolves CLI/config allocation behavior.
src/​lib/​homeblks_impl.hpp Declares the configuration accessor.
src/​lib/​volume/​volume.cpp Applies allocation configuration to volumes.
src/​lib/​volume/​volume_chunk_selector.cpp Implements synchronized resizing and asynchronous cleanup.
src/​lib/​volume/​volume_chunk_selector.hpp Adds per-volume concurrency state.
src/​lib/​volume/​tests/​test_common.hpp Defines the test option default.
src/​lib/​volume/​tests/​test_volume_chunk_selector.cpp Adds concurrency and reuse tests.
src/​test/​legacy_ublk/​homeblk_ublk_cli.cpp Exposes the CLI override.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/home_blks_config.fbs
Comment thread src/lib/volume/volume_chunk_selector.cpp
Comment thread src/lib/volume/volume_chunk_selector.cpp Outdated
Comment thread src/lib/volume/volume_chunk_selector.cpp
Comment thread src/lib/volume/volume_chunk_selector.cpp Outdated

@shosseinimotlagh shosseinimotlagh 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.

LGTM

@JacksonYao287 JacksonYao287 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@nnastonen thanks for this PR, I am not quite familiar with homeblks, so just left a concern here.

pls correct me if I am wrong

Comment thread src/lib/volume/volume_chunk_selector.cpp
@nnastonen
nnastonen merged commit 67fe627 into eBay:dev/v6.x Oct 9, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants