1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

2716 Commits

Author SHA1 Message Date
Martin Schwenke
240625fe9d Merge branch 'master' of git://git.samba.org/sahlberg/ctdb
(This used to be ctdb commit a442668923d4d8f8d624e00138fe37d76d593d21)
2010-02-05 14:00:23 +11:00
Andrew Tridgell
f23b82b58c ctdb: when we fill the client packet queue we need to drop the client
We can't just drop packets to the list, as those packets could be part
of the core protocol the client is using. This happens (for example)
when Samba is doing a traverse. If we drop a traverse packet then
Samba hangs indefinately. We are better off dropping the ctdb socket
to Samba.

(This used to be ctdb commit a7a86dafa4d88a6bbc6a71b77ed79a178fd802a6)
2010-02-04 15:37:59 +11:00
Andrew Tridgell
3eb9735be5 ctdb: move ctdb_io.c to use TLIST_*() macros
This will make large packet queues much more efficient

(This used to be ctdb commit e3f198056230073135ea6354bbef30c5bb022f8f)
2010-02-04 15:37:53 +11:00
Andrew Tridgell
5fd88a1c42 util: added TLIST_*() macros
The TLIST_*() macros are like the DLIST_*() macros, but take both a
head and tail pointer for the list. This means that adding an element
to the end of the list is efficient (it doesn't need to walk the
list).

We should move all uses of the DLIST_*() macros which use
DLIST_ADD_END() to use the TLIST_*() macros instead.

(This used to be ctdb commit 2d05a71349e9ade869b62cf261c2a9a21818a474)
2010-02-04 15:37:45 +11:00
Ronnie Sahlberg
7a889c5f1d When trying to enable/disable a node.
Check if the node is already enabled/disabled and log an information
message if so.

(This used to be ctdb commit c3eec8f10764a647106087099eeb47b7196f7aac)
2010-02-04 10:03:21 +11:00
Ronnie Sahlberg
a2857b1504 We only queued up to 1000 packets per queue before we start dropping
packets, to avoid the queue to grow excessively if smbd has blocked.

This could cause traverse packets to become discarded in case the main
smbd daemon does a traverse of a database while there is a recovery
(sending a erconfigured message to smbd, causing an avalanche of unlock
messages to be sent across the cluster.)

This avalance of messages could cause also the tranversal message to be
discarded  causing the main smbd process to hang indefinitely waiting
for the traversal message that will never arrive.

Bump the maximum queue length before starting to discard messages from
1000 to 1000000 and at the same time rework the queueing slightly so we
can append messages cheaply to the queue instead of walking the list
from head to tail every time.

(This used to be ctdb commit 59ba5d7f80e0465e5076533374fb9ee862ed7bb6)
2010-02-04 09:54:06 +11:00
Ronnie Sahlberg
7a5254ae69 add two new debug controls to send and receive messages
ctdb msglisten and msgsend

(This used to be ctdb commit 8c89aac20260dc7f3746e29fe99f17422a77cb88)
2010-02-04 09:45:32 +11:00
Ronnie Sahlberg
d7c00d8d7e Drop the debug level for logging fd creation to DEBUG_DEBUG
(This used to be ctdb commit eae1d4f9e52e73b4d8769868fffdafa590d03784)
2010-02-04 06:37:41 +11:00
Volker Lendecke
68273bbab8 tdb: fix an early release of the global lock that can cause data corruption
There was a bug in tdb where the

                tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1);

(ending the transaction-"mutex") was done before the

                        /* remove the recovery marker */

This means that when a transaction is committed there is a window where another
opener of the file sees the transaction marker while the transaction committer
is still fully functional and working on it. This led to transaction being
rolled back by that second opener of the file while transaction_commit() gave
no error to the caller.

This patch moves the F_UNLCK to after the recovery marker was removed, closing
this window.

(This used to be ctdb commit 898b5edfe757cb145960b8f3631029bfd5592119)
2010-02-02 07:52:15 +11:00
Martin Schwenke
56b178e1a2 eventscripts: stop loadconfig function from loading ctdb config file twice.
If "$1" was empty than loadconfig would load the ctdb config twice.
This stops that from happening.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0406d406da70aaee7ad6aac236114905c5d03ed2)
2010-01-22 17:19:12 +11:00
Martin Schwenke
407a8f7205 eventscript: Use of $NFS_TICKLE_SHARED_DIRECTORY must be after loadconfig.
Proper fix for 085d1bea78fabf754ef6dd6d323f74a1d361e45c's workaround.
$NFS_TICKLE_SHARED_DIRECTORY was being used before it is set via
loadconfig.

Ronnie actually spotted this one.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ee8b2e298351d05197a2e1494f3331433644c1e6)
2010-01-22 17:14:50 +11:00
Martin Schwenke
02e68340e8 initscript: Remove bash-ism.
Also, change the order of the comparison so it is consistent with
others in the script.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 44696e15cdb23e7656d3bb0ead54f509495738a7)
2010-01-22 17:13:17 +11:00
Martin Schwenke
d6b0578cfb initscript: handle spaces in option values inserted into $CTDB_OPTIONS.
This puts single quotes around everything and uses eval on the
command-lines that actually start ctdbd.  The eval causes the single
quotes to be interpreted.

The "redhat" init style no longer uses the Red Hat daemon function.
It loses the quoting and re-splits on spaces.  Instead we add an extra
line that uses the success/failure functions to keep things pretty.
Note that this means that we don't respect daemon's
$DAEMON_COREFILE_LIMIT variable but we do our own core file handling
with $CTDB_SUPPRESS_COREFILE anyway.  daemon's core file handling was
probably overriding what we were doing anyway, so this can be regarded
as a bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 522fbb012524fe41a67dbe43589a282dda6bcbe2)
2010-01-22 15:34:21 +11:00
Martin Schwenke
52dbd65825 onnode: update algorithm for finding nodes file.
2 changes:

* If a relative nodes file is specified via -f or $CTDB_NODES_FILE but
  this file does not exist then try looking for the file in /etc/ctdb
  (or $CTDB_BASE if set).

* If a nodes file is specified via -f or $CTDB_NODES_FILE but this
  file does not exist (even when checked as per above) then do not
  fall back to /etc/ctdb/nodes ((or $CTDB_BASE if set).  The old
  behaviour was surprising and hid errors.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 60aa570aaa77d293b963105b3f605f9625a4594b)
2010-01-21 18:52:44 +11:00
Martin Schwenke
7569b21f2d onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 503e4908b3028330bc25dc6de8561dbd53ee6a8d)
2010-01-21 18:52:31 +11:00
Stefan Metzmacher
12c8dd215c config: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path
This is very useful for testing, I use such a script:

cat ~/bin/ethtool
 #!/bin/sh

 IFACE=$1

 case "$IFACE" in
        Neth2)
                ;;
        Neth3)
                ;;
        Neth4)
                ;;
        Neth5)
                ;;
        *)
                exec /usr/sbin/ethtool $@
                ;;
 esac

 ip link set down $IFACE

 exec /usr/sbin/ethtool $@

metze

(This used to be ctdb commit 3bab985cf615720eded4d47b4f9f37a9c28840aa)
2010-01-20 11:11:04 +01:00
Stefan Metzmacher
dbe912793e server: reload the public addresses before doing a takeover run
metze

(This used to be ctdb commit 0e41a2204fa8a1e77dc83c0d4b253ab272b5c72d)
2010-01-20 11:11:04 +01:00
Stefan Metzmacher
76cb4ce34c server: ban ourself if the ctdb and kernel knowledge of a public ip differs
metze

(This used to be ctdb commit 48e0af91113d6cead6cae3f28d8d8f610cacaa71)
2010-01-20 11:11:04 +01:00
Stefan Metzmacher
405368eeb0 server: give an error if we're getting an takeover_ip event with a wrong pnn
metze

(This used to be ctdb commit 2f44d6f3d290cc1b37b19ec34edfbad12cc0c0a7)
2010-01-20 11:11:04 +01:00
Stefan Metzmacher
a5ba5c129a server: return an error if we get an takeover ip event and we cannot serve the ip
metze

(This used to be ctdb commit f5c221e6abc118aefa489aa7e07755af952fd2bb)
2010-01-20 11:11:03 +01:00
Stefan Metzmacher
55d824bd77 server: print node number as signed integer on release ip event
metze

(This used to be ctdb commit 6c456face30606641f6b8beaad3121c9b05ca763)
2010-01-20 11:11:03 +01:00
Stefan Metzmacher
c5e579b56a server: debug redundant takeover ip events with level INFO
metze

(This used to be ctdb commit 7bc9969c4c28f2c4a4848bd730db3c63bb9204fe)
2010-01-20 11:11:03 +01:00
Stefan Metzmacher
ffdf32dedf server: be less verbose on redundant release_ip events
metze

(This used to be ctdb commit 72ef5f891f85ce51f5ca7e0c03d0c7cc955be110)
2010-01-20 11:11:03 +01:00
Stefan Metzmacher
58d7c44b1c server: add a ctdb_do_updateip()
metze

(This used to be ctdb commit eded224368dded2264e53546c196b1b485cb2094)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
aa485b17bb server: split out a ctdb_do_takeover_ip() function
metze

(This used to be ctdb commit 8fd6f4aab0c173b4c9c4c02c546e7d2ec1a98423)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
da59e0b162 server: split out a ctdb_announce_vnn_iface() function
metze

(This used to be ctdb commit ec87a51660cfa8a6851923f757fed31f7ffc7153)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
ea5843075c events: add updateip event to 13.per_ip_routing
metze

(This used to be ctdb commit 829150e814a5e6c85d0f21421f46f41e81d74c53)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
6a818e66ae events: 10.interface handle updateip event
metze

(This used to be ctdb commit a5cdf1277387f8c6292153c37fa9ceb64707d04f)
2010-01-20 11:11:02 +01:00
Stefan Metzmacher
98ee69c66d server: add updateip event
metze

(This used to be ctdb commit 712ed0c4c0bff1be9e96a54b62512787a4aa6259)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
50bff8c886 config: add CTDB_PARTIALLY_ONLINE_INTERFACES to ctdb.sysconfig
With this option set to "yes", we don't become unhealthy
as long as at least one interface is still available.

metze

(This used to be ctdb commit d054eb33c6ae92560cddb40732e5dcf622591a3c)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
179c098e86 server: start with disabled interfaces and let the event scripts enable the interfaces explicit
This makes sure that we don't get public addresses assigned during the
initial recovery and remove them again in the startup event.

metze

(This used to be ctdb commit f872e8c63a2f8979e6a0d088630575bdd4d7b4f1)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
5d2c3ef656 config: 10.interfaces call monitor_interfaces on startup
metze

(This used to be ctdb commit 615dec051c26aac628f120e96bf12fb39fc6d28a)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
94e7101070 config: 10.interfaces call ctdb ifaces and ctdb setifacelink for monitoring
metze

(This used to be ctdb commit c465f63585c419ba59a6b04cbbf78ae615a7259d)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
9c89dd9210 events: splitout a monitor_interfaces function in 10.interface
metze

(This used to be ctdb commit b5ba56dea57db97d6c6ba3e7582e74fe0e3041fc)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
5fa6a51388 server: monitor interfaces in verify_ip_allocation()
metze

(This used to be ctdb commit 965a65520693e3731b5b0250127b04c777087808)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
22ade0e456 server: only trigger one takeover run in verify_ip_allocation()
metze

(This used to be ctdb commit 10bc087d0280057962177721bdd6d4f28743b311)
2010-01-20 11:11:01 +01:00
Stefan Metzmacher
f2854f75c8 tools/ctdb: add PartiallyOnline state for "ctdb status" and "ctdb status -Y"
This is based on the GET_IFACES control against each node.

metze

(This used to be ctdb commit 38cb972382a09f830673277d0a9bd5d20deafff2)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
a6437bc707 tools/ctdb: display interfaces in "ctdb ip" and "ctdb ip -Y" outputs
metze

(This used to be ctdb commit dffa2b05acce8b73c2fdd085311732bf57f01b7f)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
0054f0c54f tests: add a all_ips_on_node() helper function that wraps ctdb ip -Y
metze

(This used to be ctdb commit c24fbea156dfdc9154e94eace725526e44cbcdac)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
04d896a5fe tests/simple/11_ctdb_ip.sh: be more strict in checking ctdb ip -Y output
metze

(This used to be ctdb commit 27bde04966e22975777b4034dbaccfe158369110)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
df5805d6a0 tools/ctdb: add "ctdb ipinfo <ip>"
metze

(This used to be ctdb commit e05e236fc019bfd3b316609a7c190e0e028a4bbc)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
a6803f42a5 tools/ctdb: add "ctdb setifacelink <iface> <status>"
metze

(This used to be ctdb commit 8d0c00b60db69bd10f12da4c676e1142dc37af7a)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
0ceef7036b tools/ctdb: add "ctdb ifaces"
metze

(This used to be ctdb commit 80053d09eed967fb76898f4a53437bed2b43a02f)
2010-01-20 11:11:00 +01:00
Stefan Metzmacher
f4f72024fe server: implement ctdb_control_set_iface_link()
This only marks the interface status and doesn't
generate any directly triggered action.

The actions is later taken by the recovery process
in verify_ip_allocation.

metze

(This used to be ctdb commit cff58b27c970e9252d131125941c372019fd6660)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
0dd7e1bfa1 server: implement ctdb_control_get_ifaces()
metze

(This used to be ctdb commit 0e982a416a126d9856145c19baef320cd0e71d66)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
80e3ab04de server: implement ctdb_control_get_public_ip_info()
metze

(This used to be ctdb commit 486fbd15f4cc4f45a4c110b2ddbba48bade22c9f)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
20e2f6199c client: implement ctdb_ctrl_set_iface_link()
metze

(This used to be ctdb commit e2d6582001be28c1800e4da8b0f2dc541538c314)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
a30513c1f8 client: implement ctdb_ctrl_get_ifaces()
metze

(This used to be ctdb commit a21e3765dd83e837d93111f387448bf0a5dd4652)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
11f643fa78 client: implement ctdb_ctrl_get_public_ip_info()
metze

(This used to be ctdb commit 4efab41dfa61d5c7951c583d584df3455ee9c704)
2010-01-20 11:10:59 +01:00
Stefan Metzmacher
32d00d0a0d controls: add stups for GET_PUBLIC_IP_INFO, GET_IFACES and SET_IFACE_LINK_STATE
metze

(This used to be ctdb commit a2c9e4578e149eccb2c6183f64a6b657eb95c5e1)
2010-01-20 11:10:59 +01:00