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

3553 Commits

Author SHA1 Message Date
Michael Adam
f3066d7fb4 install ltdbtool with "make install"
(This used to be ctdb commit 991ea66e5ed0eb7ab256dc8e3118dc78462d4752)
2011-05-04 14:40:12 +02:00
Michael Adam
c8f803769d build "ltdbtool" in "make all"
(This used to be ctdb commit d91e80c698a7706460e9ee74bd4f5a9ab0a7b9b1)
2011-05-04 14:38:22 +02:00
Gregor Beck
e9eb17fcdd ltdbtool: add manpage html + roff
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 992baa4215bfc1b29fd153ccb7c42bb0cb66fa4f)
2011-05-04 14:38:22 +02:00
Gregor Beck
95d35de8d5 ltdbtool: add manpage
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 2ed3603274cd38dde4ae98eef653e9a9de631eb5)
2011-05-04 14:38:22 +02:00
Gregor Beck
082de99f87 add ltdbtool - a standalone ltdb tool
This this is a tool to handle (dump and convert) ctdb's local tdb
copies (ltdbs) without connecting to a ctdb daemon.

It can be used to

* dump the contents of a ltdb, printing
  the ctdb record header information

* dump a non-clustered tdb database (like tdbdump)

* convert between an ltdb and a non-clustered tdb
  (adding or removing ctdb headers)

* convert between 64 and 32 bit ltdbs
  (the ctdb record headers differ by 4 bytes of padding)

usage: bin/ltdbtool dump [-p] [-s{0|32|64}] <idb>
       bin/ltdbtool convert [-s{0|32|64}] [-o{0|32|64}] <idb> <odb>

Pair-Programmed-With: Michael Adam <obnox@samba.org>

(This used to be ctdb commit efcf2815711cd5371633614fb91273bd0a786da0)
2011-05-04 12:48:50 +02:00
Gregor Beck
14cfbcbef3 ctdb catdb: fix escaping of '"' and '\'
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit 2b5cb0841fd813cd54be170c305a828885e0f038)
2011-05-04 10:07:27 +02:00
Ronnie Sahlberg
f84bd3b5f1 Dont call the UPDATE event if both old and new interface is the same.
CQ S1018175

(This used to be ctdb commit 6a74515f0a1e24d97cee3ba05d89133aac7ad2b7)
2011-05-04 13:29:29 +10:00
Ronnie Sahlberg
ae35e9e5b2 Cleanup of logging messages/spamming
Reduce an infomational message about not performing ip reallocation
from NOTICE(the default) to INFO.
These messages are normal during startup or when stopped/banned when
we will be in recovery mode for a while.

Remove a messager in the loop waiting for initial startup to complete about
the generation being invalid. It is always invalid at this stage before we have
finished initial recovery.

Rate-limit the informational messages for CTDB_WAIT_UNTIL_RECOVERED
so that we only print them once per second for the first 60 seconds and after that only once per 10 minutes.
These messages are normal during startup, but we should not be logging them every second for cases where we will remain in recovery mode during startup for an extended period of time.
Such as if suspended or permabanned.

CQ S1023302

(This used to be ctdb commit 3a0af8780dc595acbed880f288fcbc4f62c862fb)
2011-05-04 10:42:32 +10:00
Ronnie Sahlberg
d97e42183e bonding mode 4 monitoring:
we can not just check if MII Status is up for bonding mode 4, since the kernel will always report the bond device as UP
even if all cables are disconneccted.

For mode 4, ignore the status of the bond device and instead chek if at least one slave interface is up
when determining if the device is good or bad

(This used to be ctdb commit a6930cec6d9503dba18b9d4839d87a1c1a8ddba2)
2011-04-13 09:05:58 +10:00
Ronnie Sahlberg
2f1395ce03 If the eventscript is finished but state->ctdb is NULL,
log an error and return.

(Need to find root cause for this is soo too.)

(This used to be ctdb commit 2e80d53b73fcba58ed5a72bab66c051691ccf719)
2011-04-12 06:36:42 +10:00
Ronnie Sahlberg
c04505724a IFACE handling. Assume links are always good on nstartup (they almost always
Simplify the handling of setting the links in the 10.interface eventscript
and remove the optimization to only call setifacelink on state change
to make the code simpler to read.

If a take ip event fails, flag the node as unhealthy.

Add a check to the interface script to check if the interface exists
or if it has been deleted.
So that we can capture and become UNHELTHY if someone deletes an interface
we are using to host public addresses.

(This used to be ctdb commit 4ab63d2a7262aff30d5eced184c294c9c9dd4974)
2011-04-11 07:40:05 +10:00
David Disseldorp
3b826a6720 web: use the new git repository url on the download page
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit b36818888fac7ebbed26fcdd2dd1d426e3d2f8f0)
2011-04-07 09:56:27 +02:00
Ronnie Sahlberg
55853a4683 NATGW: dont set arp_ignore in 11.natgw anymore since we no longer
need this for the natgw functionality

(This used to be ctdb commit bf3bf2967e3781c918e33b3a210e68e0ccca0c51)
2011-04-06 11:33:11 +10:00
Michael Adam
26ab9c272f packaging: remove the dependency to tdbtool and tdbdump from the spec file
The init script does now check for the availability of tdbdump
and "tdbtool check" and issues warnings if they are not available.
This can remove a dependency loop with building samba RPMs.

(This used to be ctdb commit c7652c4038e012b7ef9bc1da352dd2c02d60dc29)
2011-04-05 13:58:09 +02:00
Michael Adam
c9dc10292e ctdb.init: print a warning when tdbdump is found but tdbtoo or "tdbtool check" is not available
(This used to be ctdb commit afb26e38b617b85cdac14a7cd6dd3c85b8fddbc4)
2011-04-05 13:50:00 +02:00
Michael Adam
faa6d8d7e2 ctdb.init: check for availability of "tdbtool check" and "tdbdump"
Print a warning if neither is available.

(This used to be ctdb commit 4137d2a7d31cdce22847cebfc0239cfe2d8e937c)
2011-04-05 13:43:56 +02:00
Mathieu Parent
a5a6140b7e Correction of spelling errors
* continous -> continuous
* activete  -> activate

(thanks to lintian)

See https://bugzilla.samba.org/show_bug.cgi?id=6935

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

(This used to be ctdb commit fb6987c2f747d6dbf9bb3899a480124d1c242a90)
2011-03-23 00:35:23 +01:00
Ronnie Sahlberg
653c0901d7 This needs more testing first
Revert "ctdbd: call tdb_reopen_all() in freeze child."

This reverts commit 3d9828861c771a060923f3181fa8224e0122bffc.

(This used to be ctdb commit 55c3446c9ba82d24b1d7db92bc3611fd8027b7fb)
2011-03-21 14:25:53 +11:00
Rusty Russell
88c9dec166 ctdbd: call tdb_reopen_all() in freeze child.
In theory, the ctdbd parent shouldn't be holding any locks, but it's a good
idea to always call tdb_reopen_all() after a fork().

(This used to be ctdb commit 3d9828861c771a060923f3181fa8224e0122bffc)
2011-03-21 13:57:53 +11:00
Rusty Russell
435dad05cb ctdbd: fix lock held on error ("ctdb_req_dmaster from non-master.")
We should release the lock on the record before returning; otherwise the
recovery (which tries to freeze the database) will fail.  Symptoms are as
follows:

ctdbd: pnn 15 dmaster request for new-dmaster 19 from non-master 1 real-dmaster=5 key f049c3c8 dbid 0x6cf2837d gen=1148812532 curgen=1148812532 c->rsn=2 header.rsn=15 reqid=2147483585 keyval=0x4f464e49
ctdbd: ctdb_req_dmaster from non-master. Force a recovery.
...
ctdbd: freeze_lock-1:server/ctdb_freeze.c:55 Failed to lock database registry.tdb

CQ:1022545

(This used to be ctdb commit 38b2dbe0605816742e74e2b8a811eaba99c7e12d)
2011-03-21 13:57:40 +11:00
Ronnie Sahlberg
cee8c4be94 Deferred attach: create the timed event as a child context of the da context we want to delete.
Othwervise the da context can be timed out and talloc_free()d
but the event for this already freed object will still trigger,
causing a talloc error and shutdown.

CQ S1022515

(This used to be ctdb commit 2fd27bdedb1e0d6558c07e1b74fc8e70ddf593dc)
2011-03-16 16:08:45 +11:00
Ronnie Sahlberg
f82936402f IP reallocation. If a public address is already hosted on the node when we startup, log a warning message but do not cause the recovery to fail.
CQ S1022356

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

(This used to be ctdb commit 89f8169c24da96c1fdd0ac19b8a1e0e1df01a72a)
2011-03-14 13:35:53 +01:00
Ronnie Sahlberg
1e001d4220 Vacuuming: initialize a variable to avoid a harmless valgrind hit
Signed-off-by: Michael Adam <obnox@samba.org>

(This used to be ctdb commit ad709e99bcad7a4884f2336663d161ba61307ae5)
2011-03-14 13:35:53 +01:00
Ronnie Sahlberg
3cc230b5ee Dont allow clients to connect to databases untile we are well past and through
the initial recovery phase

CQ S1022412

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

(This used to be ctdb commit e02bbd915b7151c615ff64f09ad9abc9720bef7d)
2011-03-14 13:35:53 +01:00
Michael Adam
3e0d4f8f73 vacuum: fix a comment typo
(This used to be ctdb commit a16dc65b4602da5ce2c16578bec2e7882aff240d)
2011-03-14 13:35:52 +01:00
Michael Adam
fe852ca337 vacuum: use insert_record_into_delete_queue in ctdb_local_schedule_for_deletion.
This is to take advantage of the hash collision handling and logging
also in ctdb_local_schedule_for_deletion.

(This used to be ctdb commit 52193b6692091e341ed7a81dbd9a61ae49a8aac5)
2011-03-14 13:35:52 +01:00
Michael Adam
74f65b6ca6 vacuum: refactor insert_record_into_delete_queue out of ctdb_control_schedule_for_deletion
(This used to be ctdb commit be4b63ee18933524f780df5c313447e5ef0786d1)
2011-03-14 13:35:52 +01:00
Michael Adam
dd1a98e76b vacuum: raise a debug level from INFO to DEBUG
when overwriting an existing entry in the delete_queue.

(This used to be ctdb commit f28e636cc4a04ef982672d5f569ad6b6b963db1f)
2011-03-14 13:35:52 +01:00
Michael Adam
e77ed68c1a ctdb_ltdb_store_server: honour the AUTOMATIC record flag
Do not delete empty records that carry this flag but store
them and schedule them for deletetion. Do not store the flag
in the ltdb though, since this is internal only and should not
be visible to the client.

(This used to be ctdb commit f898ff21fa338358179e79381215b13a6bc77c53)
2011-03-14 13:35:51 +01:00
Michael Adam
9c91e16955 ltdb: add the CTDB_REC_FLAG_AUTOMATIC to the initial header in ctdb_ltdb_fetch()
Signals that this record was not created by a client level store.

(This used to be ctdb commit 69d34983a37b0324ff7610b8dfdcd8d13bf81c54)
2011-03-14 13:35:51 +01:00
Michael Adam
827e871ec4 ctdb_private.h: add record flag CTDB_REC_FLAG_AUTOMATIC
This is a flag that shall signa that a record has been automatically generated by ctdb
and not by an explicit client store operation. This will be used in the ctdb_ltdb_fetch
operation which stores an empty record with default initial header before trying to
migrate the record from the dmaster when the record does not exist in the local tdb.

(This used to be ctdb commit 46381a3cb58ccc11422af8f7798c80ea8d72294f)
2011-03-14 13:35:51 +01:00
Michael Adam
6506314c4a ctdb_ltdb_store_server: add ability to send SCHEDULE_FOR_DELETION control to ctdb_ltdb_store.
(This used to be ctdb commit ab2711701999a5ecc23a36b3d9ba8e94f92e4c87)
2011-03-14 13:35:51 +01:00
Michael Adam
1924d0d365 ctdb_ltdb_store_server: Improve debug message in ctdb_ltdb_store when store or delete fails.
(This used to be ctdb commit 2559b2a45eb11834da3b0e0963e24351c8b7477f)
2011-03-14 13:35:51 +01:00
Michael Adam
7088e2144f ctdb_ltdb_store_server: always store the data when ctdb_ltdb_store() is called from the client
This also fixes a segfault since ctdb_lmaster uses the vnn_map.

(This used to be ctdb commit e58c8f51f27e468897af5210b80e5f5f45c3c4bb)
2011-03-14 13:35:51 +01:00
Michael Adam
6384512eb7 ctdb_ltdb_store_server: implement fastpath vacuuming deletion based on VACUUM_MIGRATED flag.
When the record has been obtained by the lmaster as part of the vacuuming-fetch
handler and it is empty and never been migrated with data, then such records
are deleted instead of being stored. These records have automatically been
deleted when leaving the former dmaster, so that they vanish for good when
hitting the lmaster in this way. This will reduces the load on traditional
vacuuming.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit c9b65f3602f51bcbf0e6d82c12076c31e4aebe38)
2011-03-14 13:35:51 +01:00
Michael Adam
7602f9a9af ctdb_ltdb_store_server: delete an empty record that is safe to delete instead of storing locally.
When storing a record that is being migrated off to another node
and has never been migrated with data, then we can safely delete it
from the local tdb instead of storing the record with empty data.

Note: This record is not deleted if we are its lmaster or dmaster.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

(This used to be ctdb commit 3cca0d4b48325d86de2cb0b44bb7811a30701352)
2011-03-14 13:35:50 +01:00
Michael Adam
9e8d6b82b5 server: Use the ctdb_ltdb_store_server() in the ctdb daemon for non-persistent dbs
This is realized by adding a ctdb_ltdb_store_fn function pointer to the db
context and filling it in the attach procedure for non-persistent dbs.

(This used to be ctdb commit df49ec44de80affa5ccc637dec12a20a26e8706e)
2011-03-14 13:35:50 +01:00
Michael Adam
7948be380c server: create a server variant ctdb_ltdb_store_server() of ctdb_ltdb_store().
This is supposed to contain logic for deleting records that are safe
to delete and scheduling records for deletion. It will be called in
server context for non-persistent databases instead of the standard
ctdb_ltdb_store() function.

(This used to be ctdb commit 23631ffc152486aed9ce5b69a391e52bc4947833)
2011-03-14 13:35:50 +01:00
Michael Adam
4cca8876e2 daemon: fill ctdb->ctdbd_pid early
(This used to be ctdb commit 3da1e2e30bf34622f08e6ecd5b8fe55684e5007a)
2011-03-14 13:35:50 +01:00
Michael Adam
670330b331 test: send SCHEDULE_FOR_DELETION control from randrec test.
(This used to be ctdb commit 30aa55b3efc6fbd4078f93da386b6aeb337c1a0c)
2011-03-14 13:35:50 +01:00
Michael Adam
a6b13b21c1 client: add accessor function ctdb_header_from_record_handle().
(This used to be ctdb commit cf57efd440ccc3db381386f4749bfcbf8ac5ecae)
2011-03-14 13:35:50 +01:00
Michael Adam
50bd249990 vacuum: add ctdb_local_schedule_for_deletion()
(This used to be ctdb commit b70bc141d84f7355d2c6c901961b7366db566980)
2011-03-14 13:35:49 +01:00
Michael Adam
8569fcbc83 server: implement a new control SCHEDULE_FOR_DELETION to fill the delete_queue.
(This used to be ctdb commit 680223074e992b32ccf6f42cb80c3fa93074fee7)
2011-03-14 13:35:49 +01:00
Michael Adam
46a05397a4 control: add a new control opcode CTDB_CONTROL_SCHEDULE_FOR_DELETION
(This used to be ctdb commit 4cebfa33db3c7effa087f753530c52b2dd8550e6)
2011-03-14 13:35:49 +01:00
Michael Adam
77d4d156d3 control: add macro CHECK_CONTROL_MIN_DATA_SIZE.
This is for the control dispatcher to check whether the input data has
a required minimum size.

(This used to be ctdb commit 2038e745db33cc5c3b4e2db8a00a57ede03906a2)
2011-03-14 13:35:49 +01:00
Michael Adam
a5cb537745 vacuum: lower level of hash collision debug message to INFO
(This used to be ctdb commit b9bdef46fedfbc543263b67cfee3e896773cd8e8)
2011-03-14 13:35:49 +01:00
Michael Adam
122682be63 vacuum: add statistics output to the fast and full traverse runs.
(This used to be ctdb commit 3addd28aa73883b3b05888e309d19db0eb67eab9)
2011-03-14 13:35:49 +01:00
Michael Adam
e8b08ce702 vacuum: refactor insert_delete_record_data_into_tree() out of add_record_to_delete_tree()
for reuse in filling the delete_queue.

(This used to be ctdb commit 7bbb12695c24da25671f1c39a411295d35870d2c)
2011-03-14 13:35:48 +01:00
Michael Adam
61af2b4a1d vacuum: change all Vacuum*Interval tunables to default to 10
So, by default we have a fastpath vacuuming every 10 seconds and
full blown db-traverse vacuuming once every 10 minutes.

(This used to be ctdb commit 4f0ace982dbb5b4f9c035dbf4cb0ae74cd18d81b)
2011-03-14 13:35:48 +01:00
Michael Adam
c95b4f841b vacuum: disable full db-traverse vacuuming runs when VacuumFastPathCount == 0
(This used to be ctdb commit 571683e7c48aeed8ce41c584d016ced7ff0d2e2d)
2011-03-14 13:35:48 +01:00