diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-02-26 17:15:23 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-03-11 10:00:09 -0500 |
commit | 580b9767dbdf2c049c4d05330c70ea786ef01016 (patch) | |
tree | 87cbe63a632378b8be93e521203aba2ba536a3d1 /drivers/block | |
parent | 4aa83b7bf122106669346eef40632289f540653f (diff) |
drbd: fix broken state change after split-brain attach while connected
Situation:
we have diverging data sets, i.e. we had a split brain somewhen,
but currently are connected, one node diskless.
Then we try to attach that disk, figure it is consistent,
but has a diverging data set, we refuse to attach.
This led to strange state changes:
22:18:35 bb drbd1: peer( Unknown -> Primary ) conn( WFReportParams -> Connected) pdsk( DUnknown -> UpToDate )
22:19:30 bb drbd1: disk( Diskless -> Attaching )
22:19:30 bb drbd1: disk( Attaching -> Negotiating )
22:19:30 bb drbd1: drbd_sync_handshake:
22:19:30 bb drbd1: self 97BF25798B9D5222:F33D1F62ADE698DD:4269796F9D027C83:AC45D8B5C3C1BF93 bits:19449 flags:0
22:19:30 bb drbd1: peer 280DFB6E125465D3:F33D1F62ADE698DC:4269796F9D027C82:AC45D8B5C3C1BF93 bits:2575806 flags:0
22:19:30 bb drbd1: uuid_compare()=100 by rule 90
22:19:30 bb drbd1: Split-Brain detected, dropping connection!
22:19:30 bb drbd1: disk( Negotiating -> Diskless )
while the other side says:
22:19:30 aa drbd1: Split-Brain detected, dropping connection!
22:19:30 aa drbd1: Disk attach process on the peer node was aborted.
22:19:30 aa drbd1: conn( Connected -> TOO_LARGE ) pdsk( Diskless -> Consistent )
This should be fixed now.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 8bcde4a9632b..41f36a9cd407 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -2513,6 +2513,10 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev, enum drbd_rol | |||
2513 | } | 2513 | } |
2514 | 2514 | ||
2515 | if (hg == -100) { | 2515 | if (hg == -100) { |
2516 | /* FIXME this log message is not correct if we end up here | ||
2517 | * after an attempted attach on a diskless node. | ||
2518 | * We just refuse to attach -- well, we drop the "connection" | ||
2519 | * to that disk, in a way... */ | ||
2516 | dev_alert(DEV, "Split-Brain detected, dropping connection!\n"); | 2520 | dev_alert(DEV, "Split-Brain detected, dropping connection!\n"); |
2517 | drbd_khelper(mdev, "split-brain"); | 2521 | drbd_khelper(mdev, "split-brain"); |
2518 | return C_MASK; | 2522 | return C_MASK; |
@@ -3134,12 +3138,13 @@ static int receive_state(struct drbd_conf *mdev, struct p_header *h) | |||
3134 | 3138 | ||
3135 | put_ldev(mdev); | 3139 | put_ldev(mdev); |
3136 | if (nconn == C_MASK) { | 3140 | if (nconn == C_MASK) { |
3141 | nconn = C_CONNECTED; | ||
3137 | if (mdev->state.disk == D_NEGOTIATING) { | 3142 | if (mdev->state.disk == D_NEGOTIATING) { |
3138 | drbd_force_state(mdev, NS(disk, D_DISKLESS)); | 3143 | drbd_force_state(mdev, NS(disk, D_DISKLESS)); |
3139 | nconn = C_CONNECTED; | ||
3140 | } else if (peer_state.disk == D_NEGOTIATING) { | 3144 | } else if (peer_state.disk == D_NEGOTIATING) { |
3141 | dev_err(DEV, "Disk attach process on the peer node was aborted.\n"); | 3145 | dev_err(DEV, "Disk attach process on the peer node was aborted.\n"); |
3142 | peer_state.disk = D_DISKLESS; | 3146 | peer_state.disk = D_DISKLESS; |
3147 | real_peer_disk = D_DISKLESS; | ||
3143 | } else { | 3148 | } else { |
3144 | if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags)) | 3149 | if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags)) |
3145 | return FALSE; | 3150 | return FALSE; |