Commit 8a868da
committed
ZOOKEEPER-4882: Fix data loss after rejoin and restart of a node experienced temporary disk error
The cause is multifold:
1. Leader will commit a proposal once quorum acked.
2. Proposal is able to be committed in node's memory even if it has not
been written to that node's disk.
3. In case of disk error, the txn log could lag behind memory database.
This way, node experienced temporary disk error will have hole in its
txn log after re-join. Once restarted, data will loss.
This commit complains the lag so to reload disk database to memory. This
way, the node will not be able to become leader and sync missing txns
from leader.
Refs: ZOOKEEPER-4882, ZOOKEEPER-49251 parent 6c5f788 commit 8a868da
File tree
8 files changed
+318
-13
lines changed- zookeeper-server/src
- main/java/org/apache/zookeeper/server
- persistence
- quorum
- test/java/org/apache/zookeeper
- server/quorum
- test
8 files changed
+318
-13
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
| 938 | + | |
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
366 | 367 | | |
367 | 368 | | |
368 | 369 | | |
369 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
384 | | - | |
385 | | - | |
386 | 391 | | |
387 | 392 | | |
388 | 393 | | |
| |||
427 | 432 | | |
428 | 433 | | |
429 | 434 | | |
| 435 | + | |
430 | 436 | | |
431 | 437 | | |
432 | 438 | | |
| |||
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
445 | 455 | | |
446 | 456 | | |
447 | 457 | | |
| |||
494 | 504 | | |
495 | 505 | | |
496 | 506 | | |
| 507 | + | |
497 | 508 | | |
498 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
499 | 514 | | |
500 | 515 | | |
501 | 516 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
461 | | - | |
462 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2263 | 2263 | | |
2264 | 2264 | | |
2265 | 2265 | | |
2266 | | - | |
| 2266 | + | |
| 2267 | + | |
2267 | 2268 | | |
2268 | 2269 | | |
2269 | 2270 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
0 commit comments