Commit e157523
committed
reset-replication: refuse Mode B (live data-file corruption)
If the pre-teardown checkpoint fails with a DatabaseCorrupt / malformed
error, the live data file itself is corrupt. Rebuilding the wallog from
corrupt data would just propagate the corruption AND leave the namespace
in a broken state (the destroy-then-make sequence fails halfway, leaving
NamespaceDoesntExist).
Now the endpoint returns 500 with an explicit error message pointing the
operator to a restore-from-backup path, without destroying the in-memory
namespace first. The namespace stays loaded and returns the underlying
corruption error to subsequent reads — a true observability signal.
Verified with /tmp/test_mode_b.sh: before fix, namespace went to 404
after reset; after fix, namespace stays loaded with 'malformed database
schema' error. Mode A happy path (wallog corruption, live data OK)
unchanged: 1135ms p95 over 3 reps, 100% data preserved.1 parent 84b4b1c commit e157523
1 file changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
259 | 266 | | |
260 | | - | |
261 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
262 | 287 | | |
263 | 288 | | |
264 | 289 | | |
| |||
0 commit comments