tikv / raft-engine

A persistent storage engine for Multi-Raft log
Apache License 2.0
564 stars 88 forks source link

fix data loss after partial rewrite-rewrite #289

Closed tabokie closed 1 year ago

tabokie commented 1 year ago

Fix #288 by adding a file marker during rewrite.

A more elegant fix would be https://github.com/tikv/raft-engine/issues/252, but that requires some radical architectural changes.

Signed-off-by: tabokie xy.tao@outlook.com

codecov[bot] commented 1 year ago

Codecov Report

Base: 97.65% // Head: 97.22% // Decreases project coverage by -0.43% :warning:

Coverage data is based on head (b17e118) compared to base (81aa5bb). Patch coverage: 77.77% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #289 +/- ## ========================================== - Coverage 97.65% 97.22% -0.44% ========================================== Files 30 30 Lines 10634 10803 +169 ========================================== + Hits 10385 10503 +118 - Misses 249 300 +51 ``` | [Impacted Files](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | Coverage Δ | | |---|---|---| | [src/lib.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2xpYi5ycw==) | `100.00% <ø> (ø)` | | | [src/pipe\_log.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL3BpcGVfbG9nLnJz) | `93.93% <ø> (ø)` | | | [src/file\_pipe\_log/pipe.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2ZpbGVfcGlwZV9sb2cvcGlwZS5ycw==) | `94.12% <2.85%> (-5.37%)` | :arrow_down: | | [src/file\_pipe\_log/log\_file.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2ZpbGVfcGlwZV9sb2cvbG9nX2ZpbGUucnM=) | `96.96% <42.85%> (-3.04%)` | :arrow_down: | | [src/file\_pipe\_log/pipe\_builder.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2ZpbGVfcGlwZV9sb2cvcGlwZV9idWlsZGVyLnJz) | `96.20% <50.00%> (ø)` | | | [src/purge.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL3B1cmdlLnJz) | `95.31% <89.65%> (-1.91%)` | :arrow_down: | | [src/engine.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2VuZ2luZS5ycw==) | `97.85% <97.56%> (-0.05%)` | :arrow_down: | | [tests/failpoints/test\_engine.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-dGVzdHMvZmFpbHBvaW50cy90ZXN0X2VuZ2luZS5ycw==) | `99.85% <100.00%> (+<0.01%)` | :arrow_up: | | [src/codec.rs](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#diff-c3JjL2NvZGVjLnJz) | `98.34% <0.00%> (-0.34%)` | :arrow_down: | | ... and [1 more](https://codecov.io/gh/tikv/raft-engine/pull/289?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.