[SCM] Samba Shared Repository - branch master updated
Martin Schwenke
martins at samba.org
Sun Apr 24 01:26:04 UTC 2016
The branch, master has been updated
via 5f72883 ctdb-client: Use correct TDB flags for opening database
via 2a06e56 ctdb-protocol: Consistency check for opcode in the reply structure
via b970a53 ctdb-client: Set control opcode in reply for one-way controls
via 1bd461f ctdb-protocol: Remove data structures for obsolete server_id controls
via 2e2dfae ctdb-client: Remove client functions related to server_id
via cb3db02 ctdb-tool: Remove commands related to server_id
via d2f86ea ctdb-daemon: Remove unused controls related to server_id
via c1236b3 ctdb-tests: Improve code coverage in tests
via fdaa231 ctdb-tests: Fix flakey test complex/18_ctdb_reloadips.sh
via 2bad7d7 ctdb-tests: Update tests to include new controls
via 9796930 ctdb-daemon: Avoid memory leak
via 8142e10 ctdb-protocol: Define a range of SRVIDs used by the ctdb tool
via 811192b ctdb-protocol: Remove unused CTDB_SRVID_PREFIX
via bf701f0 ctdb-system: Fix typo in ctdb_get_peer_pid
via bf3f223 ctdb-scripts: Avoid dividing by zero in memory calculation
from ac7974a Fixes an obvious copy-paste error in source3/utils/net_dns.c
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5f72883e8ad6723320f56a0045a95b2836110b82
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Apr 8 14:29:13 2016 +1000
ctdb-client: Use correct TDB flags for opening database
Persistent: TDB_DEFAULT
Volatile: TDB_NOSYNC | TDB_INCOMPATIBLE_HASH | TDB_CLEAR_IF_FIRST
| TDB_MUTEX_LOCKING (if TDBMutexEnabled is set)
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Autobuild-User(master): Martin Schwenke <martins at samba.org>
Autobuild-Date(master): Sun Apr 24 03:25:27 CEST 2016 on sn-devel-144
commit 2a06e56f922894a2be8d54d98b955e26dfbf774e
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 14:19:44 2016 +1000
ctdb-protocol: Consistency check for opcode in the reply structure
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit b970a5304c5a952dc5366d637b785cddacee2be7
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Apr 22 13:53:50 2016 +1000
ctdb-client: Set control opcode in reply for one-way controls
Some controls are fire-and-forget (CTDB_CTRL_FLAG_NOREPLY). Since there
is no reply received, the opcode in the ctdb_reply_control structure
never gets set.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 1bd461fed56275cc8925d5f3dc8cec0ef3c47e58
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 15:24:24 2016 +1000
ctdb-protocol: Remove data structures for obsolete server_id controls
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 2e2dfae98c1c5b9c755407cd7b021e37bd13dbd8
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 15:22:47 2016 +1000
ctdb-client: Remove client functions related to server_id
These functions were used in the transaction code. These controls did
not use server_id structure defined in samba, so samba would not use them.
Instead check if the process exists for conflicting g_lock entry.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit cb3db024eff63bb4d6c1a60a6adc93f9e85d701a
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 15:20:05 2016 +1000
ctdb-tool: Remove commands related to server_id
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit d2f86ea8c308a39ad6db1bd212e6ae6f5d63b140
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 15:18:33 2016 +1000
ctdb-daemon: Remove unused controls related to server_id
These controls have never been used and also they do not use the server_id
structure defined in samba. In future, similar controls can be added to
register/unregister using proper server_id structure.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit c1236b37fd1e2e09367938060b0d0813284f3561
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Apr 12 16:02:53 2016 +1000
ctdb-tests: Improve code coverage in tests
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit fdaa2310ffc1f74da48c5354097400955030f509
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Apr 11 14:01:42 2016 +1000
ctdb-tests: Fix flakey test complex/18_ctdb_reloadips.sh
This test sets TakeoverTimeout=90 to avoid banning during takeover.
However, the setting is done on the test node instead of the recovery
master node. During "ctdb reloadips", the recovery master will used
the default value of TakeoverTimeout.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 2bad7d7de867e584d5c6f37a706f7638a56ef667
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 22:43:54 2016 +1000
ctdb-tests: Update tests to include new controls
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 979693069a681deee7a1b0aa540adc46b0eec80d
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Apr 5 17:11:17 2016 +1000
ctdb-daemon: Avoid memory leak
ctdb->idr and ctdb->srv get initialized as part of ctdb_init() called
from ctdb_cmdline_init().
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 8142e108c746278d02583328ebe900fbd975f608
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Apr 1 17:05:05 2016 +1100
ctdb-protocol: Define a range of SRVIDs used by the ctdb tool
Get rid of the range reserved for traversals since it's not used.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit 811192be34d84d27ced14c72b465028850cd05fa
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Apr 1 17:00:59 2016 +1100
ctdb-protocol: Remove unused CTDB_SRVID_PREFIX
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit bf701f06b411ca17d6f37803f71b04be391f4e96
Author: Amitay Isaacs <amitay at gmail.com>
Date: Thu Apr 21 11:31:13 2016 +1000
ctdb-system: Fix typo in ctdb_get_peer_pid
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Martin Schwenke <martin at meltin.net>
commit bf3f22315a281fb44a5cd9b075b7915138145d6e
Author: Jose A. Rivera <jarrpa at samba.org>
Date: Thu Apr 21 13:09:21 2016 -0500
ctdb-scripts: Avoid dividing by zero in memory calculation
Don't do a percentage calculation for either memtotal or swaptotal if they
are zero.
Signed-off-by: Jose A. Rivera <jarrpa at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
-----------------------------------------------------------------------
Summary of changes:
ctdb/client/client.h | 23 --
ctdb/client/client_control.c | 1 +
ctdb/client/client_control_sync.c | 119 -------
ctdb/client/client_db.c | 15 +-
ctdb/client/ctdb_client.c | 142 +--------
ctdb/common/cmdline.c | 3 -
ctdb/common/system_aix.c | 2 +-
ctdb/common/system_linux.c | 2 +-
ctdb/config/events.d/05.system | 4 +-
ctdb/doc/ctdb.1.xml | 4 +-
ctdb/include/ctdb_client.h | 14 -
ctdb/include/ctdb_private.h | 1 -
ctdb/include/ctdb_protocol.h | 5 -
ctdb/protocol/protocol.h | 47 +--
ctdb/protocol/protocol_api.h | 17 -
ctdb/protocol/protocol_client.c | 542 ++++++++++++++++++--------------
ctdb/protocol/protocol_control.c | 64 ----
ctdb/protocol/protocol_debug.c | 6 +-
ctdb/protocol/protocol_private.h | 16 -
ctdb/protocol/protocol_types.c | 209 ------------
ctdb/server/ctdb_control.c | 18 +-
ctdb/server/ctdb_daemon.c | 1 +
ctdb/server/ctdb_serverids.c | 200 ------------
ctdb/server/ctdbd.c | 1 +
ctdb/tests/complex/18_ctdb_reloadips.sh | 3 +-
ctdb/tests/cunit/protocol_test_002.sh | 2 +-
ctdb/tests/src/ctdbd_test.c | 1 -
ctdb/tests/src/db_hash_test.c | 41 ++-
ctdb/tests/src/pkt_read_test.c | 34 +-
ctdb/tests/src/protocol_client_test.c | 66 +---
ctdb/tests/src/protocol_types_test.c | 70 -----
ctdb/tests/src/srvid_test.c | 23 +-
ctdb/tools/ctdb.c | 109 -------
ctdb/wscript | 2 +-
34 files changed, 441 insertions(+), 1366 deletions(-)
delete mode 100644 ctdb/server/ctdb_serverids.c
Changeset truncated at 500 lines:
diff --git a/ctdb/client/client.h b/ctdb/client/client.h
index 1060d2e..e8288dc 100644
--- a/ctdb/client/client.h
+++ b/ctdb/client/client.h
@@ -397,29 +397,6 @@ int ctdb_ctrl_set_tcp_tickle_list(TALLOC_CTX *mem_ctx,
int destnode, struct timeval timeout,
struct ctdb_tickle_list *tickles);
-int ctdb_ctrl_register_server_id(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid);
-
-int ctdb_ctrl_unregister_server_id(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid);
-
-int ctdb_ctrl_check_server_id(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid);
-
-int ctdb_ctrl_get_server_id_list(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id_map **cid_map);
-
int ctdb_ctrl_db_attach_persistent(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
diff --git a/ctdb/client/client_control.c b/ctdb/client/client_control.c
index b25ff40..5c47c9a 100644
--- a/ctdb/client/client_control.c
+++ b/ctdb/client/client_control.c
@@ -91,6 +91,7 @@ struct tevent_req *ctdb_client_control_send(TALLOC_CTX *mem_ctx,
if (tevent_req_nomem(state->reply, req)) {
return tevent_req_post(req, ev);
}
+ state->reply->rdata.opcode = request->rdata.opcode;
talloc_set_destructor(state, ctdb_client_control_state_destructor);
diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c
index 2c71b36..e14b02c 100644
--- a/ctdb/client/client_control_sync.c
+++ b/ctdb/client/client_control_sync.c
@@ -1145,125 +1145,6 @@ int ctdb_ctrl_set_tcp_tickle_list(TALLOC_CTX *mem_ctx,
return 0;
}
-int ctdb_ctrl_register_server_id(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid)
-{
- struct ctdb_req_control request;
- struct ctdb_reply_control *reply;
- int ret;
-
- ctdb_req_control_register_server_id(&request, cid);
- ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
- &request, &reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control REGISTER_SERVER_ID failed to node %u, ret=%d\n",
- destnode, ret));
- return ret;
- }
-
- ret = ctdb_reply_control_register_server_id(reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control REGISTER_SERVER_ID failed, ret=%d\n", ret));
- return ret;
- }
-
- return 0;
-}
-
-int ctdb_ctrl_unregister_server_id(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid)
-{
- struct ctdb_req_control request;
- struct ctdb_reply_control *reply;
- int ret;
-
- ctdb_req_control_unregister_server_id(&request, cid);
- ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
- &request, &reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control UNREGISTER_SERVER_ID failed to node %u, ret=%d\n",
- destnode, ret));
- return ret;
- }
-
- ret = ctdb_reply_control_unregister_server_id(reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control UNREGISTER_SERVER_ID failed, ret=%d\n", ret));
- return ret;
- }
-
- return 0;
-}
-
-int ctdb_ctrl_check_server_id(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id *cid)
-{
- struct ctdb_req_control request;
- struct ctdb_reply_control *reply;
- int ret;
-
- ctdb_req_control_check_server_id(&request, cid);
- ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
- &request, &reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control CHECK_SERVER_ID failed to node %u, ret=%d\n",
- destnode, ret));
- return ret;
- }
-
- ret = ctdb_reply_control_check_server_id(reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control CHECK_SERVER_ID failed, ret=%d\n", ret));
- return ret;
- }
-
- return 0;
-}
-
-int ctdb_ctrl_get_server_id_list(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout,
- struct ctdb_client_id_map **cid_map)
-{
- struct ctdb_req_control request;
- struct ctdb_reply_control *reply;
- int ret;
-
- ctdb_req_control_get_server_id_list(&request);
- ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
- &request, &reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control GET_SERVER_ID_LIST failed to node %u, ret=%d\n",
- destnode, ret));
- return ret;
- }
-
- ret = ctdb_reply_control_get_server_id_list(reply, mem_ctx, cid_map);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control GET_SERVER_ID_LIST failed, ret=%d\n", ret));
- return ret;
- }
-
- return 0;
-}
-
int ctdb_ctrl_db_attach_persistent(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct ctdb_client_context *client,
diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c
index d95e89e..85d14e3 100644
--- a/ctdb/client/client_db.c
+++ b/ctdb/client/client_db.c
@@ -326,13 +326,14 @@ static void ctdb_attach_mutex_done(struct tevent_req *subreq)
mutex_enabled = 0;
}
- state->tdb_flags = TDB_DEFAULT;
- if (! state->db->persistent) {
- state->tdb_flags |= (TDB_INCOMPATIBLE_HASH |
- TDB_CLEAR_IF_FIRST);
- }
- if (mutex_enabled == 1) {
- state->tdb_flags |= TDB_MUTEX_LOCKING;
+ if (state->db->persistent) {
+ state->tdb_flags = TDB_DEFAULT;
+ } else {
+ state->tdb_flags = (TDB_NOSYNC | TDB_INCOMPATIBLE_HASH |
+ TDB_CLEAR_IF_FIRST);
+ if (mutex_enabled == 1) {
+ state->tdb_flags |= TDB_MUTEX_LOCKING;
+ }
}
if (state->db->persistent) {
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index aae3853..19f126c 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -3172,117 +3172,6 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
}
/*
- register a server id
- */
-int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
- struct timeval timeout,
- struct ctdb_client_id *id)
-{
- TDB_DATA data;
- int32_t res;
- int ret;
-
- data.dsize = sizeof(struct ctdb_client_id);
- data.dptr = (unsigned char *)id;
-
- ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0,
- CTDB_CONTROL_REGISTER_SERVER_ID,
- 0, data, NULL,
- NULL, &res, &timeout, NULL);
- if (ret != 0 || res != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_control for register server id failed\n"));
- return -1;
- }
-
- return 0;
-}
-
-/*
- unregister a server id
- */
-int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
- struct timeval timeout,
- struct ctdb_client_id *id)
-{
- TDB_DATA data;
- int32_t res;
- int ret;
-
- data.dsize = sizeof(struct ctdb_client_id);
- data.dptr = (unsigned char *)id;
-
- ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0,
- CTDB_CONTROL_UNREGISTER_SERVER_ID,
- 0, data, NULL,
- NULL, &res, &timeout, NULL);
- if (ret != 0 || res != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_control for unregister server id failed\n"));
- return -1;
- }
-
- return 0;
-}
-
-
-/*
- check if a server id exists
-
- if a server id does exist, return *status == 1, otherwise *status == 0
- */
-int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
- struct timeval timeout, uint32_t destnode,
- struct ctdb_client_id *id, uint32_t *status)
-{
- TDB_DATA data;
- int32_t res;
- int ret;
-
- data.dsize = sizeof(struct ctdb_client_id);
- data.dptr = (unsigned char *)id;
-
- ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_CHECK_SERVER_ID,
- 0, data, NULL,
- NULL, &res, &timeout, NULL);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_control for check server id failed\n"));
- return -1;
- }
-
- if (res) {
- *status = 1;
- } else {
- *status = 0;
- }
-
- return 0;
-}
-
-/*
- get the list of server ids that are registered on a node
-*/
-int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
- TALLOC_CTX *mem_ctx,
- struct timeval timeout, uint32_t destnode,
- struct ctdb_client_id_list_old **svid_list)
-{
- int ret;
- TDB_DATA outdata;
- int32_t res;
-
- ret = ctdb_control(ctdb, destnode, 0,
- CTDB_CONTROL_GET_SERVER_ID_LIST, 0, tdb_null,
- mem_ctx, &outdata, &res, &timeout, NULL);
- if (ret != 0 || res != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get_server_id_list failed\n"));
- return -1;
- }
-
- *svid_list = (struct ctdb_client_id_list_old *)talloc_steal(mem_ctx, outdata.dptr);
-
- return 0;
-}
-
-/*
initialise the ctdb daemon for client applications
NOTE: In current code the daemon does not fork. This is for testing purposes only
@@ -3832,24 +3721,13 @@ static bool ctdb_server_id_equal(struct ctdb_server_id *id1, struct ctdb_server_
return true;
}
-static bool server_id_exists(struct ctdb_context *ctdb, struct ctdb_server_id *id)
+static bool server_id_exists(struct ctdb_context *ctdb,
+ struct ctdb_server_id *id)
{
- struct ctdb_client_id sid;
int ret;
- uint32_t result = 0;
-
- sid.type = SERVER_TYPE_SAMBA;
- sid.pnn = id->vnn;
- sid.server_id = id->pid;
- ret = ctdb_ctrl_check_server_id(ctdb, timeval_current_ofs(3,0),
- id->vnn, &sid, &result);
- if (ret != 0) {
- /* If control times out, assume server_id exists. */
- return true;
- }
-
- if (result) {
+ ret = ctdb_ctrl_process_exists(ctdb, id->vnn, id->pid);
+ if (ret == 0) {
return true;
}
@@ -4079,7 +3957,6 @@ struct ctdb_transaction_handle *ctdb_transaction_start(struct ctdb_db_context *c
TALLOC_CTX *mem_ctx)
{
struct ctdb_transaction_handle *h;
- struct ctdb_client_id id;
h = talloc_zero(mem_ctx, struct ctdb_transaction_handle);
if (h == NULL) {
@@ -4104,17 +3981,6 @@ struct ctdb_transaction_handle *ctdb_transaction_start(struct ctdb_db_context *c
return NULL;
}
- id.type = SERVER_TYPE_SAMBA;
- id.pnn = ctdb_get_pnn(ctdb_db->ctdb);
- id.server_id = getpid();
-
- if (ctdb_ctrl_register_server_id(ctdb_db->ctdb, timeval_current_ofs(3,0),
- &id) != 0) {
- DEBUG(DEBUG_ERR, (__location__ " unable to register server id\n"));
- talloc_free(h);
- return NULL;
- }
-
h->reqid = reqid_new(h->ctdb_db->ctdb->idr, h);
if (!g_lock_lock(h, h->g_lock_db, h->lock_name, h->reqid)) {
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index 02083e8..3a4557e 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -113,9 +113,6 @@ struct ctdb_context *ctdb_cmdline_init(struct tevent_context *ev)
DEBUGLEVEL = debug_level_to_int(DEBUG_NOTICE);
}
- /* set up the tree to store server ids */
- ctdb->server_ids = trbt_create(ctdb, 0);
-
return ctdb;
}
diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c
index 9b22ff9..de69b9e 100644
--- a/ctdb/common/system_aix.c
+++ b/ctdb/common/system_aix.c
@@ -386,7 +386,7 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
struct peercred_struct cr;
socklen_t crl = sizeof(struct peercred_struct);
int ret;
- if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl) == 0)) {
+ if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl)) == 0) {
*peer_pid = cr.pid;
}
return ret;
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index b754e91..f8c7932 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -617,7 +617,7 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
struct ucred cr;
socklen_t crl = sizeof(struct ucred);
int ret;
- if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl) == 0)) {
+ if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl)) == 0) {
*peer_pid = cr.pid;
}
return ret;
diff --git a/ctdb/config/events.d/05.system b/ctdb/config/events.d/05.system
index 69fcec2..bfa8e7b 100755
--- a/ctdb/config/events.d/05.system
+++ b/ctdb/config/events.d/05.system
@@ -144,8 +144,8 @@ $1 == "SwapFree:" { swapfree = $2 }
$1 == "SwapTotal:" { swaptotal = $2 }
END {
if (memavail != 0) { memfree = memavail ; }
- print int((memtotal - memfree) / memtotal * 100),
- int((swaptotal - swapfree) / swaptotal * 100)
+ if (memtotal != 0) { print int((memtotal - memfree) / memtotal * 100) ; } else { print 0 ; }
+ if (swaptotal != 0) { print int((swaptotal - swapfree) / swaptotal * 100) ; } else { print 0 ; }
}')
_mem_usage="$1"
_swap_usage="$2"
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 7cab96f..7c3b551 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -1724,8 +1724,8 @@ Server id 0:14765 exists
</refsect1>
<!-- UNDOCUMENTED: showban stats disablemonitor enablemonitor
- isnotrecmaster addtickle deltickle regsrvid unregsrvid chksrvid
- getsrvids setdbprio getdbprio msglisten msgsend
+ isnotrecmaster addtickle deltickle
+ setdbprio getdbprio msglisten msgsend
tfetch tstore readkey writekey
checktcpport getdbseqnum ipiface
-->
diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h
index 08ba920..a39d096 100644
--- a/ctdb/include/ctdb_client.h
+++ b/ctdb/include/ctdb_client.h
@@ -415,20 +415,6 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr,
struct ctdb_tickle_list_old **list);
-int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
- struct timeval timeout,
- struct ctdb_client_id *id);
-int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
- struct timeval timeout,
- struct ctdb_client_id *id);
-int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
- struct timeval timeout, uint32_t destnode,
- struct ctdb_client_id *id, uint32_t *status);
-int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
- TALLOC_CTX *mem_ctx,
- struct timeval timeout, uint32_t destnode,
- struct ctdb_client_id_list_old **svid_list);
-
/*
initialise ctdb subsystem
*/
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index b17af53..41b9f4f 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -335,7 +335,6 @@ struct ctdb_context {
uint32_t recovery_master;
struct ctdb_client_ip *client_ip_list;
bool do_checkpublicip;
- struct trbt_tree *server_ids;
bool do_setsched;
const char *event_script_dir;
const char *notification_script;
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index feea114..2b2fd76 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -214,11 +214,6 @@ struct ctdb_dbid_map_old {
struct ctdb_dbid dbs[1];
};
-struct ctdb_client_id_list_old {
- uint32_t num;
- struct ctdb_client_id server_ids[1];
-};
-
/* the list of tcp tickles used by get/set tcp tickle list */
--
Samba Shared Repository
More information about the samba-cvs
mailing list