Commit 93f60db
[ISSUE #9713] Improve data consistency in DefaultMappedFile flush method
- Move FLUSHED_POSITION_UPDATER.set() inside try block
- Prevent false positive flush success when actual flush operation fails
- Ensure data consistency and prevent potential data loss on system crash
Previously, flushed position was updated even when flush operation failed,
which could lead to data loss as the system would incorrectly assume
data was persisted to disk when it was still in memory.
Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>1 parent 1d9b02c commit 93f60db
1 file changed
Lines changed: 5 additions & 6 deletions
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
535 | 539 | | |
536 | 540 | | |
537 | 541 | | |
538 | 542 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
564 | | - | |
565 | | - | |
566 | 565 | | |
567 | 566 | | |
568 | 567 | | |
| |||
0 commit comments