[release-3.6] fix: fsync snap directory when saving a received snapshot db- #22378 - #22401
Conversation
|
@silentred: GitHub didn't allow me to request PR reviews from the following users: gyuho. Note that only etcd-io members and repo collaborators can review this PR, and authors cannot review their own PRs. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 52 files with indirect coverage changes @@ Coverage Diff @@
## release-3.6 #22401 +/- ##
===============================================
- Coverage 68.83% 67.70% -1.13%
===============================================
Files 420 420
Lines 35900 35916 +16
===============================================
- Hits 24710 24318 -392
- Misses 9740 10154 +414
+ Partials 1450 1444 -6 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
lgtm, thanks |
|
please fix the test flaky (your second commit) in a separate PR, which we also need to cherrypick separately. thx |
Yes, that's why I make this PR back to draft. |
48f3e83 to
0cbe562
Compare
SaveDBFrom synced a received snapshot database before renaming it into place, but did not sync the containing directory. Linux fsync(2) documents that syncing a file does not necessarily persist its directory entry; the directory must also be synced. The snapshot receiver calls SaveDBFrom before processing the Raft message, which can later sync the WAL snapshot record. Sync the snapshot directory after rename and on the existing-file retry path, and return sync errors so snapshot handling stops before Raft processing. Add direct unit coverage that both SaveDBFrom paths invoke directory sync and propagate failures. Keep gofail E2E coverage scoped to failure/retry and crash-before-return control flow; remove tests and claims that did not establish directory-entry durability. Signed-off-by: Gyuho Lee <gyuhol@nvidia.com> (cherry picked from commit e9e5656) Signed-off-by: shenmu.wy <shenmu.wy@antfin.com>
0cbe562 to
b741e79
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, fuweid, silentred The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
backport of #22314
/cc @fuweid @ahrtr @gyuho