Commit e0a3016
committed
Recover TierStore writes after a backup is removed
A write can be interrupted while a backup is configured, leaving unfinished
work in the journal. If the node then restarts without that backup, recovery
must not wait forever for a store that was deliberately removed.
Updates to existing keys were also not journaled. If the primary write
succeeded but the backup write failed, TierStore did not retain the value
needed to finish that update later.
Separately, a matching primary generation alone does not prove a backup is
current. If the local TierStore index has been replaced, the old index may
have contained unfinished operations that were lost with it, and generation
comparison alone would not detect this.
In this commit, we:
- Journal updates that must be written to both primary and backup storage.
- Allow unfinished creates, updates, and removals to finish using only the
primary store after restarting without the backup.
- Rotate the primary synchronization generation first, ensuring that the
missing backup is recognized as out of date when it is configured again.
- Reopen an existing TierStore index even when the backup is no longer
configured, so unfinished journal entries can still be recovered.
- Store the index database identity alongside the primary generation in the
backup completion record, and treat a completion from another index as
requiring synchronization.
- Add tests for failed updates, recovery without a backup, attempts to
recover before backup synchronization has been initialized, completion
encoding, and index replacement.
A later commit will copy the current primary data into a new or outdated
backup.
Assisted-by: Amp (AI coding agent)1 parent 97ed434 commit e0a3016
2 files changed
Lines changed: 411 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
995 | 1013 | | |
996 | 1014 | | |
997 | 1015 | | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | 1016 | | |
1005 | 1017 | | |
1006 | 1018 | | |
| |||
1011 | 1023 | | |
1012 | 1024 | | |
1013 | 1025 | | |
1014 | | - | |
1015 | 1026 | | |
1016 | 1027 | | |
1017 | 1028 | | |
| |||
0 commit comments