Skip to content

Fix data corruption on CP persistence inconsistency#452

Merged
koujl merged 2 commits into
eBay:stable/v4.xfrom
koujl:recommit
Jul 16, 2026
Merged

Fix data corruption on CP persistence inconsistency#452
koujl merged 2 commits into
eBay:stable/v4.xfrom
koujl:recommit

Conversation

@koujl

@koujl koujl commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

https://jirap.corp.ebay.com/browse/SDSTOR-23023

During BR the IndexSvc journal and the AppendBlkAllocator CP superblock are flushed in parallel with no atomicity guarantee. If the process crashes after the index entry is durable but before the allocator superblock is written, the receiver resumes with the blk_id visible in the index but the allocator watermarks reset. The dedup skip path then bypasses commit_blk entirely, leaving the blocks silently available for reallocation by subsequent blob writes and corrupting the data on disk.

The fix re-commits the blk_id recovered from the index entry so the allocator watermarks are restored before new allocations proceed.

Related PR: eBay/HomeStore#896


Also fixes a bug from #435 (https://jirap.corp.ebay.com/browse/SDSTOR-23162)

During BR the IndexSvc journal and the AppendBlkAllocator CP superblock
are flushed in parallel with no atomicity guarantee. If the process
crashes after the index entry is durable but before the allocator
superblock is written, the receiver resumes with the blk_id visible in
the index but the allocator watermarks reset. The dedup skip path then
bypasses commit_blk entirely, leaving the blocks silently available for
reallocation by subsequent blob writes and corrupting the data on disk.

The fix re-commits the blk_id recovered from the index entry so
the allocator watermarks are restored before new allocations proceed.
@codecov-commenter

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 83.33333% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (stable/v4.x@400a379). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ib/homestore_backend/replication_state_machine.cpp 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##             stable/v4.x     #452   +/-   ##
==============================================
  Coverage               ?   54.82%           
==============================================
  Files                  ?       36           
  Lines                  ?     5319           
  Branches               ?      670           
==============================================
  Hits                   ?     2916           
  Misses                 ?     2109           
  Partials               ?      294           

☔ 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.

@koujl
koujl marked this pull request as ready for review July 15, 2026 13:04

@JacksonYao287 JacksonYao287 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@xiaoxichen xiaoxichen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@koujl
koujl merged commit 1ec4bd5 into eBay:stable/v4.x Jul 16, 2026
45 of 49 checks passed
@koujl
koujl deleted the recommit branch July 16, 2026 01:36
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.

4 participants