Skip to content

Commit 91c0dc9

Browse files
teiglandswhiteho
authored andcommitted
[DLM] fix aborted recovery during node removal
Red Hat BZ 211914 With the new cluster infrastructure, dlm recovery for a node removal can be aborted and restarted for a node addition. When this happens, the restarted recovery isn't aware that it's doing recovery for the earlier removal as well as the addition. So, it then skips the recovery steps only required when nodes are removed. This can result in locks not being purged for failed/removed nodes. The fix is to check for removed nodes for which recovery has not been completed at the start of a new recovery sequence. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent d440015 commit 91c0dc9

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎fs/dlm/member.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
186186
struct dlm_member *memb, *safe;
187187
int i, error, found, pos = 0, neg = 0, low = -1;
188188

189+
/* previously removed members that we've not finished removing need to
190+
count as a negative change so the "neg" recovery steps will happen */
191+
192+
list_for_each_entry(memb, &ls->ls_nodes_gone, list) {
193+
log_debug(ls, "prev removed member %d", memb->nodeid);
194+
neg++;
195+
}
196+
189197
/* move departed members from ls_nodes to ls_nodes_gone */
190198

191199
list_for_each_entry_safe(memb, safe, &ls->ls_nodes, list) {

‎fs/dlm/recoverd.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
164164
*/
165165

166166
dlm_recover_rsbs(ls);
167+
} else {
168+
/*
169+
* Other lockspace members may be going through the "neg" steps
170+
* while also adding us to the lockspace, in which case they'll
171+
* be looking for this status bit during dlm_recover_locks().
172+
*/
173+
dlm_set_recover_status(ls, DLM_RS_LOCKS);
167174
}
168175

169176
dlm_release_root_list(ls);

0 commit comments

Comments
 (0)