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

2624 Commits

Author SHA1 Message Date
Rusty Russell
4dce0690de eventscript: fix cleanup path when setting up script list
We shouldn't set ctdb->current_monitor until we set destructor: that's
what cleans it up.

Also, free state->scripts on no-scripts exit path: it's not a child of
state because we need it in the destructor.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit 843a2ed5ef85f628788b0caf7417c6b61b5c6d3f)
2009-12-18 12:31:34 +11:00
Stefan Metzmacher
77c4a86351 server: add set_close_on_exec() on more fds
metze

(This used to be ctdb commit 7101ae80bf4e530f48e31e4c58707aa45a9fd3d5)
2009-12-17 14:41:07 +01:00
Stefan Metzmacher
bbfa4402e4 server: fix fd leaks in the new logging code
metze

(This used to be ctdb commit 140070dd81b39545fe2d56f70e9b9c96bfdae07f)
2009-12-17 13:05:39 +01:00
Ronnie Sahlberg
9b507abd6e version 1.0.109
(This used to be ctdb commit 99894a70fe2ebfe43daae7e88ff0fc9cab33e0fb)
2009-12-17 15:49:01 +11:00
Rusty Russell
8aec7e5656 eventscript: remove cb_status, fix uninitialized bug when monitoring aborted
Previously we updated cb_status a each script finished.  Since we're storing
the status anyway, we can calculate it by iterating the scripts array
itself, providing clear and uniform behavior on all code paths.

In particular, this fixes a longstanding bug when we abort monitor
scripts to run some other script: the cb_status was uninitialized.  In
this case, we need to hand *something* to the callback; 0 might make
us go healthy when we shouldn't.  So we use the last status (normally,
this will be the just-saved current status).

In addition, we make the case of failing the first fork for the script
and failing other script forks the same: the error is returned via the
callback and saved for viewing through 'ctdb scriptstatus'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit 5d50f0e16948d18009f6623f132113f7273efc7f)
2009-12-17 15:39:46 +11:00
Ronnie Sahlberg
4c722fe34c fix a conflict in the merge from rusty
Merge commit 'rusty/ctdb-no-setsched'

Conflicts:

	server/ctdb_vacuum.c

(This used to be ctdb commit b4365045797f520a7914afdb69ebd1a8dacfa0d9)
2009-12-17 08:18:04 +11:00
Rusty Russell
af2613e16f ctdb: use mlockall, cautiously
We don't want ctdb stalling due to paging; this can be far worse than
scheduling delays.  But if we simply do mlockall(MCL_FUTURE), it
increases the risk that mmap (ie. tdb open) or malloc will fail,
causing us to abort.

This patch is a compromise: we mlock all current pages (including
10k of future stack for expansion) and then relock when a client
asks us to open a TDB.  We warn, but don't exit, if it fails.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 82f778e85440bc713d3f87c08ddc955d3cfce926)
2009-12-16 20:57:20 +10:30
Rusty Russell
c488ba440a Remove RT priority, use niceness.
1) It's buggy.  Code needs to be carefully written (ie. no busy
   loops) to handle running with it, and we fork and run scripts.[1]

2) It makes debugging harder.  If ctdbd loops (as has happened recently)
   it can be extremely hard to get in and see what's happening.  We've already
   seen the valgrind hacks.

3) We have seen recent scheduler problems.  Perhaps they are unrelated,
   but removing this very unusual setup is unlikely to hurt.

4) It doesn't make anything faster.  Under all but the most perverse of
   circumstances, 99% of the cpu gives the same performance as 100%, and
   we will always preempt normal processes anyway.

[1] I made this worse in 0fafdcb8d353 "eventscript: fork() a child for
    each script" by removing the switch_from_server_to_client() which
    restored it, but even that was only for monitor scripts.  Others were
    run with RT priority.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit 482c302d46e2162d0cf552f8456bc49573ae729d)
2009-12-16 19:26:22 +10:30
Rusty Russell
f148735928 Add --valgringing flag instead of --nosetsched
The do_setsched was being tested for whether to mmap tdbs: let's make it
explicit.  We can also happily move the kill-child eventscript hack under
this flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> 


(This used to be ctdb commit 2ee86cc1f311d7b7504c7b14d142b9c4f6f4b469)
2009-12-16 20:59:15 +10:30
Stefan Metzmacher
4626665b7e doc: regenerate manpages
metze

(This used to be ctdb commit e3825407a509110c786d618efcdfa56ba93380a5)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
fffb9d55b1 doc: fix docbook warnings for ctdb.1 and onnode.1 manpages
metze

(This used to be ctdb commit 0d1300aa2325c94d8fb1c3cf8d454e5eee43dde9)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
b22d893e91 doc/ctdb.1: update example "ctdb listvars" output
metze

(This used to be ctdb commit 33ec6943fb2d01b6df0ce4515d37c671b18d237f)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
685806d47f doc/ctdb.1: make clear the database is specified by name for "ctdb backupdb"
metze

(This used to be ctdb commit 9b4c76973a8cf03ddc1a9b3777a350f739c00892)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
3bfc58d47a doc/ctdb.1: document "ctdb getdbstatus <dbname>"
metze

(This used to be ctdb commit a90f3dd25a22f9b8777ff6946ce1721859e9479a)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
58dd03f43d doc/ctdb.1: add "See also" for ctdb getdbmap
metze

(This used to be ctdb commit bf48ae41ef5fb8e4675be448d13db522465d8d72)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
7809aa9a5d doc/ctdb.1: document "ctdb dumpdbbackup <file>"
metze

(This used to be ctdb commit 8e6b8be51fd1bda789675650a94df0115ee9e238)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
fa6d8641d9 doc/ctdb.1: document -Y output fot ctdb getdbmap
metze

(This used to be ctdb commit c09acd0896089a612ee3a1e78711abd98bd9cc99)
2009-12-16 08:08:34 +01:00
Stefan Metzmacher
0056cec9b4 doc/ctdb.1: document UNHEALTHY for "ctdb getdbmap"
metze

(This used to be ctdb commit 3cdb8be02acc23074c8137a54faea62fee4567a0)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
1634b44c74 doc/ctdb.1: document "ctdb wipedb"
metze

(This used to be ctdb commit fce390194dadb4961b46c706a1826442eef8c63d)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
96977cc5c4 config: add CTDB_MAX_PERSISTENT_CHECK_ERRORS option
metze

(This used to be ctdb commit fc5f556d488488040303438aefecb5ae2a8e54bc)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
0c735f03d4 config: try to use tdbtool <tdb> check instead of tdbdump for persistent db checks
metze

(This used to be ctdb commit 52e6d81f4d8a4035272d9256d01bafb8ed593027)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
a03cf0040b ctdb: print out some hints how to debug a "ctdb catdb" failure
metze

(This used to be ctdb commit 504cf78d00d1120b556124340b9312f890b8b8b9)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
965c000c6e ctdb: add machinereadable output fot "ctdb -Y getdbmap"
metze

(This used to be ctdb commit 45cfcd44093c7d2681e2ffd5cfb402823e8809f4)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
aa07a46bf5 ctdb: disallow "ctdb backupdb" on unhealthy databases
metze

(This used to be ctdb commit ecf799093c1989f5499c9d61ce8cc8a98d759160)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
c4bc231267 client: add "ctdb dumpdbbackup <filename>"
metze

(This used to be ctdb commit c63a0368d9d4b526ac1e49d891d3a1b7b8d20320)
2009-12-16 08:08:33 +01:00
Stefan Metzmacher
aa658b6777 client: make ctdb_dumpdb_record() public
metze

(This used to be ctdb commit 1cdc8dbb9cb971cf6dd6cd22b1adaf70ddc77e65)
2009-12-16 08:08:32 +01:00
Stefan Metzmacher
fb50e08942 tools/ctdb: let "ctdb restoredb" and "ctdb wipedb" mark the db as healthy on all
nodes

metze

(This used to be ctdb commit d1b10b0c0c323c39742a18e98a1dab7e82ddc7be)
2009-12-16 08:08:32 +01:00
Stefan Metzmacher
c56ce3d2f2 tools/ctdb: add "ctdb getdbstatus <dbname>"
metze

(This used to be ctdb commit 910c19f12448d293a755d1eb46d20f9591f8da7a)
2009-12-16 08:08:32 +01:00
Stefan Metzmacher
927dd3d9e5 tools/ctdb: display db health in "ctdb getdbmap"
metze

(This used to be ctdb commit c34535ff4dc6a44909283641596e0ed7c2316fbd)
2009-12-16 08:08:32 +01:00
Stefan Metzmacher
0e436b46c6 client: add ctdb_ctrl_getdbhealth()
metze

(This used to be ctdb commit 5abe44d0113839d3a45c9a31d30856aa70c2ea1f)
2009-12-16 08:08:32 +01:00
Stefan Metzmacher
f1f0af2b67 server: add CTDB_CONTROL_DB_SET_HEALTHY and CTDB_CONTROL_DB_GET_HEALTH
metze

(This used to be ctdb commit 7332d900538f0cbcd953a723417a0fe31dc9807c)
2009-12-16 08:08:29 +01:00
Stefan Metzmacher
94bc40307a server: Use tdb_check to verify persistent tdbs on startup
Depending on --max-persistent-check-errors we allow ctdb
to start with unhealthy persistent databases.

The default is 0 which means to reject a startup with
unhealthy dbs.

The health of the persistent databases is checked after each
recovery. Node monitoring and the "startup" is deferred
until all persistent databases are healthy.

Databases can become healthy automaticly by a completely
HEALTHY node joining the cluster. Or by an administrator
with "ctdb backupdb/restoredb" or "ctdb wipedb".

metze

(This used to be ctdb commit 15f133d5150ed1badb4fef7d644f10cd08a25cb5)
2009-12-16 08:06:10 +01:00
Stefan Metzmacher
9069d3a7fb server: move error handling to a 'fail' label in ctdb_control_transaction_commit()
metze

(This used to be ctdb commit d874463235fa299e83fe562291c688aca3b85cf3)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
8fbb5b7915 server/recovery: update flags on nodes before syncing dbs
metze

(This used to be ctdb commit 49d2dca9ad837e1b397294fb0e966bf0b77f751c)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
b74918b465 server: open /var/ctdb/state/persistent_health.tdb.X on startup
This node internal tdb will store the HEALTH state of persistent
tdbs.

metze

(This used to be ctdb commit cbda4666be88c11a810a192a70667b57f773ace1)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
7f05a423e2 server: create vactune.tdb.X with 0600 permissions
metze

(This used to be ctdb commit 21677ed6fb8c589f348321533c608cad58c4ec93)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
473f02ed48 server: create vactun.tdb.X under /var/ctdb/state
metze

(This used to be ctdb commit 1db17f312558fe59983a3465680e56c9f0c19e36)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
77d43d01aa server: create recdb.tdb.X in /var/ctdb/state/
metze

(This used to be ctdb commit 92e05282d6c4f16e55d914cc3bde3738ea2d44ad)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
9a96ae0c97 server: only do the mkdir() calls for db_directory* once at the start
metze

(This used to be ctdb commit f30f33685db50860b6cd6fd1b6bdc3066620a78f)
2009-12-16 08:03:56 +01:00
Stefan Metzmacher
b48228e7f9 server: add db_directory_state to ctdb_context
metze

(This used to be ctdb commit 656a6ec5ed81ccfbb86144156a3158e48f105ee4)
2009-12-16 08:03:55 +01:00
Stefan Metzmacher
cda5884854 server: create tdbs with 0600 permissions in ctdb_local_attach()
metze

(This used to be ctdb commit 6529a1328b9ec304ad306674651b2a67e4426e23)
2009-12-16 08:03:55 +01:00
Stefan Metzmacher
0c907f4965 config: load 'ctdb' config before 'nfs' config in statd-callout
All other scripts do 'loadconfig ctdb' before any other 'loadconfig foo'
call. I think we should do the same in statd-callout.

Otherwise it's very confusing, if you have configured some Options
in /etc/sysconfig/ctdb, but /etc/ctdb/statd-callout doesn't notice
them.

metze

(This used to be ctdb commit 10d95581fb90bfdf58ec32345c4e36c27acf4f37)
2009-12-16 08:03:55 +01:00
Stefan Metzmacher
003985acfd ctdb: pass TDB_DISALLOW_NESTING to all tdb_open/tdb_wrap_open calls
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 1635e931b909c66eb3b1f5357e3a549b1a0da70d)
2009-12-16 08:03:55 +01:00
Simo Sorce
2d24073e97 Fix release script with newer versins of git
(cherry picked from commit 4334092cba)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 093f57a2c00f2d629a3b58e58202f1a7e1bbd406)
2009-12-16 08:03:54 +01:00
Matthias Dieter Wallnöfer
6e3a572135 tdb tools: Mostly cosmetic adaptions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from samba commit 9776cb0345)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit d1873bd81bfc9f486b88f3a38c65c7de8f5a0909)
2009-12-16 08:03:54 +01:00
Stefan Metzmacher
859ffb09b6 tdb: change version to 1.2.0 after adding TDB_*ALLOW_NESTING
metze
(cherry picked from samba commit 5ca0a4bfd6)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 04aeac728f56c65b973762f09977de1b1b99099e)
2009-12-16 08:03:54 +01:00
Stefan Metzmacher
5cbf0183f3 tdb: add TDB_DISALLOW_NESTING and make TDB_ALLOW_NESTING the default behavior
We need to keep TDB_ALLOW_NESTING as default behavior,
so that existing code continues to work.

However we may change the default together with a major version
number change in future.

metze
(cherry picked from samba commit 3b9f19ed91)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit c1c0ede32dc00ed619d1cf5fda40a9de43995f3a)
2009-12-16 08:03:54 +01:00
Stefan Metzmacher
b768146ef5 tdb: always set tdb->tracefd to -1 to be safe on goto fail
metze
(cherry picked from samba commit 85449b7bcc)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 855391c1e37012b0d6c673a304bb8da8a1efcd72)
2009-12-16 08:03:53 +01:00
Volker Lendecke
e0f59b0a19 tdb: Fix a C++ warning (cherry picked from samba commit be88a126ea)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 6126f04bd4982b66564dcccd92a15baf9cb856f3)
2009-12-16 08:03:53 +01:00
Kirill Smelkov
a96af9815b tdb: update README a bit
While studying tdb, I've noticed a couple of mismatches between readme
and actual code:

- tdb_open_ex changed it's log_fn argument to log_ctx
- there is now no tdb_update(), which it seems was transformed into
  non-exported tdb_update_hash()

There were other mismatches, but I don't remember them now, sorry.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from samba commit 83de5c8263)

Signed-off-by: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 7a88f1df9190674deaf5dcbedad02ae4120a5263)
2009-12-16 08:03:53 +01:00