1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-04 05:18:06 +03:00
Commit Graph

4920 Commits

Author SHA1 Message Date
Martin Schwenke
128e2cb29d doc: Update NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c446579fc442955ecc74f5566eaa0635c3171498)
2013-08-22 18:07:49 +10:00
Amitay Isaacs
7531b9528f build: Fix build dependencies for ctdb_lock_tdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit eb8575718400c45626cd1b2e0fd247bc3ebff655)
2013-08-22 17:59:59 +10:00
Martin Schwenke
1c3f4f55b0 tests/simple: Minimise the chance of a monitor event being cancelled
A monitor event following a "ctdb delip" might reconfigure services.
If the monitor event is cancelled then a service might be stopped but
not yet restarted and this could result in the subsequent monitor
events failing.

This obviously needs to be fixed in CTDB itself.  This will happen by
making "ctdb reloadips" the supported way of reconfiguring IPs.

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

(This used to be ctdb commit 618ea3660e36e7bd92b686e1ca8728cf63c3c068)
2013-08-22 17:00:20 +10:00
Martin Schwenke
aecd66d0a0 packaging: Remove pushd/popd from maketarball.sh, don't need bash
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3ffca990a18cbd31c8bd3ae01c6671d60da58f58)
2013-08-22 17:00:20 +10:00
Martin Schwenke
a04fb43708 tools/ctdb_diagnostics: Add output of "ctdb getdbmap"
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f0d69a9079b7aecc68f1d2d8510702046b618b19)
2013-08-22 17:00:20 +10:00
Martin Schwenke
6c468c94a2 tools/ctdb_diagnostics: Safer temporary file creation
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 406e1cb1fdd17ddd239774d0228e3657b73ae68f)
2013-08-22 17:00:20 +10:00
Martin Schwenke
cc74417341 eventscripts: Avoid using a temporary file in 62.cnfs
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 81833052d7ee8f76b1e98376a0273448640cfa8e)
2013-08-22 17:00:20 +10:00
Martin Schwenke
bb974f150b scripts: Remove gdb_backtrace
This uses potentially insecure temporary files and is not referenced
anywhere else.

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

(This used to be ctdb commit 4b914d7e217202f3d11a8e95f9f74bc17869475b)
2013-08-22 17:00:20 +10:00
Martin Schwenke
d1918ba27a tools/ctdb: Make most non-auto-all commands abort if run with -n all
Or if run with -n A,B,...

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

(This used to be ctdb commit b1d8732b5da18ae80aea1df0e66b0b5cdcd919bc)
2013-08-22 17:00:20 +10:00
Martin Schwenke
fd79a86d8f tools/ctdb: Remove more non-essential fetching of PNN from daemon
The useful cases are either CTDB_CURRENT_NODE, in which case
ctdb_get_pnn() does the job, or a PNN, which is... ummm... a PNN!  :-)

This works because parse_nodestring() validates PNNs.

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

(This used to be ctdb commit 7b3f7eea2465efb099a2faf3e42174bc97b13a16)
2013-08-22 17:00:20 +10:00
Martin Schwenke
3402ae9ffb tools/ctdb: Improve auto-all settings for some commands
* ipreallocate is cluster-wide so should not be auto-all

* enablescript, disablescript, getreclock, setreclock, natgwlist can
  all be auto-all without issues

* xpnn, ipiface a local-only so don't work with -n, so might as well
  not be auto-all

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

(This used to be ctdb commit 123a4677528cb46bee1c6dad8a5162eba9880bc1)
2013-08-22 17:00:20 +10:00
Martin Schwenke
3afcc53516 recoverd: Remove an unused temporary talloc context
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit da22d5e60dc023009854025cc9e6bc4b0a84c60e)
2013-08-22 17:00:20 +10:00
Martin Schwenke
1ae731198a recoverd: Move struct ctdb_public_ip_list back into ctdb_takeover.c
This is an internal structure.  It was moved into ctdb_private.h a
long time ago to allow unit testing.  Unit test compilation was
changed shortly afterwards to make this unnecessary.

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

(This used to be ctdb commit db57261d7dc264e161659a8c547f44fbd9e88eeb)
2013-08-22 17:00:20 +10:00
Martin Schwenke
e657f75484 recoverd: Log more information when interfaces change
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3ef93a1a3e60cdf5d8954e7a16a988ea6126916b)
2013-08-22 17:00:20 +10:00
Amitay Isaacs
58e96eb178 traverse: Log when database traverse is started
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 256b157232c60bc432c94e54b1fae9699f737557)
2013-08-22 17:00:19 +10:00
Amitay Isaacs
e850a6d2ca ctdbd: Finish eventscript callback processing before debugging hung script
This ensures that the result of eventscripts is updated and callback is
processed before debugging hung script.  So "ctdb scriptstatus" output
will be useful from debug hung script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4ed2efb838d2ac97746666f614ebef5fdf3cdd5e)
2013-08-22 17:00:19 +10:00
Amitay Isaacs
19444f7c3d ctdbd: Make sure call data is freed if doing an early return
This should avoid memory bloat when a request bounces between nodes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7677fb263f06a97398e2c546e32273fb96edca69)
2013-08-22 16:59:49 +10:00
Amitay Isaacs
a61a4b1254 common/io: Limit the queue buffer size for fair scheduling via tevent
If we process all the data available in a socket buffer, CTDB can stay busy
processing lots of packets via immediate event mechanism in tevent.  After
processing an immediate event, tevent returns without epoll_wait.  So as long
as there are immediate events, tevent will never poll other FDs.  CTDB will
report this as "Event handling took xx seconds" warning.  This is misleading
since CTDB is very busy processing packets, but never gets to the point of
polling FDs.

The improvement in socket handling made it worse when handling traverse
control.  There were lots of packets filled in the socket buffer quickly and
CTDB stayed busy processing those packets and not polling other FDs and timer
events.  This can lead to controls timing out and in worse case other nodes
marking busy node as disconnected.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 92939c1178d04116d842708bc2d6a9c2950e36cc)
2013-08-22 14:08:52 +10:00
Amitay Isaacs
cfb7f74fa2 Revert "common/io: Keep queue buffer size multiple of 4K"
This reverts commit 5e9b1a7e24d058ff88aaa0563db36a804e866fa9.

This is not the best approach.  Allowing queue buffer size to grow
indefinitely causes large number of CTDB packets to be queued up very
quickly which when processed via immediate events will block CTDB from
processing events from other FDs.  If there are immediate events queued
up, tevent will never process any of the FDs till all immediate events
are processed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d8b094e804efc53fae9f44c6ef961b7b5797d290)
2013-08-22 14:08:52 +10:00
Amitay Isaacs
1467b666f2 Revert "LACOUNT: Add back lacount mechanism to defer migrating a fetched/read copy until after default of 20 consecutive requests from the same node"
This reverts commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504.

This is a premature optimization.  Record can bounce between nodes
very quickly if it is a contended record.  There is no need to hold a
record on a node unnecessarily.  In case record contention becomes bad,
enabling sticky records on a database is a better idea.

Conflicts:
	include/ctdb_private.h
	server/ctdb_tunables.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ac417b0003f0116f116834ad2ac51482d25cfa0d)
2013-08-22 14:08:52 +10:00
Amitay Isaacs
59dae19f5a ctdbd: Print a log message when a key becomes hot
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 48f40985f4592c28402303ccbb458756f4914f75)
2013-08-22 14:08:52 +10:00
Amitay Isaacs
27fd34e9ff ctdbd: For volatile databases, write an empty record with rsn=0 only on dmaster
Empty record with rsn=0 should not be written on any other node other than
dmaster.  This is however not true for persistent databases.  So currently
apply the check only for volatile databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit df83ae7a047dab4803e0d94b1c11df48ae17ca96)
2013-08-22 14:08:52 +10:00
Martin Schwenke
73da6c0201 tools/ctdb: Fix message in showban when node is banned
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5cdad2b8ebd71a5e458c301d00eac00a211feeb3)
2013-08-21 14:02:36 +10:00
Martin Schwenke
b74c232b8a tools/ctdb: Reimplement ban/unban using update_flags_wait_and_ipreallocate()
This has the side effect of making these commands more resilient to
control timeouts.

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

(This used to be ctdb commit 0fe79662e20e347d9e1cb12a42cd356e33572402)
2013-08-21 14:02:36 +10:00
Martin Schwenke
b42b0e4676 tools/ctdb: Factor out common pattern used in disable/enable/stop/continue
Now we will only have one set of bugs.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 444521c852749558f39dc6131acce9e47eefd489)
2013-08-21 14:02:36 +10:00
Martin Schwenke
f72f4c362b tools/ctdb: Factor, simplify and improve robustness of ipreallocate code
Having other functions call control_ipreallocate() suggests that the
it might look at the argv/argv arguments that are passed.  This is not
the case.  Change the callers so they call the new ipreallocate()
function instead.

Broadcast CTDB_SRVID_TAKEOVER_RUN to all connected nodes.  Inactive
nodes will ignore it.  This is safe since we only want 1 reply.  If we
didn't get a response, we don't actually care if there's no active
recovery master - just fire, wait, retry, ...

Ignore some failures on the basis that they might be transient, so it
is probably worth retrying.

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

(This used to be ctdb commit 4bf0b1c9d21986eecb7682f935bd6154c65533cc)
2013-08-21 14:02:36 +10:00
Martin Schwenke
db121b4c8f tools/ctdb: Use ctdb_get_pnn() to get PNN of the current node
This has already been stored at connect time and can't fail.

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

(This used to be ctdb commit d8eb2e7fdd7645719370dad4f2faa5c3fffa8249)
2013-08-21 14:02:36 +10:00
Michael Adam
aa1360aeb2 util: In passing the code, fix a space vs. tab in set_close_on_exec().
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit f9556a6f1fe0046308c8b363e6dcaf3f7ce6f2b7)
2013-08-19 17:12:33 +02:00
Michael Adam
621bfe8b0d server: standardize formatting of comment block for ctdb_reply_dmaster() while I'm at it..
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 00d3bf092e2f72eda330978c75ec85f17e870553)
2013-08-19 17:12:33 +02:00
Michael Adam
922246de73 server: fix wording and punctuation in comment block for ctdb_reply_dmaster().
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit cb3a1c5af3b796dba30cae07118670d3c9e57df7)
2013-08-19 17:12:32 +02:00
Amitay Isaacs
cb8310ddb6 recoverd: Improve log message when nodes disagree on recmaster
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7b7aa7b599536cd60ebb84d363607bb4e953248a)
2013-08-14 16:55:51 +10:00
Amitay Isaacs
3c0a477911 common: Null terminate process name string so valgrind doesn't complain
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1c9025fdd08d1cea342af7487d0123015e08831b)
2013-08-14 16:55:51 +10:00
Amitay Isaacs
ae30b61255 vacuuming: Fix vacuuming bug where requests keep bouncing between nodes (part 2)
This is caused by corruption of a record header such that the records
on two nodes point to each other as dmaster.  This makes a request for
that record bounce between nodes endlessly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f0853013655ac3bedf1b793de128fb679c6db6c6)
2013-08-14 16:55:51 +10:00
Amitay Isaacs
ee8d573069 vacuuming: Fix vacuuming bug where requests keep bouncing between nodes (part 1)
This is caused by corruption of a record header such that the records
on two nodes point to each other as dmaster.  This makes a request for
that record bounce between nodes endlessly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a610bc351f0754c84c78c27d02f9a695e60c5b0f)
2013-08-14 16:55:51 +10:00
Amitay Isaacs
f9be4803cb db_wrap: Make sure tdb messages are logged correctly
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 60cb40d090e45ff6134c098a238fac7ad854f134)
2013-08-14 16:55:51 +10:00
Martin Schwenke
fec69034ee eventscripts: Become unhealthy faster on nfsd failure
Anecdotal evidence suggests that most nfsd RPC check failures are due
to cluster filesystem or storage problem.  Apparently these are rarely
helped by attempting to restart the NFS service because the restart
tends to hang.

Fail after 2 nfsd RPC check failures, instead of waiting for 6
failures.  Restart on every 10th failure to try to bring the node back
to good health.

Update unit tests to match.

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

(This used to be ctdb commit e9ef93f7b6dad59eabaa32124df81f3e74c651ef)
2013-08-14 16:10:30 +10:00
Martin Schwenke
4cb3e2cd78 tools/ctdb: Increase default control timeout to 10 seconds
The current 3 second timeout is arbitrary and users trip over it
sometimes.

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

(This used to be ctdb commit b49c4f39666d5b1596213bf41bcdc47ed3c327ae)
2013-08-14 15:57:04 +10:00
Martin Schwenke
e6ce2f55ef eventscripts: Improve message logged when a counter hits a limit
It should print the actual number of consecutive failures rather than
the limit.

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

(This used to be ctdb commit ff5f0d1e29af2b293e30cdc54bed03a644be7038)
2013-08-14 15:57:04 +10:00
Martin Schwenke
35d9631eda eventscripts: Print a message when waiting for TCP connections to be killed
This makes the gaps in the logs more obvious.

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

(This used to be ctdb commit 11fbf4789d783dd0bac22754b374dd9ea4b03bad)
2013-08-14 15:57:04 +10:00
Martin Schwenke
b1f7337d2b eventscripts: New configuration variable $CTDB_RPCINFO_LOCALHOST
Passing "localhost" to the rpcinfo command causes overheads, like
reading /etc/services multiple times.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1d61988af9e4fa3621a3e2d06a859bcb53df2d67)
2013-08-14 15:57:04 +10:00
Martin Schwenke
0ca046577f eventscripts: Add modulo (%) operator to ctdb_check_counter()
Also add it to the corresponding eventscript unit test infrastructure.

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

(This used to be ctdb commit f4ef83a256f59eeb00b9a5bc10c28347e1ad1031)
2013-08-14 15:57:03 +10:00
Martin Schwenke
bdbe37b24f eventscripts: Separate out RPC service restart code
While doing this:

* Explicitly assign RPC program and version information in
  _nfs_check_rpc_common().  This is more lines of code but is easier
  to read.

* Don't print the options when starting a service.  Trying to print it
  makes the code messy for little benefit.

  Update the eventscript unit testing code and a Ganesha test to
  reflect this.

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

(This used to be ctdb commit e8b531405665885196c95fe1608db33a255bf761)
2013-08-14 15:57:03 +10:00
Martin Schwenke
2afb5632c7 tests/eventscripts: Override background_with_logging(), just prepend "&"
That is, output that goes through background_with_logging() just gets
"&" prepended to each line.  This is cleaner than having the tests
grovel through logs.

Update some 49.winbind/50.samba tests to deal with this.

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

(This used to be ctdb commit 3ba933d806106d12bc48b83b22d0f314d9d1e5e5)
2013-08-14 15:57:03 +10:00
Martin Schwenke
df539a66cb eventscripts: Remove support for RPC service 'q' and 's' restart flags
They're hard to maintain and provide very little benefit.

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

(This used to be ctdb commit 1a1be43f8466d46913dcdfe6dcedb94316cd28ad)
2013-08-14 15:57:03 +10:00
Martin Schwenke
5459cdc8a6 eventscripts: When restarting the nfslock service only show output of start
That is, /dev/null the "stop" output.  This is consistent with the way
CTDB generally deals with the output when stopping a service.

It also makes updating the eventscript unit tests easier.

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

(This used to be ctdb commit c7332526b1b488abefeb4be78a7cd3f2f9abc451)
2013-08-14 15:57:03 +10:00
Martin Schwenke
d63cf0e7a7 tests/simple: Unreachable node test should wait for recovery to complete
This should minimise the chances of a control timing out.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 63be516673c5d9c0d543617bf1bb8bca919956a8)
2013-08-14 15:57:03 +10:00
Martin Schwenke
0997b0c400 tests/simple: Fix the missing IP test
Update the missing IP test to wait until restarts are complete.
Otherwise a service restart can collide with the following monitor
event and cause chaos.

Also, do not disable 10.interface until it matters.  Disabling it too
early can cause even more chaos if something goes wrong with the
monitor step.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 4e3bd06916bd3adac213fb18c7c2a24854b02d45)
2013-08-14 15:57:03 +10:00
Amitay Isaacs
8f1e94dfa4 recoverd: Use TDB_INCOMPATIBLE_HASH when creating volatile databases
When creating missing databases either locally or remotely, recovery
master calls ctdb_ctrl_createdb().  Recovery master always passes 0
for tdb_flags.  For volatile databases, if TDB_INCOMPATIBLE_HASH is not
specified, then they will be attached without using jenkins hash causing
database corruption.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2fc6b6403707a292d134140fc0b9145b454992c5)
2013-08-14 15:54:48 +10:00
Amitay Isaacs
de6b97ce4f Revert "recoverd: Use correct tdb flags when creating missing databases"
This reverts commit 10a057d8e15c8c18e540598a940d3548c731b0b4.

This approach would not work when creating local databases since currently
there is no control to receive TDB flags for remote databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ca61eb776ab862bd269e45ee0f9f96e7e1e0e001)
2013-08-14 14:15:33 +10:00
Amitay Isaacs
d349b56e2d common/io: Keep queue buffer size multiple of 4K
Currently queue buffer size is realloc'd every time we need to extend the
buffer.  Small increments can cause memory fragmentation.  Instead always
extend buffer in multiples of 4K.  This should reduce multiple talloc_realloc
calls when there are lots of packets in the socket buffer.

Also, if queue buffer has grown larger than 64K, throw away the buffer once
all the requests in the queue have been processed.  That way queue does not
hold on to large buffers.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5e9b1a7e24d058ff88aaa0563db36a804e866fa9)
2013-08-09 11:07:37 +10:00
Martin Schwenke
6f9090648a packaging: Allow setting custom release number in RPM spec file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 867afb247bd8cc86c8d738f051a44cc534cafacf)
2013-08-09 11:07:37 +10:00
Amitay Isaacs
a98baa539e ctdbd: When a record is made sticky, log only once
Instead of logging from ctdb_request_call(), log the message from
ctdb_make_record_sticky().  That way if the record is already sticky, the
message is not repeated unnecessarily.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 44a64d1c388bfe3c3388b191edfaedecfb7bb831)
2013-08-09 11:07:37 +10:00
Amitay Isaacs
d42cea6efe ctdbd: Improve high hopcount log messages when request is redirected
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9cde47e1a5bf1b9ca3b4da8c2db94caac2b1aa5e)
2013-08-09 11:07:37 +10:00
Martin Schwenke
98163e01a9 scripts: Do not run ctdb tool commands when debugging hung "init" event
CTDB daemon is not ready to accept clients in INIT runstate (init event).
CTDB daemon will start accepting connections in SETUP runstate (setup event)
and later.

Also, minor log formatting changes.

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

(This used to be ctdb commit 81d7ce03b28d592a1337639e14d9ea141e20bfff)
2013-08-09 11:04:55 +10:00
Amitay Isaacs
ded2f28954 ctdbd: Avoid leaking file descriptor if talloc fails
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d7f6bc3fed2dc61e6e587b4c0ec0ac27d533bbbe)
2013-08-09 11:04:55 +10:00
Amitay Isaacs
a030b938ca eventscript: Wait for debug hung script to finish or timeout before continuing
Currently if the debug hung script takes long time to finish, the subsequent
monitor event can collide with the previous event which is not yet finished.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9e99e0eb072e2b845914ee3896acbc66b96138d7)
2013-08-09 11:04:55 +10:00
Amitay Isaacs
f5ddb49e62 eventscripts: Use configured RECLOCK file instead of asking CTDB
On cluster where recovery lock file is not being used, asking CTDB daemon
is unnecessary overhead.  And if CTDB is using recovery file, then changing
configuration without restarting is *stupid*.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 44eb86e6042adb6efe75d2a5528b82a0f21d496d)
2013-08-09 11:04:55 +10:00
Amitay Isaacs
477a51aba5 locking: Do not create multiple lock processes for the same key
If there are multiple lock helper processes waiting for the same record, then
it will cause a thundering herd when that record has been unlocked.  So avoid
scheduling lock contexts for the same record.  This will also mean that
multiple requests will get queued up behind the same lock context and can be
processed quickly once the lock has been obtained.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ebecc3a18f1cb397a78b56eaf8f752dd5495bcc9)
2013-08-09 11:04:55 +10:00
Amitay Isaacs
9ba793a80f locking: Move function find_lock_context() before ctdb_lock_schedule()
So that ctdb_lock_schedule() can call this function without requiring extra
prototype declaration.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 68af5405acc123b5a90decd2123e2a02961a8fcf)
2013-08-09 11:04:42 +10:00
Amitay Isaacs
b77fec9381 ctdbd: Print set db sticky message after it's set
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 824dcec35ec461d78e22b2ea109473b32bfe3972)
2013-08-01 11:08:26 +10:00
Amitay Isaacs
1d9d1d8cf9 tests: Add a test program to hold a lock on a database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f6b066a23610fb0092298861c21a9b354b91e2f1)
2013-08-01 11:08:26 +10:00
Amitay Isaacs
f15e1a28a7 recoverd: Use correct tdb flags when creating missing databases
When creating missing databases either locally or remotely, make sure
to use the correct tdb flags from other nodes.  Without this, volatile
databases can get attached without TDB_INCOMPATIBLE_HASH flag.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 10a057d8e15c8c18e540598a940d3548c731b0b4)
2013-08-01 11:08:25 +10:00
Amitay Isaacs
e44c38dc45 client: Always use jenkins hash when attaching volatile databases
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7e7e59c4047c78159387089eca65d90037bcf722)
2013-08-01 11:08:25 +10:00
Amitay Isaacs
5ba280d8ce recoverd: Make sure to use jenkins hash for recovery databases
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 32c83e209823e9a4d6306bb7fd63d4500f3e2668)
2013-08-01 10:51:14 +10:00
Amitay Isaacs
f1f787ccac recoverd: Assemble up-to-date node flags information from remote nodes
Currently nodemap used by recovery master is the one obtained from the local
node.  This information may have been updated while processing main loop.
Before comparing node flags on all the nodes, create up-to-date node flags
information based on the information received from all the nodes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit fcf77dec5af973a0e32f3999bc012053a6f47a96)
2013-07-30 15:34:32 +10:00
Amitay Isaacs
16b519c51b tools/ctdb: Only print the hot records with non-zero hopcount
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 049d9beb3783482490e6273a434ccbad23f85f0a)
2013-07-30 15:34:32 +10:00
Amitay Isaacs
0993387f4a ctdbd: Don't consider a hot record if the hopcount is zero
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ab35773518ad15588013f4d859f7bee790437450)
2013-07-30 15:34:32 +10:00
Amitay Isaacs
054d8727ed ctdbd: Fix updating of hot keys in database statistics
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit fde4b4db5a57f75c5efa5647c309f33e0d5a68f3)
2013-07-29 16:00:46 +10:00
Amitay Isaacs
d8fc36781c ctdbd: Remove incomplete ctdb_db_statistics_wire structure
Instead of maintaining another structure, add an element as place holder for
marshall buffer of hot keys.  This avoids duplication of the structure.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e73b2e12adc9db1dedb48d32bba3a8406a80f4cd)
2013-07-29 16:00:46 +10:00
Amitay Isaacs
854216236b Revert "ctdbd: Remove incomplete ctdb_db_statistics_wire structure"
The structure cannot be removed without adding support for marshalling keys
for hot records.

This reverts commit 26a4653df594d351ca0dc1bd5f5b2f5b0eb0a9a5.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 023ca2e84f5ed064a288526b9c2bc7e06674dd81)
2013-07-29 16:00:46 +10:00
Martin Schwenke
e14fa50941 doc: Update XML files to use standard DocBook DTD
This simplifies building since we don't use any of the Samba
extensions.

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

(This used to be ctdb commit 57aa2dffea60abd73a95233f8b761cc676adebb6)
2013-07-29 15:58:51 +10:00
Martin Schwenke
3c73949317 initscript: The wrapper script should export CTDB_SOCKET
This ensures that any invocation of the ctdb tool (within the wrapper)
gets the desired value.  This at least ensures that ctdbd will be
started.

If a non-standard value is set for CTDB_SOCKET then command-line users
will still need the variable in their environment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 37ccc7c6cc43a80aaa92291aea7a438f4225488a)
2013-07-29 15:58:51 +10:00
Martin Schwenke
a5cb72cac3 ctdbd: Kill client process without checking for tracked child
Commit f73a4b1495830bcdd094a93732a89dd53b3c2f78 added a safety check
to ensure that CTDB never kills unrelated processes.  However, client
processes are unrelated.

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

(This used to be ctdb commit 782814288bb560099ee44b607bf35f3eddf37f82)
2013-07-29 15:58:51 +10:00
Martin Schwenke
a8dd716146 eventscripts: kill_tcp_connections() should send connections to stdin
This avoids issuing multiple "ctdb killtcp" commands to terminate tcp
connections, one per connection.  This will considerably reduce the
time when there is a large number of tcp connections.  This also makes
it possible to avoid calling "ctdb killtcp" when there are no connections.

Add a couple of unit tests for killtcp and update eventscript unit
test infrastructure to support.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)
2013-07-29 15:53:06 +10:00
Martin Schwenke
200c28fbb2 tools/ctdb: Allow killtcp to read connections from standard input
This will allows eventscripts to send information about multiple tcp
connections to a single "ctdb killtcp" command, saving the overhead of
setting up a client connection per tcp connection.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit af5aa369c266430fe912df0c26116b68bac3572e)
2013-07-29 15:51:03 +10:00
Martin Schwenke
34d55048bc tests: Always tally the number of passed/failed tests
Regardless of whether a summary is being printed!

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

(This used to be ctdb commit a69e03a5e4671e998d45b4fef8611a421bbdb3e1)
2013-07-29 15:49:23 +10:00
Martin Schwenke
f46ab595d1 recoverd: Call takeover fail callback only once per node
Currently the fail callback is called once per (takeip/releaseip) control
failure.  This is overkill and can get a node banned much too quickly.

Instead, keep track of control failures per node and only call fail
callback once per failed node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit bf4a7c1ad87e0e848296d15d63eb8cd901ca5335)
2013-07-29 15:48:48 +10:00
Martin Schwenke
67b22b6e94 scripts: Run scriptstatus for hung event
The timeout information printed by ctdbd is less than useful because
it refers to the cumulative time taken by the eventscripts run so far.
Adding scriptstatus output indicates where time was actually spent.

Since there is now quite a bit of output, serialise the calls to this
script using flock.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1b016b2dfc5d7d3f2a42ce4dfe569608e90eb714)
2013-07-29 14:02:13 +10:00
Martin Schwenke
6cbcc4a8d9 ctdbd: Pass event name to hung script debugger
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e0f3fa1020e13b84bdd672538168d148f1847d57)
2013-07-23 11:28:07 +10:00
Martin Schwenke
6882625cfe tests/complex: Fix NFS tests to work with root_squash
Refactor the NFS test setup/cleanup code into new common functions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 29e98017221326bdc9b1c4f7c05b3b495c1de29b)
2013-07-23 11:28:07 +10:00
Martin Schwenke
1584f296b4 tests: Fix exit status of run_tests when a single test is run with -H
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9d6e1c147bd036d832b98c155f405ee2a5d6f57f)
2013-07-22 19:38:50 +10:00
Martin Schwenke
417ee2f0aa tests/simple: Add -p in onnode test to help show groups of connections
Change the command from "true" to "hostname" since the former won't
produce any output when used in combination with "onnode -p".  This
could just be changed to "echo" but the hostname might actually be
useful.

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

(This used to be ctdb commit ae3c03d80264e997b7da9f3279d7810e18b8a1df)
2013-07-22 19:36:58 +10:00
Martin Schwenke
88ba32b787 ctdbd: Sleep at exit to allow time for log messages to flush
Register print_exit_message() earlier so that it covers most of the
early exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 90d792cf28d6a823141e4c417b6978f02a9cf596)
2013-07-19 15:40:59 +10:00
Martin Schwenke
84f5528d9b ctdbd: Exit if something is already listening on CTDB socket
Don't blindly remove the socket.

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

(This used to be ctdb commit 3dd5b925dcf0e9a5b877638e471c5ecf36b46c58)
2013-07-19 15:40:43 +10:00
Martin Schwenke
363315aca5 tests/eventscripts: Add tests for monitoring of missing interfaces
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 53e4eca74429f76adc81d98e3d11d1bd61194d71)
2013-07-19 15:37:14 +10:00
Martin Schwenke
1da757d91a eventscripts: A missing interface should cause monitoring to fail
A missing interface is at least as bad as an interface with a link
that is down so should have a similar effect.

This couldn't be done previously because orphaned interfaces used to
be listed for monitoring.  This was worked around in 10.interface in
commit 49b2d1bd9554461ed8edbfc21e777c0eca9e1443 and fixed in ctdbd in
commit cc1a3ae911d3fee8b87fda5de5ab6d9499d7510a.

If $CTDB_PARTIALLY_ONLINE_INTERFACES="yes" then monitoring won't
actually fail but the interface is still marked as down.

While we're touching this code, use "ip link" instead of "ip addr".
It is marginally cheaper but not enough for a separate patch.  ;-)

This effectively reverts d67955b42f7627be9dae995230c8fcbb8a948ec2.

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

(This used to be ctdb commit 501f19b16fd6d67fbb754248868c38ee5bcf79ef)
2013-07-19 15:35:41 +10:00
Martin Schwenke
4b5c9c7991 eventscripts: Get list of configured interfaces using "ctdb ifaces"
This was previosuly changed because ctdbd didn't garbage collect
orphaned interfaces.  This was fixed in commit
cc1a3ae911d3fee8b87fda5de5ab6d9499d7510a.

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

(This used to be ctdb commit c6ab0f9405d5fa5b0b1693bc92e59da0d555a9d7)
2013-07-19 15:35:41 +10:00
Martin Schwenke
a3bef911f3 ctdbd: Allow extra recovery to repair persistent DBs during first recovery
Commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28 introduced a potential
regression because a node may not have completed the "recovered" event
(so might still be in CTDB_RUNSTATE_FIRST_RECOVERY) when another node
becomes healthy.

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

(This used to be ctdb commit 57ef5d3827ea3417a32703e259a53ce6fd10ac45)
2013-07-19 15:35:41 +10:00
Amitay Isaacs
5f0b19c6f7 packaging: Bundle debug_locks.sh script in RPM
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5740155cc5de1a223412e8529aa1a383a5412514)
2013-07-16 12:59:50 +10:00
Amitay Isaacs
bf2b388837 packaging: No need to check for existence of scripts, they always do
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 67c227a5d30cb8487b20b19b20bdfa4613906609)
2013-07-16 12:59:47 +10:00
Martin Schwenke
7610b6c009 scripts: ctdbd_wrapper logs a message to syslog if syslog is not being used
It can be very disconcerting when logging to syslog is expected but
nothing is being logged there.

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

(This used to be ctdb commit 412bc0e20bef694d4e911dc9c984fd7716231f1f)
2013-07-11 15:18:06 +10:00
Mathieu Parent
27c2c61c21 Update Nagios check to work with ctdb versions past 30 Aug 2011
Because of commit a779d83a6213e2ba

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

(This used to be ctdb commit a4afe7af9c9391048d6f80135bbd5e15367770c7)
2013-07-11 15:18:06 +10:00
Martin Schwenke
ca13f28eef recoverd: Really fix bogus info in message about changed flags
Commit 9119a568c2b4601318f7751f537dca2f92a7230b attempted to fix this.
However, this was wrong because old_flags and new_flags were confused.
The latter has since been fixed in commit
7eb2f89979360b6cc98ca9b17c48310277fa89fc so this can now be fixed
properly.

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

(This used to be ctdb commit 40f2825d6e818dc8c745b6385a545969dfb45fbc)
2013-07-11 15:18:06 +10:00
Martin Schwenke
2b8913fed6 doc: Update NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 76703514040b804b880cab909f6ff52576f80f89)
2013-07-11 15:17:57 +10:00
Sumit Bose
67f8a0ed91 Print deleted nodes as well
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0930a3b806977555509c3228726e2250aef1f971)
2013-07-11 15:16:56 +10:00
Sumit Bose
3dc280f5b0 IPv6 neighbor solicit cleanup
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a81edf7eb908659a379f0cb55fd5d04551dc2c37)
2013-07-11 15:16:55 +10:00
Sumit Bose
1f96f42b73 Fix memory leak in ctdb_send_message()
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit da87395d29f5d11ecfedaf36b53fa060a9140bfd)
2013-07-11 15:16:55 +10:00
Sumit Bose
157f1cfefd Fixes for various issues found by Coverity
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 05bfdbbd0d4abdfbcf28e3930086723508b35952)
2013-07-11 15:16:55 +10:00
Sumit Bose
d039f799ac Check return value of tdb_delete()
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5cdcc3d45d358ddbcd7e864898eed9cbd9935429)
2013-07-11 15:16:55 +10:00
Amitay Isaacs
a40b9f2e7c web: Update webpages
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ed9ba1d3dcfcb51aa69bf4d7a74b95063743d8d9)
2013-07-11 15:16:55 +10:00
Amitay Isaacs
f6f2cad9df Tests: Correct the arguments to memset
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9ffcd6a91287d86bae7b0c73aa129c81126e08e7)
2013-07-11 11:34:46 +10:00
Amitay Isaacs
94b8e3926b doc: Update NEWS
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 14141b02b61d2783b750ee5b30f9520253e88f09)
2013-07-10 18:15:38 +10:00
Martin Schwenke
e4d99cc899 packaging: Add systemd support
Based on an original patch by Sumit Bose <sbose@redhat.com>.

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

(This used to be ctdb commit e43a4b7b69a21c4cec2453dcac436b64bf5d7f06)
2013-07-10 18:14:33 +10:00
Martin Schwenke
af0f11a4ab build: Turn off all deprecation warnings
The "‘tevent_loop_allow_nesting’ is deprecated" warnings will be
around for a while and are annoying.

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

(This used to be ctdb commit 30a0040fbb7c4d97d107f0e55c600295c2603a68)
2013-07-10 18:14:32 +10:00
Martin Schwenke
4349cb9807 build: Remove -DTEVENT_DEPRECATED_QUIET=1 from CFLAGS
This reverts the last part of 788cdbddbc902a5b076d23473450065b551d274d
- the rest of this has been implicitly reverted via tevent syncs.
This is just leftover noise.

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

(This used to be ctdb commit b6bbfb4c464c39e322830cbbebcc51c225508584)
2013-07-10 18:14:32 +10:00
Martin Schwenke
adbee6ae4e initscript: Simpify initscript and control CTDB via new ctdbd_wrapper
Currently the initscript is very complex.  This makes it hard to read
and hard to add support for new init systems, such as systemd.

Create a wrapper called ctdbd_wrapper to be installed alongside ctdbd.
This is called by the initscript to start and stop ctdbd.  It does the
ctdbd option construct and waits until ctdbd is properly initialised
before it exits.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit e3abc7eebab5cceddc4ce7817890dd5db9be3450)
2013-07-10 15:19:27 +10:00
Martin Schwenke
a86f1f109a recoverd: Recovery daemon should use ctdb_get_pnn, which can't fail
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c6fded59fa4da67f738a90fdacb51900e41801f9)
2013-07-10 15:19:27 +10:00
Amitay Isaacs
14c49eabe4 ctdbd: Print tdb flags when logging attached to database message
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 846109169ee5e3d03135156e45c8dac93aa2e95b)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
1c21f37e57 ctdbd: Set process names for child processes
This helps distinguish processes in process list in top, perf, etc.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2493f57ce268d6fe7e4c40a87852c347fd60d29e)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
500b26e48f common/system: Add ctdb_set_process_name() function
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit fc3689c977f48d7988eed0654fb8e5ce4b8bfc8b)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
4357aebdb9 traverse: Remove unused start_time field
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit dc834d5e78c3fb97ae15cddf1139b3c4a4051a7c)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
bf3dd9488e traverse: Send records directly from traverse child to srcnode
Currently CTDB daemon reads records from a child process and then sends them to
srcnode via TRAVERSE_DATA control.  This ties up main CTDB daemon and also
requires an extra copy of the record in the CTDB daemon.  Instead send records
directly from traverse child process.

The control from child process still goes via local CTDB daemon as there
is no infrastructure currently to open a TCP socket to the srcnode.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1a74192aa7d51ed99553e7292860027f06b6ef37)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
557b92fc88 traverse: Pass reqid and srcnode information to local database traverse
So that traverse child process can directly send the TRAVERSE_DATA control to
the srcnode without first sending it to local node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit faabce1b99fb3de9ff03bf54d303e7656538fee3)
2013-07-10 14:33:19 +10:00
Amitay Isaacs
3dcdd39801 packaging: When building with system libraries, add dependency for them
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8225b3e77e140db34b52571a95d553d1e59e3f1e)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
d46c24f4d0 ctdbd: No need for DeadlockTimeout tunable
The code for deadlock detection and killing smbd process causing deadlock
has been removed and replaced with external debug script.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2211cd94bea266547d3e6f167d3160a6b23bec88)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
ae0afad8ee initscript: Export CTDB_DEBUG_LOCKS variable
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a415a1986900135f889efc25ecaf2761b1dae81a)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
f46d0e783c scripts: Add an example debug_locks.sh script to debug locking issue
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c711ff4702c5f95b75e4bf030665fc2afffc2f9e)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
c620457c0b locking: Use external script to debug locking issues
Use an external script to parse /proc/locks and log useful debugging
information about locks rather than doing that in C code.

To use this feature, add configuration variable to /etc/sysconfig/ctdb:

  CTDB_DEBUG_LOCKS=/etc/ctdb/debug_locks.sh

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2bfb8499366d530f16515b08928056bbda40f781)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
9ae379c91a locking: Update locking bucket intervals
0   < 1 ms
 1   < 10 ms
 2   < 100 ms
 3   < 1 s
 4   < 2 s
 5   < 4 s
 6   < 8 s
 7   < 16 s
 8   < 32 s
 9   < 64 s
10   >= 64 s

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 6fc36a7036933237d09151a0baf4d8ccd2bc2c99)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
1afb7fccb2 locking: Update locks latency in CTDB statistics only for RECORD or DB locks
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit dcc42a75b4638b3aa40c44ed9e0aaae26483e2b0)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
81e6d60f01 tools/ctdb: Fix the format of DB statistics output
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 594c421f90ce132c75fbd985872114e4967f92b5)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
d36aa928fd ctdbd: Remove incomplete ctdb_db_statistics_wire structure
Send the ctdb_db_statistics directly instead of first copying it to
duplicate ctdb_db_statistics_wire structure.  This simplifies the
implementation of the control to get database statistics.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 26a4653df594d351ca0dc1bd5f5b2f5b0eb0a9a5)
2013-07-10 14:33:18 +10:00
Amitay Isaacs
c0798dfb64 ctdbd: Update debug messages for setting readonly property on database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 545a46437dfb2b755bb2fddb11dea8c4ccce3ed7)
2013-07-10 14:32:52 +10:00
Amitay Isaacs
bcb64aa55f recoverd: Fix buffer overflow error in reloadips
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 41182623891d74a7e9e9c453183411a161201e67)
2013-07-05 15:52:34 +10:00
Martin Schwenke
f92e49f6f8 tests/eventscripts: Add some rudimentary tests for 60.ganesha
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e1cf1f728236d808bb41265e74bc65f54bf1c133)
2013-07-05 15:52:34 +10:00
Martin Schwenke
d6d1fb1f46 eventscripts: New configuration variable $CTDB_SKIP_GANESHA_NFSD_CHECK
This allows 60.ganesha to be unit tested, except for the core Ganesha
monitoring code.

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

(This used to be ctdb commit f606df4f2db754592e6d1a16c26e155cacb2beef)
2013-07-05 15:52:33 +10:00
Martin Schwenke
7f6169b207 eventscript: Move Ganesha nfsd monitoring to a function
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ceb5b2d37f7ab4894908ec26f3812b3bed991525)
2013-07-05 15:52:33 +10:00
Martin Schwenke
c3e83d4532 eventscripts: Drop RPC service version from nfs_check_rpc_service() calls
Support for this was removed in commit
77302dbfd85754e02559eccb2dd6c090db0b6b9f and I overlooked its use in
60.ganesha.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 520914e7ee1b879c1080e5857fda18ed5b973fd6)
2013-07-05 15:52:33 +10:00
Martin Schwenke
dcdae86dc7 ctdbd: Log something when releasing all IPs
At the moment this is silent and it can be confusing to see IPs just
disappear.

Also, this message:

  Been in recovery mode for too long. Dropping all IPS

can cause anxiety when all IPs should already have been dropped.
Adding a comforting message saying that 0 IPs were dropped relieves
such anxiety.  :-)

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

(This used to be ctdb commit 4d0f26b306fc465d551d340b0e7dce4412eae3fd)
2013-07-05 15:52:33 +10:00
Martin Schwenke
0108e8ff10 recoverd: Minor style improvements for ctdb_reload_remote_public_ips()
* Add a variable to the loop to make the code more readable and have
  it generally fit into 80 columns.

* Improve comments.

* Improve log messages.

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

(This used to be ctdb commit 0a292fa8939a1343e44cadaa8ed9f3c0f18ca82f)
2013-07-05 15:52:33 +10:00
Martin Schwenke
7290798a41 recoverd: Clean up log messages in remote IP verification
The log messages in verify_remote_ip_allocation() are confusing
because they don't include the PNN of the problem node, because it is
not known in this function.

Add the PNN of the node being verified as a function argument and then
shuffle the log messages around to make them clearer.

Also fold 3 nested if statements into just one.

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

(This used to be ctdb commit f0942fa01cd422133fc9398f56b4855397d7bc86)
2013-07-05 15:52:33 +10:00
Martin Schwenke
15115becef recoverd: Fix an unclear log message - "Restart recovery process"
When the recovery master notices a node in recovery mode it starts the
recovery process, it doesn't restart it.

Update documentation to match.

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

(This used to be ctdb commit 298c4d2c3b4ea3d900c91f5a0a5aca2952a13d61)
2013-07-05 15:52:33 +10:00
Martin Schwenke
bfe0b93652 recoverd: Fix an incorrect comment
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9f6cd8b0bea619991c9f3bf35188c5950dabf8f4)
2013-07-05 15:52:33 +10:00
Martin Schwenke
9c8cc863f7 ctdbd: Use ctdb_die() on "setup" event failure
This is slightly easier to read because it all fits on 1 line.

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

(This used to be ctdb commit 035bf3eecf99337c84d4ad16cdbf297b1fa037db)
2013-07-05 15:52:33 +10:00
Martin Schwenke
c327c91490 ctdbd: Avoid a core dump when "init" event fails
The "init" event only really fails in the scripts, which should log
something useful on failure.  Therefore, a core dump isn't terribly
useful and sometimes attracts unwanted attention.

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

(This used to be ctdb commit 3af2d833b63af9931792106db71797f3692669a8)
2013-07-05 15:52:33 +10:00
Martin Schwenke
dbd1759eae util: New function ctdb_die()
This is like ctdb_fatal() but exits cleanly without dumping core or
generating a backtrace.

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

(This used to be ctdb commit c0a9456692c88a7a5542cd893d8f326524d3f94e)
2013-07-05 15:52:33 +10:00
Martin Schwenke
4e07c6c433 eventscripts: When replaying monitor status, don't log empty output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ce04f1c107b4392ca955d9f29b93aaaae62439ce)
2013-07-05 15:52:33 +10:00
Martin Schwenke
26b161156a ctdbd: Release IP callback should fail if the IP is still hosted
At the moment there (at least) are 2 bugs that cause rogue IPs:

* A race where release_ip_callback() runs after a "subsequent" take IP
  has completed.  The IP is back on an interface but we unset
  vnn->iface in the callback.

* A "releaseip" eventscript times out.  We ignore the timeout and call
  it success, deleting the VNN even if the IP is still hosted.

  We could decide not to ignore the timeout and ban the node, but
  killing TCP connections can take a long time and that might result
  in a lot of manning.  We probably won't reinstate banning on
  "releaseip" until killing TCP connections has been optimised.

In both cases, a rogue IP can be avoided by leaving vnn->iface set and
simply failing the control.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c5797f2942e83da24df548ea07196fbbac0eab20)
2013-07-05 15:52:32 +10:00
Martin Schwenke
793233f6b6 ctdbd: Log warnings in release IP when unexpected interface is encountered
Previous code changes work around a potential problems but do not
provide useful information when the a problem occurs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f1f1b0c24b9b6cd24b83a4e4da16e179287ec6ac)
2013-07-05 15:52:32 +10:00
Amitay Isaacs
cc6772c968 ping_pong: Validate num_locks argument > 0
This fixes the floating point error if num_locks = 0.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 16afe36de52561a62372c14b567683dc898369d5)
2013-07-04 20:43:52 +10:00
Amitay Isaacs
cc3ffdbc1a tests: If connection to ctdb daemon fails, exit
This fixes the segmentation error if any of the test code fails to
connect to CTDB daemon.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d48eecd748830598f4f080952f2bf05d6f92738c)
2013-07-04 20:43:52 +10:00
Amitay Isaacs
6391f61fbc build: Fix compiler warnings for uninitialized variables
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5408c5c4050539e5aa06a5e82ceb63a6cb5cef0c)
2013-07-04 20:43:52 +10:00
Amitay Isaacs
f032c60cd5 recoverd: Send the result from child process only once
The result has been sent before the child keeps waiting for parent
ctdbd process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9aa13bcedd83d463c871e3cf1f3a65da3cd83992)
2013-07-04 20:43:52 +10:00
Amitay Isaacs
a11e8ab75a packaging: Enable compiler optimizations
This reverts d09570c70551aa40390ce9ceffe7bc234e1afafe.

... hoping the segv has been found in last 6 years. :-)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 9b529189f8456fad7868fc154ae27a6fd87e93b3)
2013-07-04 20:43:52 +10:00
Amitay Isaacs
b169182ff2 packaging: Allow building RPMs with system tdb/talloc/tevent
To build CTDB RPMs with system installed libraries, use following command:

  ./packaging/RPM/makerpms.sh \
    --with system_talloc \
    --with system_tdb \
    --with system_tevent

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit bb54f3924ff19cd089b0a166fe8368db162ad709)
2013-07-04 20:41:51 +10:00
Amitay Isaacs
ae03a5e3ee packaging: Do not mark /etc/ctdb/functions as configuration file
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1b0faae9c939a2f8da3cacba715ca62a5830d190)
2013-07-04 16:49:22 +10:00
Amitay Isaacs
71930e12b5 packaging: Install README.notify.d using %doc directive
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 53d34eb2f9e5434dea4e7182b6af566a3a96a368)
2013-07-04 16:49:15 +10:00
Amitay Isaacs
4a7f01f37e packaging: Install docs using %doc directive
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 6fe584d05543eebd24abd19bab502dc4da04e921)
2013-07-04 16:49:06 +10:00
Amitay Isaacs
dfa845151a packaging: Remove ctdb_transaction from docdir
It's bundled in ctdb-tests package.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7e53fbf92b6dd5211d918ea0e23126b7dfa50c42)
2013-07-04 14:30:46 +10:00
Martin Schwenke
ab68cf3446 doc: Add a disclaimer for the EnableBans tunable
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 145b1966c1b34f1667a175235e1df2741294391c)
2013-07-04 14:30:18 +10:00
Martin Schwenke
0c5d2fb5a7 doc: Add banning bug fixes to NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b4c06e8ec8b227c1e6c01444038c3b15b5f9e606)
2013-07-04 14:30:02 +10:00
Amitay Isaacs
c944a589ca ctdbd: Don't ban self if init or shutdown event fails
There is no point in banning the node if init or shutdown event times
out since it's going to quit anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ef1c4e99ca66e7a990bc557f34abb624c315e6ba)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
29adaae093 doc: The second half of monitoring is only for recovery master
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit fcd5e1f04c5fe6c98399429b8f0918b8779acba6)
2013-07-02 12:59:09 +10:00
Michael Adam
3c65197b7a recoverd: when the recmaster is banned, use that information when forcing an election
When we trigger an election because the recmaster considers itself inactive,
update our local nodemap with the recmaster's flags before calling
force_election(). This way, we don't send the inactive node freeze commands
(e.g.) that may fail and then lead to ourselves getting banned.

The theory is that this should help avoiding banning loops.

Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 932360992b08a5483d90c0590218ba0fd756119e)
2013-07-02 12:59:09 +10:00
Michael Adam
082da536cb recoverd: fix a comment typo
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 741944f118e98f178b860194eecb215180949d18)
2013-07-02 12:59:09 +10:00
Michael Adam
159b9a2989 recoverd: fix a comment in main_loop
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit ac06c46e4a80c635f6094b5ac6f0bf3e3a02db95)
2013-07-02 12:59:09 +10:00
Michael Adam
26365f2a5f recoverd: eliminate some trailing spaces from ctdb_election_win()
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit df30c0a05ed908fc2a997c56ff5484736b23b70f)
2013-07-02 12:59:09 +10:00
Martin Schwenke
aa79a656a7 recoverd: Don't continue if the current node gets banned
Can not continue with recovery or monitoring cluster.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 14399de1dd0bd8dabf1f48b1457e3ccb37589d8a)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
b29b6ae39e recoverd: Refactor code to ban misbehaving nodes
Since we have nodemap information, there is no need to hardcode the
limit of 20.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit aea12dce83ef385e9fb3bc03ac7ace0874a0e3fe)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
c22de8d1c0 recoverd: Move code to ban other nodes after we get local node flags
If a node gets banned first, then it should not ban other nodes.

This code was moved up in main_loop to avoid waiting for nodemap
from other nodes (commit 83b0261f2cb453195b86f547d360400103a8b795).

To prevent a banned node from banning other nodes, we need to first get
nodemap information from local node, so trying to ban other nodes can
fail if we are already banned.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ae1693905036ecdbc4594fde1f12500faae4a554)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
32f9d7c0d4 recoverd: Delay the initial election if node is started in stopped state
Since there is an early exit if a node is stopped or banned, we can wait till
the node becomes active to start initial election.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 593a17678fbd3109e118154b034d43b852659518)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
d2411e74f1 recoverd: Update capabilities only if the current node is active
Since we do an early return if a node is stopped or banned, move update
capabilities code below the early return and just before we check the
capabilities of current recovery master.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 93bcb6617e1024f810533e12390a572f51703ca0)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
73e6cc765d recoverd: No need to check if node is recovery master when inactive
If a node is stopped or banned, it will cause early return from the
main_loop, so this check is redundent.  The election will called by an
active node.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 815ddd3341b7e9db39e05a3a3fcd9a1420f053bc)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
870409ed1c recoverd: Always do an early exit from main_loop if node is stopped or banned
A stopped or banned node cannot do anything useful.  So do not participate
in any cluster activity and do not cause any unnecessary network traffic.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2396981c4bcf30530aeb7f4395093cc202105b50)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
7b761c4b97 recoverd: Do not set banning credits on a node if current node is inactive
If the current node is banned or stopped, then it should not assign banning
credits to other nodes since the current node will not have up-to-date flags
of other nodes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 38304f88e0c634e97d4687c25adef975f71537b8)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
5deebd3b75 banning: Do not come out of ban if databases are not frozen
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit a60f228f8380f222f838eb619d2ab55f96f11ac2)
2013-07-02 12:59:09 +10:00
Amitay Isaacs
9a944d71dc banning: No need to check if banned pnn is for local node
If the banned pnn is not the local node, the function returns early.
So no need for additional check.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 297d93cecc3c0655e72ecac38508e113bdbeab9c)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
c6914e3891 banning: Make ctdb_local_node_got_banned() a void function
When this function is called, we are already committed to banning
and there is no point in failing this function.  In case, freezing of
databases fails, it will be fixed from recovery daemon.

(This used to be ctdb commit bb178338658b4ae32382a1f62f7c21cee1d4878f)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
cf1d4bfde3 recoverd: Also check if current node is in recovery when it is banned
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 6a9dbb8fb0f1f6e8c206189cdc2d33bb371ea2a8)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
3052006bf9 recoverd: Set node_flags information as soon as we get nodemap
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8d622660a14c929e365d306147b378ea6ab92175)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
36d8d25b6c recovered: Remove old comment as the code corresponding to that has gone away
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 34af2cdf686d5d77854cbaa7bbcd8f878e9171c7)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
ea00a5ecf5 banning: Log ban state changes for other nodes at higher debug level
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c6f8407648abb37f2ed781afa5171dad8c9f59e9)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
622ccd09f9 freeze: Make ctdb_start_freeze() a void function
If this function fails due to memory errors, there is no way to recover.
The best course of action is to abort.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 46efe7a886f8c4c56f19536adc98a73c22db906a)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
cf17247d31 freeze: If priority is invalid here, it's time to abort
ctdb_start_freeze() is called from ctdb_control_freeze() which fixes the
priority if it's 0 and return error if it's invalid.  Other callers of
ctdb_start_freeze() are internal to CTDB.  So if priority is invalid in
ctdb_start_freeze(), definitely something is seriously wrong.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 87716e8f504d659515d3dbcf93badbf106873bc8)
2013-07-02 12:59:08 +10:00
Amitay Isaacs
6fe0089bc0 freeze: Log message from ctdb_start_freeze() and ctdb_control_freeze()
This ensures that whenever databases are frozen either via sending
control or by calling ctdb_start_freeze(), the action is logged.
Since ctdb_control_freeze() calls ctdb_start_freeze(), move logging of
message in early return condition if databases are already frozen.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 478e24bceda3fedfba54ccb48faa115df726b819)
2013-07-02 12:57:03 +10:00
Amitay Isaacs
d439aa05a8 recoverd: Print banning message only after verifying pnn
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 4be8dff3a4451192f838497b4747273685959bed)
2013-06-28 14:20:12 +10:00
Amitay Isaacs
6960bf78ff recoverd: When updating flags on nodes, send updated flags and not old flags
This was broken by commit a9a1156ea4e10483a4bf4265b8e9203f0af033aa.
Instead of a SRVID_SET_NODE_FLAGS message to recovery daemon, a control
was sent to the local daemon which in turn informed the recovery daemon.
And while doing this change old flags were sent via CONTROL_MODIFY_FLAGS.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7eb2f89979360b6cc98ca9b17c48310277fa89fc)
2013-06-28 14:20:12 +10:00
Martin Schwenke
442953c540 tools/ctdb: Add "force" option to "recover" command
At the moment there is no easy way to force a recovery when attempting
to reproduce certain classes of bugs.  This option is added without
documentation because it is dangerous until the bugs are fixed!  :-)

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

(This used to be ctdb commit 4f87925a287f612a6ab3b5da1a387a31c7bea28f)
2013-06-28 14:18:00 +10:00
Amitay Isaacs
f9191c061a client: Exit with non-zero status when unix socket is closed
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 733fc909425860f6a02c205c2d8f34a731853922)
2013-06-25 17:48:23 +10:00
Martin Schwenke
55de6c56ce doc: Fix ctdb ping entry in manpage
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit abeb65ef02d018a7c14d4f8cea71e15c6cf9e357)
2013-06-22 15:54:19 +10:00
Martin Schwenke
356647949b doc: Fix documentation for NoIPTakeover in ctdbd manpage
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5d0215be5aefe492258a92c7bff2d41960379580)
2013-06-22 15:54:19 +10:00
Martin Schwenke
ed45a2e115 doc: Update notification script section in ctdbd manpage
The example notification script is now much more useful.

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

(This used to be ctdb commit 4ba7c73eeab98296c9168e0b0fed1f6bb9f32733)
2013-06-22 15:54:19 +10:00
Martin Schwenke
017b966669 doc: Add nodestatus command to the ctdb manpage
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4369c8e6ead9062ef7855ada375df74262acf925)
2013-06-22 15:54:19 +10:00
Martin Schwenke
51150c7727 doc: Update NEWS
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cd6227aa38d3bb4e5043faeffe436004e27b6d06)
2013-06-22 15:54:14 +10:00
Martin Schwenke
16d374f75e tests: Integration tests use "ctdb nodestatus" for healthy cluster check
Also check that we're not in recovery mode.

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

(This used to be ctdb commit b7aaa28b3a6a2de923417f3d143f8d516447711e)
2013-06-22 15:51:17 +10:00
Martin Schwenke
0a80d65c2e tests: Integration test infrastructure should do only a single recovery
No need for 2 recoveries after a restart.

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

(This used to be ctdb commit b953524185632d7f96a76d8f3bbed7ac1d143d40)
2013-06-22 15:51:17 +10:00
Martin Schwenke
44e885e98e ctdbd: Fix panic on overlapping shutdowns
The runstate can't be set to SHUTDOWN twice, so the current naive code
causes a panic on the 2nd shutdown.  This regression was introduced in
commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28.

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

(This used to be ctdb commit f1b7ca8dc3f34a59c7b3e55748f974ac9ed8f458)
2013-06-22 15:51:16 +10:00
Martin Schwenke
6a52a87028 ctdbd: Refactor shutdown sequence
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b32fd04bfbf33062d45365b37a7247e272a76ceb)
2013-06-22 15:51:02 +10:00
Martin Schwenke
01d879806b eventscripts: "setup" event doesn't need to wait for SETUP runstate
The "setup" event isn't called until ctdbd is in CTDB_RUNSTATE_SETUP
anyway...

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

(This used to be ctdb commit 9ea57af557028b1d2e5c560e7bcf4d014b9a8b1e)
2013-06-20 13:01:10 +10:00
Martin Schwenke
3b2f7330cc tests/eventscripts: New tests for 00.ctdb "init" event
These test dropping of IPs and TDB checking.

New stubs for date, tdbdump, tdbtool.

Enhance ip stub to handle "ip addr show to ..."

Tweak some infrastructure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
2013-06-20 13:01:10 +10:00
Martin Schwenke
4eed91b54a eventscripts: 13.per_ip_routing should not try hard to find public_addresses
This essentially reverts d4621277240721e6d130a930b0100506b64467ea.
This was added for testing but the test code was actually broken.
CTDB itself will only process public IPs if $CTDB_PUBLIC_ADDRESSES is
set, so no code should try to be more flexible than that!

The test code has been fixed instead.

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

(This used to be ctdb commit 3b11b27f3e22e99947bc2d6c49c4427bd7a0e332)
2013-06-20 13:01:10 +10:00
Martin Schwenke
2ceed3b0c8 tests/eventscripts: setup_ctdb() should always set $CTDB_PUBLIC_ADDRESSES
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c3e7a6e10d486ba0dbafdf110db540675b2317bc)
2013-06-20 13:01:10 +10:00
Martin Schwenke
58d499d3ae logging: Notify parent when logging daemon is up
Messages are lost until it is really up because syslogd_is_started is
set too early.  Adding a pipe to do the notification allows the parent
to wait and only set syslogd_is_started when the logging daemon is
actually ready.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit f3dd2eec200d6eeada2ea19cd7e76f1edfad6167)
2013-06-20 13:01:10 +10:00
Martin Schwenke
6317285c4f scripts: Move TDB checking from initscript to "init" event
It makes sense to do this in the "init" event and make the initscript
less complicated.

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

(This used to be ctdb commit 3bc93f312b8464fbfa2b2c44fffedc591fe5a3e0)
2013-06-20 13:01:10 +10:00
Martin Schwenke
961468146e scripts: Move dropping of all IPs from initscript to "init" event
It makes sense to do this in the "init" event and make the initscript
less complicated.

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

(This used to be ctdb commit 0b77cceb49a30a181063adc7868d42d2851318e8)
2013-06-20 13:01:09 +10:00
Martin Schwenke
bee02e06e6 scripts: drop_ip() should use delete_ip_from_iface()
Otherwise secondary addresses that aren't owned by CTDB could be
dropped.

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

(This used to be ctdb commit 5ffce65a1ad659b198ddf647622b899bdde45c72)
2013-06-20 13:01:09 +10:00
Martin Schwenke
a1eb516f0a scripts: drop_all_public_ips() now prints messages to stdout, not log
Change all callers to maintain current behaviour.

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

(This used to be ctdb commit 0b67397ef5419c781a35916575151da7b7e7cc27)
2013-06-20 13:01:09 +10:00
Martin Schwenke
26d0746b5d ctdbd: "init" event should run earlier in daemon initialisation
It should run before:

* the transport is started;
* databases are attached; and
* processing configuration files (e.g. nodes, public_addresses).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 0a0c8543f167e11b75a622513367b083e42cbd3f)
2013-06-20 13:01:09 +10:00
Amitay Isaacs
a4f4e391f0 tools/ctdb: Do not exit prematurely on control timeout if retrying in a loop
This avoids premature exits from "ctdb stop" and "ctdb continue" due to
intermittent control (e.g. getpnn, getnodemap) timeouts.

This needs a proper fix to distinguish between timeout and failure
conditions and take appropriate action.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c48583fd238496a81ddc46a21892f0b49559036a)
2013-06-20 12:52:00 +10:00
Amitay Isaacs
585a2715a6 packaging: Update the minimum required library versions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 5f8547b1531bba4950b3d873a997585c3a16d31e)
2013-06-17 10:44:31 +10:00