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

3995 Commits

Author SHA1 Message Date
Michael Adam
1a31c84348 traverse: add a flag to enable transferring empty records in cluster wide traverse
This will be useful for also printing information about empty/deleted
records in "ctdb catdb", e.g. for debugging vacuuming issues.

(This used to be ctdb commit ddc5da3a0df7701934404192a0a0aa659a806acb)
2011-11-29 10:30:24 +01:00
Stefan Metzmacher
3aa5c979f3 recoverd: try to become the recovery master if we have the capability, but the current master doesn't
metze
(cherry picked from commit 6ba8af28f8a8f79db65120a97d7157dcc5c7e083)

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

(This used to be ctdb commit ccd67cf7f26713e695000d89d9ce8cfa78bfe00f)
2011-11-29 10:28:52 +01:00
Ronnie Sahlberg
b18a22b820 This breaks the build since the recovery loop is different in master
compared to old 1.0 branches
This must have been mistakenly applied to master when you intended to push
for a different branch i guess.

Revert "recoverd: try to become the recovery master if we have the capability, but the current master doesn't"

This reverts commit a97d417aba85e901540147a4dff4794249442939.

(This used to be ctdb commit c19cb751077b78cf4b6e28a1e3746d4ffedbfd68)
2011-11-29 14:38:02 +11:00
Stefan Metzmacher
b02b55bd12 recoverd: try to become the recovery master if we have the capability, but the current master doesn't
metze

(This used to be ctdb commit a97d417aba85e901540147a4dff4794249442939)
2011-11-26 23:47:00 +01:00
Stefan Metzmacher
7a962685d3 recoverd: let async_getcap_callback() also update ctdb->capabilities
metze

(This used to be ctdb commit ef5b47d1183ee99c39ae63045a994d35255ac829)
2011-11-26 23:30:33 +01:00
Michael Adam
edc6067339 vacuum: update (C) from vacuum rewrite
(This used to be ctdb commit a95b524e57b861416f65baef7a0235bf7e394cef)
2011-11-26 01:10:09 +01:00
Michael Adam
0c1e98c9b0 vacuum: write a big and up-to-date explaining comment for ctdb_vacuum_db()
(This used to be ctdb commit 6b9d308985ef2363c62fde6340ad37d56f6d7702)
2011-11-26 00:34:57 +01:00
Michael Adam
a4988be457 vacuum: fix a comment typo in vacuum_traverse()
(This used to be ctdb commit 88ad1e75c686cd47aec18b0a8eb93c3b125f0e97)
2011-11-26 00:34:57 +01:00
Michael Adam
f14b730adb vacuum: fix horrible indentation/whitespacing for ctdb_vacuum_event()
(This used to be ctdb commit 0f070a65a322bd6d3240ca96a9e5c3633ef647bf)
2011-11-26 00:34:57 +01:00
Michael Adam
ac2bf0ebf4 vacuum: fix a comment typo in vacuum_traverse()
(This used to be ctdb commit 39a5c0d8cca4ce5e8bc7055739a6377fb2dc36e0)
2011-11-26 00:34:56 +01:00
Michael Adam
586d8f6883 vacuum: fix an abundance of indentation white spaces in ctdb_vacuum_db()
(This used to be ctdb commit 4ae564e415560cde7e4cd4c5a1d7699f3d49621b)
2011-11-26 00:34:56 +01:00
Michael Adam
018095b64d vacuum: rename "size" to "freelist_size" for clarity
(This used to be ctdb commit 057023f5843c91d1cf8512f3675a01a119ea6157)
2011-11-26 00:34:56 +01:00
Michael Adam
a46e1d9d2c build: add target libctdb.so.0 and symlink libctdb.so
(This used to be ctdb commit 66af6659eaffaeafbfa58779162aabe915d1c50f)
2011-11-26 00:34:56 +01:00
Michael Adam
0f0250c2d0 build: add socket_wrapper objects to test binaries
(This used to be ctdb commit 7d4809ba343114e435830c7c1ab047dc4ce5ff0e)
2011-11-26 00:34:55 +01:00
Michael Adam
0ad39b733a build: add option --enable-socket-wrapper to build binaries with socket wrapper support
(This used to be ctdb commit 8d65d7f399ba2e6a4162eed5e84a58c7cb024187)
2011-11-26 00:34:55 +01:00
Michael Adam
b859e8874c add socket_wrapper from samba
(This used to be ctdb commit 99ce8a9de648babdfb1b1ea0219ee184c9718048)
2011-11-26 00:34:55 +01:00
Andreas Schneider
4b32457822 libutil: Remove obsolete signal type cast.
(This used to be ctdb commit 8dd377b6a4d188af086f9a5b41a1b48e44eda6f3)
2011-11-26 00:34:55 +01:00
Michael Adam
0f807f76c0 build: add libreplace network checks to configure
(This used to be ctdb commit 5e45a176031e973e97450296c28ddfb0a779e00b)
2011-11-26 00:34:54 +01:00
Michael Adam
2c0abf2dcf update lib/replace to current upstream version (samba master)
(This used to be ctdb commit 17bcffab19fdbb435b4745ff90c327342bbbf0f8)
2011-11-26 00:34:54 +01:00
Michael Adam
5d94dff27e system_linux: correctly cast sockaddr_in6 to sockaddr for sendto() in ctdb_sys_send_tcp()
(This used to be ctdb commit 11bebd5367102fcd02b17c44ac87bf50d4c68785)
2011-11-26 00:34:54 +01:00
Michael Adam
d9516a8bf9 system_linux: correctly cast sockaddr_in to sockaddr in ctdb_sys_send_tcp()
(This used to be ctdb commit cc60df5a3edebfdf50fcd22ebfaad35736f90379)
2011-11-26 00:34:54 +01:00
Michael Adam
e931453a22 logging: properly cast sockaddr_in to sockaddr for sendto() in ctdb_syslog_log()
(This used to be ctdb commit 7420d9991e30575219c919ce2a8edce20ad3eb63)
2011-11-26 00:34:53 +01:00
Michael Adam
93016108bd logging: some whitespace cleanup in ctdb_syslog_log()
(This used to be ctdb commit b283be8658d6229314b9265ed8659d2cac573073)
2011-11-26 00:34:53 +01:00
Michael Adam
1bb58697fd logging: properly cast sockaddr_in to sockaddr for bind in start_syslog_daemon()
(This used to be ctdb commit add2506caf3340118be05a21b05dd71b822b1516)
2011-11-26 00:34:53 +01:00
Ronnie Sahlberg
bae2dc9c0e Merge remote branch 'martins/eventscripts'
(This used to be ctdb commit 8959d15804bb5901356d7beec1ecddb1cabbca52)
2011-11-18 15:01:13 +11:00
Ronnie Sahlberg
0e1554e356 Merge remote branch 'martins/scriptstatus'
(This used to be ctdb commit c4ff223096e7dae2e67692825a78c520d30211e0)
2011-11-18 14:46:45 +11:00
Ronnie Sahlberg
446b40ba2c Merge remote branch 'martins/ctdb_control_oom'
(This used to be ctdb commit 6a57c64c58c77fd9dc7c7a1583d402c3ce0313b1)
2011-11-18 14:45:56 +11:00
Ronnie Sahlberg
8017393444 Merge remote branch 'martins/hashinclude'
(This used to be ctdb commit 0f6991010cf4e1f0dd9f39243bcc8fff5dcc0524)
2011-11-18 14:42:10 +11:00
Ronnie Sahlberg
1f9b9bc614 Merge remote branch 'martins/warnings'
(This used to be ctdb commit 58a1e25e1c563ebede57eea2e8f4e2c5785d01bf)
2011-11-18 14:36:45 +11:00
Ronnie Sahlberg
0581fd85e6 Eventscripts: Add special -ECANCELED status for monitor events that are cancelled
When a monitor event is canceled by a higher priority script, make sure we return
status -ECANCELED to the callback in ctdB_monitor.c
Also treat -ECANCELED as a simple "try monitor event again" and skip modifying any HEALTHY/UNHEALTHY flags when this happens

(This used to be ctdb commit a15ec57c26d1bc82af85f74eebae0bd8abde3233)
2011-11-18 12:22:22 +11:00
Martin Schwenke
162ac70f9e Eventscripts - add facility to 10.interface to delete unmanaged IPs
For a number of reasons (delip failure, admin stupidity, ...) an
interface that hosts public addresses can also contain spurious,
unmanaged addresses.

Add functionality to 10.interfaces, controlled by new configuration
variable CTDB_DELETE_UNEXPECTED_IPS, to delete these addresses when
encountered as part of a monitor event.

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

(This used to be ctdb commit 88f88d86b0d08240f749fb721b8c401c2eeb1099)
2011-11-17 16:47:00 +11:00
Martin Schwenke
ba5e5f51cf Eventscripts - remove $0 from error messages in 40.fs_use
The script name is now prepended to output by ctdbd.

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

(This used to be ctdb commit bfa0fe70db195413a6d7a98f46f7a1270aba678c)
2011-11-16 16:26:49 +11:00
Martin Schwenke
9187db869e Eventscripts: Make 40.fs_use use less processes and arguably clearer.
* $fs can be parsed using shell prefix and suffix removal.

* df output can be parsed with a single call to sed.

  Failure is indicated by empty output from sed, so we check for that
  as the error condition, changing the associated message
  appropriately.

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

(This used to be ctdb commit c5ef0d1440f1d952784cc67946c414d149722d01)
2011-11-16 16:26:45 +11:00
Martin Schwenke
ef20fead95 Relax an out of memory message.
The call to ctdb_transport_allocate() can fail for 2 reasons:

* Unable to allocate memory.

* The transport is down, perhaps because CTDB is shutting down.

Either cause will be appropriately logged.

The current use of CTDB_NO_MEMORY_VOID() prints an "out of memory"
message regardless of what happened in ctdb_transport_allocate() and
this could be misleading.

Change this to print a more relaxed message.

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

(This used to be ctdb commit 8c4a93e77c7d7d0cec6b2afd42c22475f1b5ccdc)
2011-11-16 15:46:44 +11:00
Martin Schwenke
3ae8273d86 Make some ctdb_takeover.c functions static
These were intentionally not static so they could be linked to in unit
test programs.  However, using the CCAN-style unit tests where
relevant code is just included, this is no longer necessary.

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

(This used to be ctdb commit d0e9e8554614bd49ffb9ec3509feaa0e80d0f65d)
2011-11-11 14:41:47 +11:00
Martin Schwenke
bbe7cfd28f Tests: change ctdb_takeover_tests.c to include ctdbd code
Do this instead of linking to it.  This means that, after previous
cleanups, we can fix ctdb_takeover.c to use static functions when
appropriate and simply include all the code we need to run tests.

To make this reusable in other tests, new file ctdbd_tests.c does all
of the relevant including.  ctdb_takeover_tests.c just includes that
file.

Test objects built in this way can depend on new Makefile macro
$(CTDB_TEST_C), which contains ctdbd_tests.c and everything it
includes.

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

(This used to be ctdb commit 41869d42194b74db43a176a068e96e411007e5f2)
2011-11-11 14:31:50 +11:00
Martin Schwenke
a2ba5342f5 Rename ctdb_control_get_stat_history() local variable to avoid shadowing.
Local variable stat generates a warning because it shadows a global
declatation, presumably stat(2).  Rename it to s.

This is in the context of wanting to run CCAN-style tests where most
of the ctdbd code is just included in the test program.

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

(This used to be ctdb commit d17efacb3aa6fac61d89f4c88ca17579341c335f)
2011-11-11 14:31:50 +11:00
Martin Schwenke
13653d47a2 Rename ctdb_ctrl_getscriptstatus() parameter to avoid shadowing a global
Rename parameter script_status to scripts to avoid shadowing a global
function with the same name in eventscript.c.

This is in the context of wanting to run CCAN-style tests where most
of the ctdbd code is just included in the test program.

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

(This used to be ctdb commit 668358057c1e6b9bbad7209212f9135c5e6241a0)
2011-11-11 14:31:50 +11:00
Martin Schwenke
ccd79e10bc Rename ctdb_control_destructor() to ctdb_client_control_destructor()
This avoids a name clash with a slightly different function in
ctdb_control.c.

This is in the context of wanting to run CCAN-style tests where most
of the ctdbd code is just included in the test program.

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

(This used to be ctdb commit 82f6108bfbc7e48ca88650297c6a1c6ede0e1c9c)
2011-11-11 14:31:50 +11:00
Martin Schwenke
f186dd90b6 Move some common functions to common/ctdb_ltdb.c
Move identical copies of ctdb_null_func(), ctdb_fetch_func(),
ctdb_fetch_with_header_func() from ctdb_client.c and
ctdb_ltdb_server.c to somewhere common.

This is in the context of wanting to run CCAN-style tests where most
of the ctdbd code is just included in the test program.

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

(This used to be ctdb commit 126cb0d369b2b1aed63801dc4ba0554399e8b7e4)
2011-11-11 14:31:50 +11:00
Martin Schwenke
52ff485958 Added some #ifndefs to stop files being included multiple times.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit fdca12c25e6fce6206135b994dedf44265e4eb09)
2011-11-11 14:31:50 +11:00
Martin Schwenke
bbea7ffdd0 Clean up warnings: rpcgen output contains unused variable.
Grep it out in the Makefile.  This should be very obvious if the
output changes and the grep breaks something.

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

(This used to be ctdb commit 79638bdd884caaf899c1b41984a5f0cf638207b5)
2011-11-11 14:29:36 +11:00
Martin Schwenke
8b6f898ee9 Fix lib/replace
Warnings are generated when compiling strptime.c.  Why is it being
compiled on Linux?  strptime(3) has been in glibc for 15 years!

It turns out that some of the test fragments were being looked for in
lib/replace/test/ and some in lib/replace/tests/.  In addition,
test*/strptime.c was missing.

Move the tests to lib/replace/test/ for consistency with upstream
(Samba) and copy in test/strptime.c from Samba.  Tweak repdir.m4 to
handle the directory rename.

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

(This used to be ctdb commit aaf1ddfc83cf2ede29288baf04a1aa1c69a5cab5)
2011-11-11 14:29:36 +11:00
Martin Schwenke
85a4024651 Clean up warnings: popt sure does some strange things
popt generates 4 compiler warnings with GCC 4.6.  There are 2
different types:

* 3 instances of:

    warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]

  One occurs in the _free() hack that is used to try and avoid a
  compiler warning.  I guess GCC got smarter?  ;-)

  The other is where an array of constant strings is passed to
  execvp(2), which arguably has the wrong type, since it has no need
  to modify the strings.

  Both of these can be worked around by casting to intptr_t before
  casting to the desired argument type.

  In poptReadConfigFile() the variable file is declared to be a
  constant string.  However, it is then passed to read(2) straight
  away and an attempt is made to cast away the "const".  However, to
  protect the value the of file is assigned to (const char *) chptr
  before it is passed to any other functions, so this protects the
  value anyway.  I'm not sure exactly what the thinking was
  here... but there seems to be no use having file be constant.

* 1 instance of:

    warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

  for the result of an execvp(2) call.  Recast the return type to
  void.  However, due to some #if-fu in the function, that can make rc
  unused in this function.  So we also need to wrap the declaration of
  rc in some corresponding #if-fu to make it disappear if not used.

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

(This used to be ctdb commit ac9236e64bd0b61740cc787819a1222bc6a67d4a)
2011-11-11 14:28:30 +11:00
Martin Schwenke
08ebcf6e6a Fix ctdb scriptstatus -n all
This didn't have auto_all set as true.  However, there's no special
code to handle "-n all" and it just fails.  If auto_all works for
status then it might as well work for scriptstatus.

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

(This used to be ctdb commit 3084220e2aac3664511969f10cad206e505150a0)
2011-11-10 15:41:03 +11:00
Martin Schwenke
aa3e368d3c Clean up warnings: add -Wno-format-zero-length to CFLAGS
There's an empty string passed to ctdb_event_script_callback() for
eventscript option arguments in ctdb_start_daemon() and this generates
a warning.

This type of warning seems pointless so let's switch it off.

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

(This used to be ctdb commit 23c164926c5ec4da6d90a5bdcbf2d0100729b451)
2011-11-10 14:10:21 +11:00
Martin Schwenke
954726568c Clean up warnings: -Wunused-but-set-variable in tevent_signal.c
Have sent this upstream to Samba.

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

(This used to be ctdb commit 080edee3d053d770466ebcc976eb1135c80feef8)
2011-11-10 14:08:59 +11:00
Martin Schwenke
c8286b8dc7 Clean up warnings: remove unused function dump_packet()
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit c22e201be15e7d5b788c2f5f7916b553e0faaa2a)
2011-11-09 15:47:30 +11:00
Martin Schwenke
6a74638748 Clean up warnings: remove unused variable alen from scsi_io
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79d31660c7e612f0290fd085203856ad9e70b26f)
2011-11-09 15:37:24 +11:00
Martin Schwenke
ddb0838b7e Clean up warnings: remove set but unused variable from rb_test
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d0244fec8d0dd2abd31a8677e2c2b254b030c47b)
2011-11-09 15:36:09 +11:00