drbd: fix a bug with two-primaries configuration
PATCH 1/1 drbd: fix a bug with two-primaries configuration
There is a bug when execute 'drbdsetup disconnect' in two-primaries configuration.
When 'drbdsetup disconnect' is called by user, two primary nodes will going to outdated in do_change_cstate, then the command will failed since there is no UpToDate node.
Fix it by modify the judgment condition in do_change_cstate.
--- drbd/drbd_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drbd/drbd_state.c +1 -1
@@ -5406,7 +5406,7 @@ static bool do_change_cstate(struct change_context *context, enum change_phase pu64 directly_reachable =directly_connected_nodes (resource,NEW ) |NODE_MASK (resource->res_opts.node_id); -if (reply->primary_nodes & ~directly_reachable) +if (!(reply->primary_nodes & directly_reachable))__outdate_myself (resource); }
Signature · 1 line
2.25.1
The behavior that you describe is the intended behavior, I believe. If you have two primaries and want to disconnect them in a controlled fashion, you should demote them first.
As discussed previously, you probably should not be using "allow-two-primaries" at all.
The proposed patch unfortunately also breaks various other usage scenarios. For instance, if you have two nodes that are both Secondary and UpToDate, and run 'drbdsetup disconnect', it will cause them to become Outdated.
Best regards,
Joel
Hi Joel,
Thanks for the reply. It is indeed a intended behavior and i will discard the patch.
Thanks,
Xu
From: Joel Colledge <[email protected]>
Date: 2022-08-01 22:22:12
To: Rui Xu <[email protected]>
Cc: Philipp Reisner <[email protected]>,[email protected],[email protected]
Subject: Re: [PATCH] drbd: fix a bug with two-primaries configuration>The behavior that you describe is the intended behavior, I believe. If
Quoted 13 lines
you have two primaries and want to disconnect them in a controlled fashion, you should demote them first.
As discussed previously, you probably should not be using "allow-two-primaries" at all.
The proposed patch unfortunately also breaks various other usage scenarios. For instance, if you have two nodes that are both Secondary and UpToDate, and run 'drbdsetup disconnect', it will cause them to become Outdated.
Best regards,
Joel