Repository navigation
Commit 9d8cdf5
committed
Snap,restore: Make sure DRBD_INITIALIZED is handled correctly
As the update JavaDoc explains, the code so far only handled snapshot
restore cases that came from backup restore, but not regular "s r rst ...".
Since SnapVlmDfns do not properly store VlmDfn Flags, the VlmDfn flag
DRBD_INITIALIZED was never set on the restored VlmDfn, which caused the
restored to run the "I won the race" logic.
The symptoms depend on the situation: If the restored resource is placed
as diskless resource on the same node where the original resource won the
race, the diskless resource most likely tries to "drbdadm primary --force"
itself before trying to check/create FS. That "primary" most likely fails
simply because it is too fast and it is attempted before DRBD had a chance
to connect to a diskful node.
If the restored resource on the previously winning node is a diskful one,
the restored "winner" will create new metadata (and run mkfs) - this could
lead to split-brain scenarios.
This patch fixes this issue two-fold:
* Make sure that normal "s r rst .." have the DRBD_INITIALIZED flag set
* Always update the winner-property to a current diskful node.
The latter point would also fix without having the first point in place
since a winning restored diskful resource would find its existing metadata
(no create-md), it _would_ become primary briefly only to see that a FS
already exists (no mkfs), get secondary again and notify the controller
that it has initialized the VlmDfn which also causes the flag to get set.1 parent a7d2984 commit 9d8cdf5
2 files changed
Lines changed: 29 additions & 8 deletions
File tree
- controller/src/main/java/com/linbit/linstor/core/apicallhandler/controller
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
444 | | - | |
| 450 | + | |
445 | 451 | | |
446 | | - | |
| 452 | + | |
447 | 453 | | |
448 | 454 | | |
449 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
450 | 462 | | |
451 | 463 | | |
452 | 464 | | |
453 | 465 | | |
454 | | - | |
| 466 | + | |
455 | 467 | | |
456 | 468 | | |
| 469 | + | |
457 | 470 | | |
458 | 471 | | |
459 | 472 | | |
| |||
462 | 475 | | |
463 | 476 | | |
464 | 477 | | |
465 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
466 | 486 | | |
467 | 487 | | |
468 | 488 | | |
| |||
0 commit comments