The Samba-Bugzilla – Attachment 12825 Details for
Bug 12511
ctdb_takeover_helper crashes with SEGV
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-6
BZ12511-v4-6.patch (text/plain), 5.91 KB, created by
Amitay Isaacs
on 2017-01-12 23:19:46 UTC
(
hide
)
Description:
Patches for v4-6
Filename:
MIME Type:
Creator:
Amitay Isaacs
Created:
2017-01-12 23:19:46 UTC
Size:
5.91 KB
patch
obsolete
>From e9905b34e176dd2882d4a80e43573819cc36d7f0 Mon Sep 17 00:00:00 2001 >From: Amitay Isaacs <amitay@gmail.com> >Date: Wed, 11 Jan 2017 16:49:33 +1100 >Subject: [PATCH 1/3] ctdb-takeover: Known and available IP lists should be the > same size as nodemap > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511 > >Signed-off-by: Amitay Isaacs <amitay@gmail.com> >Reviewed-by: Martin Schwenke <martin@meltin.net> >(cherry picked from commit b7cfac778e8813b22d29859102bab1598cdb5ff0) >--- > ctdb/server/ctdb_takeover_helper.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/ctdb/server/ctdb_takeover_helper.c b/ctdb/server/ctdb_takeover_helper.c >index f83b914..d96e6c8 100644 >--- a/ctdb/server/ctdb_takeover_helper.c >+++ b/ctdb/server/ctdb_takeover_helper.c >@@ -91,7 +91,7 @@ struct get_public_ips_state { > struct tevent_context *ev; > struct ctdb_client_context *client; > uint32_t *pnns; >- int count; >+ int count, num_nodes; > struct ctdb_public_ip_list *ips; > }; > >@@ -102,7 +102,7 @@ static struct tevent_req *get_public_ips_send( > struct tevent_context *ev, > struct ctdb_client_context *client, > uint32_t *pnns, >- int count, >+ int count, int num_nodes, > bool available_only) > { > struct tevent_req *req, *subreq; >@@ -116,6 +116,7 @@ static struct tevent_req *get_public_ips_send( > > state->pnns = pnns; > state->count = count; >+ state->num_nodes = num_nodes; > state->ips = NULL; > > ctdb_req_control_get_public_ips(&request, available_only); >@@ -164,7 +165,7 @@ static void get_public_ips_done(struct tevent_req *subreq) > } > > state->ips = talloc_zero_array(state, struct ctdb_public_ip_list, >- state->count); >+ state->num_nodes); > if (tevent_req_nomem(state->ips, req)) { > return; > } >@@ -832,7 +833,7 @@ static void takeover_nodemap_done(struct tevent_req *subreq) > > subreq = get_public_ips_send(state, state->ev, state->client, > state->pnns_active, state->num_active, >- false); >+ state->num_nodes, false); > if (tevent_req_nomem(subreq, req)) { > return; > } >@@ -860,7 +861,7 @@ static void takeover_known_ips_done(struct tevent_req *subreq) > > subreq = get_public_ips_send(state, state->ev, state->client, > state->pnns_active, state->num_active, >- true); >+ state->num_nodes, true); > if (tevent_req_nomem(subreq, req)) { > return; > } >-- >2.9.3 > > >From 1c888a716e05882705e916492586a0ee8ce1390c Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Thu, 12 Jan 2017 06:52:32 +1100 >Subject: [PATCH 2/3] ctdb-takeover: Handle case where there are no RELEASE_IPs > to send > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit a5b187202fa13661aec14cb9e4cbb3b93d4c33f6) >--- > ctdb/server/ctdb_takeover_helper.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/ctdb/server/ctdb_takeover_helper.c b/ctdb/server/ctdb_takeover_helper.c >index d96e6c8..5f537c4 100644 >--- a/ctdb/server/ctdb_takeover_helper.c >+++ b/ctdb/server/ctdb_takeover_helper.c >@@ -295,6 +295,12 @@ static struct tevent_req *release_ip_send(TALLOC_CTX *mem_ctx, > } > } > >+ if (substate->count == 0) { >+ /* No releases to send for this address... */ >+ TALLOC_FREE(substate); >+ continue; >+ } >+ > ip.pnn = tmp_ip->pnn; > ip.addr = tmp_ip->addr; > ctdb_req_control_release_ip(&request, &ip); >@@ -311,6 +317,12 @@ static struct tevent_req *release_ip_send(TALLOC_CTX *mem_ctx, > state->num_sent++; > } > >+ /* None sent, finished... */ >+ if (state->num_sent == 0) { >+ tevent_req_done(req); >+ return tevent_req_post(req, ev); >+ } >+ > return req; > } > >-- >2.9.3 > > >From f2b7455006d587959d4308a3e650791049489f5c Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Wed, 11 Jan 2017 19:20:08 +1100 >Subject: [PATCH 3/3] ctdb-tests: Add takeover helper tests with > banned/disconnected nodes > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> > >Autobuild-User(master): Martin Schwenke <martins@samba.org> >Autobuild-Date(master): Thu Jan 12 23:11:28 CET 2017 on sn-devel-144 > >(cherry picked from commit 4d8cba6f5db1851a738d74030b6b6a118c535c45) >--- > ctdb/tests/takeover_helper/027.sh | 33 +++++++++++++++++++++++++++++++++ > ctdb/tests/takeover_helper/028.sh | 33 +++++++++++++++++++++++++++++++++ > 2 files changed, 66 insertions(+) > create mode 100755 ctdb/tests/takeover_helper/027.sh > create mode 100755 ctdb/tests/takeover_helper/028.sh > >diff --git a/ctdb/tests/takeover_helper/027.sh b/ctdb/tests/takeover_helper/027.sh >new file mode 100755 >index 0000000..1c36d87 >--- /dev/null >+++ b/ctdb/tests/takeover_helper/027.sh >@@ -0,0 +1,33 @@ >+#!/bin/sh >+ >+. "${TEST_SCRIPTS_DIR}/unit.sh" >+ >+define_test "3 nodes, 2 banned, IPs all unassigned" >+ >+setup_ctdbd <<EOF >+NODEMAP >+0 192.168.20.41 0x0 CURRENT RECMASTER >+1 192.168.20.42 0x8 >+2 192.168.20.43 0x8 >+ >+IFACES >+:Name:LinkStatus:References: >+:eth2:1:2: >+:eth1:1:4: >+ >+PUBLICIPS >+10.0.0.31 -1 >+10.0.0.32 -1 >+10.0.0.33 -1 >+EOF >+ >+ok_null >+test_takeover_helper >+ >+required_result 0 <<EOF >+Public IPs on ALL nodes >+10.0.0.31 0 >+10.0.0.32 0 >+10.0.0.33 0 >+EOF >+test_ctdb_ip_all >diff --git a/ctdb/tests/takeover_helper/028.sh b/ctdb/tests/takeover_helper/028.sh >new file mode 100755 >index 0000000..a69cd47 >--- /dev/null >+++ b/ctdb/tests/takeover_helper/028.sh >@@ -0,0 +1,33 @@ >+#!/bin/sh >+ >+. "${TEST_SCRIPTS_DIR}/unit.sh" >+ >+define_test "3 nodes, 2 banned, IPs all unassigned" >+ >+setup_ctdbd <<EOF >+NODEMAP >+0 192.168.20.41 0x0 CURRENT RECMASTER >+1 192.168.20.42 0x1 >+2 192.168.20.43 0x1 >+ >+IFACES >+:Name:LinkStatus:References: >+:eth2:1:2: >+:eth1:1:4: >+ >+PUBLICIPS >+10.0.0.31 -1 >+10.0.0.32 -1 >+10.0.0.33 -1 >+EOF >+ >+ok_null >+test_takeover_helper >+ >+required_result 0 <<EOF >+Public IPs on ALL nodes >+10.0.0.31 0 >+10.0.0.32 0 >+10.0.0.33 0 >+EOF >+test_ctdb_ip_all >-- >2.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
martins
:
review+
Actions:
View
Attachments on
bug 12511
: 12825