[Drbd-dev] Failed to sync initially at different volume's size
Lars Ellenberg
lars.ellenberg at linbit.com
Tue Jul 12 14:08:42 CEST 2016
On Tue, Jul 12, 2016 at 06:12:32PM +0900, 박경민 wrote:
> Hello.
>
> After 4fe4c96 commit
> <http://git.drbd.org/drbd-9.0.git/commit/4fe4c962f41307c2db2846f18f5137082f339cd9>
> in
> DRBD9,
> If both volume's size is different, It is not going on progress sync
> initially, at WFBitmapS/WFBitmapT
Hmpf. "Don't do that, then" ;-)
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0 DRBD9_1: conn( Connecting -> Connected ) peer( Unknown -> Secondary )
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1: current_size: 450560
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: c_size: 430080 u_size: 0 d_size: 430080 max_size: 430080
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: la_size: 0 my_usize: 0
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: node_id: 0 idx: 0 bm-uuid: 0x0 flags: 0x0 max_size: 430080 (DUnknown)
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1: my node_id: 1
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: calling drbd_determine_dev_size()
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: node_id: 0 idx: 0 bm-uuid: 0x0 flags: 0x0 max_size: 430080 (DUnknown)
Do it knows the max size,
but ignores it, ...
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1: my node_id: 1
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: drbd_sync_handshake:
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: self 0000000000000004:0000000000000000:0000000000000000:0000000000000000 bits:56320 flags:0
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: peer 0000000000000004:0000000000000000:0000000000000000:0000000000000000 bits:53760 flags:24
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: uuid_compare()=0 by rule 10
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1: No resync, but 56320 bits in bitmap!
> Jul 12 18:00:04 DRBD9_2 kernel: drbd r0/0 drbd1 DRBD9_1: pdsk( DUnknown -> Inconsistent ) repl( Off -> Established )
... because it double checks on repl_state, which is still L_OFF :-(
This should make it work:
diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c
index c71607e..176f8bc 100644
--- a/drbd/drbd_nl.c
+++ b/drbd/drbd_nl.c
@@ -1534,7 +1534,11 @@ static bool get_max_agreeable_size(struct drbd_device *device, uint64_t *max) __
peer_device->max_size,
drbd_disk_str(pdsk));
- if (peer_device->repl_state[NOW] >= L_ESTABLISHED) {
+ /* Note: in receive_sizes during connection handshake,
+ * repl_state may still be L_OFF;
+ * double check on cstate ... */
+ if (peer_device->repl_state[NOW] >= L_ESTABLISHED ||
+ peer_device->connection->cstate[NOW] >= C_CONNECTED) {
/* If we still can see it, consider its last
* known size, even if it may have meanwhile
* detached from its disk.
--
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker
: R&D, Integration, Ops, Consulting, Support
DRBD® and LINBIT® are registered trademarks of LINBIT
More information about the drbd-dev
mailing list