The branch, master has been updated
       via  ace23f0 ctdb-locking: Use real-time only for actual record or DB 
locking
       via  00b9e76 ctdb-takeover: Inform clients when dropping all IP addresses
       via  b8272d8 ctdb-takeover: Do not kill smbd processes on releasing IP
      from  c16e770 Remove posixAccount from samdb.py

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ace23f0a81b057fbabd7e75a777688fee81bce94
Author: Amitay Isaacs <[email protected]>
Date:   Tue Feb 9 11:59:30 2016 +1100

    ctdb-locking: Use real-time only for actual record or DB locking
    
    Use real-time priority only for obtaining record and database locks.
    Do not open databases with real-time priority as it can cause thundering
    herd on fcntl lock while opening tdb database.  Also relinquish real-time
    priority after the lock is obtained.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    
    Autobuild-User(master): Martin Schwenke <[email protected]>
    Autobuild-Date(master): Mon Mar  7 11:29:00 CET 2016 on sn-devel-144

commit 00b9e76904bb1108e0f06d0dba4df89394d58252
Author: Amitay Isaacs <[email protected]>
Date:   Sat Mar 5 14:05:21 2016 +1100

    ctdb-takeover: Inform clients when dropping all IP addresses
    
    CTDB releases all IPs in following cases: starting up, shutting down,
    node gets banned, node does not come out of recovery for a long time.
    Always inform samba when CTDB releases IP addresses.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit b8272d835d6e5186568237cd8b7a2105884c0515
Author: Amitay Isaacs <[email protected]>
Date:   Fri Mar 4 15:04:13 2016 +1100

    ctdb-takeover: Do not kill smbd processes on releasing IP
    
    CTDB already notifies Samba with RELEASE_IP message.  Samba can take
    appropriate action based on that.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_lock_helper.c | 27 +++++++++++++++++----
 ctdb/server/ctdb_takeover.c    | 53 +++++++++---------------------------------
 2 files changed, 33 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_lock_helper.c b/ctdb/server/ctdb_lock_helper.c
index 4f1fe2d..cdcbb4a 100644
--- a/ctdb/server/ctdb_lock_helper.c
+++ b/ctdb/server/ctdb_lock_helper.c
@@ -69,6 +69,7 @@ static int lock_record(const char *dbpath, const char 
*dbflags, const char *dbke
        TDB_DATA key;
        struct tdb_context *tdb;
        int tdb_flags;
+       bool realtime;
 
        /* No error checking since CTDB always passes sane values */
        tdb_flags = strtol(dbflags, NULL, 0);
@@ -87,12 +88,22 @@ static int lock_record(const char *dbpath, const char 
*dbflags, const char *dbke
                return 1;
        }
 
+       realtime = set_scheduler();
+       if (! realtime) {
+               fprintf(stderr, "%s: Unable to set real-time scheduler 
priority\n",
+                       progname);
+       }
+
        if (tdb_chainlock(tdb, key) < 0) {
                fprintf(stderr, "%s: Error getting record lock (%s)\n",
                        progname, tdb_errorstr(tdb));
                return 1;
        }
 
+       if (realtime) {
+               reset_scheduler();
+       }
+
        return 0;
 
 }
@@ -102,6 +113,7 @@ static int lock_db(const char *dbpath, const char *dbflags)
 {
        struct tdb_context *tdb;
        int tdb_flags;
+       bool realtime;
 
        /* No error checking since CTDB always passes sane values */
        tdb_flags = strtol(dbflags, NULL, 0);
@@ -112,12 +124,22 @@ static int lock_db(const char *dbpath, const char 
*dbflags)
                return 1;
        }
 
+       realtime = set_scheduler();
+       if (! realtime) {
+               fprintf(stderr, "%s: Unable to set real-time scheduler 
priority\n",
+                       progname);
+       }
+
        if (tdb_lockall(tdb) < 0) {
                fprintf(stderr, "%s: Error getting db lock (%s)\n",
                        progname, tdb_errorstr(tdb));
                return 1;
        }
 
+       if (realtime) {
+               reset_scheduler();
+       }
+
        return 0;
 }
 
@@ -136,11 +158,6 @@ int main(int argc, char *argv[])
                exit(1);
        }
 
-       if (!set_scheduler()) {
-               fprintf(stderr, "%s: Unable to set real-time scheduler 
priority\n",
-                       progname);
-       }
-
        log_fd = atoi(argv[1]);
        close(STDOUT_FILENO);
        close(STDERR_FILENO);
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 13276af..5829e87 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -815,44 +815,6 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
        return 0;
 }
 
-/*
-  kill any clients that are registered with a IP that is being released
- */
-static void release_kill_clients(struct ctdb_context *ctdb, ctdb_sock_addr 
*addr)
-{
-       struct ctdb_client_ip *ip;
-
-       DEBUG(DEBUG_INFO,("release_kill_clients for ip %s\n",
-               ctdb_addr_to_str(addr)));
-
-       for (ip=ctdb->client_ip_list; ip; ip=ip->next) {
-               ctdb_sock_addr tmp_addr;
-
-               tmp_addr = ip->addr;
-               DEBUG(DEBUG_INFO,("checking for client %u with IP %s\n", 
-                       ip->client_id,
-                       ctdb_addr_to_str(&ip->addr)));
-
-               if (ctdb_same_ip(&tmp_addr, addr)) {
-                       struct ctdb_client *client = reqid_find(ctdb->idr,
-                                                               ip->client_id,
-                                                               struct 
ctdb_client);
-                       DEBUG(DEBUG_INFO,("matched client %u with IP %s and pid 
%u\n", 
-                               ip->client_id,
-                               ctdb_addr_to_str(&ip->addr),
-                               client->pid));
-
-                       if (client->pid != 0) {
-                               DEBUG(DEBUG_INFO,(__location__ " Killing client 
pid %u for IP %s on client_id %u\n",
-                                       (unsigned)client->pid,
-                                       ctdb_addr_to_str(addr),
-                                       ip->client_id));
-                               kill(client->pid, SIGKILL);
-                       }
-               }
-       }
-}
-
 static void do_delete_ip(struct ctdb_context *ctdb, struct ctdb_vnn *vnn)
 {
        DLIST_REMOVE(ctdb->vnn, vnn);
@@ -898,9 +860,6 @@ static void release_ip_callback(struct ctdb_context *ctdb, 
int status,
 
        ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_RELEASE_IP, data);
 
-       /* kill clients that have registered with this IP */
-       release_kill_clients(ctdb, state->addr);
-
        ctdb_vnn_unassign_iface(ctdb, state->vnn);
 
        /* Process the IP if it has been marked for deletion */
@@ -2394,6 +2353,7 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
 {
        struct ctdb_vnn *vnn;
        int count = 0;
+       TDB_DATA data;
 
        if (ctdb->tunable.disable_ip_failover == 1) {
                return;
@@ -2431,7 +2391,16 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
                                  ctdb_vnn_iface_string(vnn),
                                  ctdb_addr_to_str(&vnn->public_address),
                                  vnn->public_netmask_bits);
-               release_kill_clients(ctdb, &vnn->public_address);
+
+               data.dptr = (uint8_t *)talloc_strdup(
+                               vnn, ctdb_addr_to_str(&vnn->public_address));
+               if (data.dptr != NULL) {
+                       data.dsize = strlen((char *)data.dptr) + 1;
+                       ctdb_daemon_send_message(ctdb, ctdb->pnn,
+                                                CTDB_SRVID_RELEASE_IP, data);
+                       talloc_free(data.dptr);
+               }
+
                ctdb_vnn_unassign_iface(ctdb, vnn);
                vnn->update_in_flight = false;
                count++;


-- 
Samba Shared Repository

Reply via email to