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

5082 Commits

Author SHA1 Message Date
Michael Adam
d8e110ed7d ctdb-vacuum: fix delete list counts in delete_marshall_traverse_first
when bumping skipped, decrement left, so the sum is correct

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Mar  6 03:32:33 CET 2014 on sn-devel-104
2014-03-06 03:32:33 +01:00
Michael Adam
5b81848e50 ctdb-vacuum: fix possible cause for delelete_list processing counts left records > 0
We need to have left records == 0 at the end of the delete list processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:16 +11:00
Michael Adam
551e9d791c ctdb-vacuum: systematize counters into various structs
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:16 +11:00
Michael Adam
ec3f33c314 ctdb-vacuum: remove unused counter vdata->total
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
49eb503c5d ctdb-vacuum: make ctdb_process_delete_list() void
The overall return code was not really used anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
776d4e88f2 ctdb-vacuum: make ctdb_process_vacuum_fetch_lists() void.
This constantly returns 0 anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
1994870299 ctdb-vacuum: make ctdb_vacuum_traverse_db() void.
Failure in traversal of the DB should not
prevent further processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
7983946680 ctdb-vacuum: don't stop in process_vacuum_fetch_lists when sending to one node fails.
We should try to continue vacuuming as much as possible.
Failure to send records to one lmaster doesn't mean the
others will fail too.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
f3483de240 ctdb-vacuum: catch and log errors to traverse the delete list in ctdb_process_delete_list()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:15 +11:00
Michael Adam
72ea975993 ctdb-vacuum: catch and log error of traverse in ctdb_process_delete_queue()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:14 +11:00
Michael Adam
83fa09e78c ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_marshall_traverse_first()
Spare malloc and free.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:14 +11:00
Michael Adam
974aa73160 ctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_null
we know anyways the record to store is empty at this point.
So skip pointer calculations.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:14 +11:00
Michael Adam
16837bc309 ctdb-vacuum: remove VacuumLimit criterion for triggering a repack
With the new vacuuming, we consider it an error if there are
records left for deletion after processing the various lists.
All records that can be deleted should have been deleted by
tdb_delete calls.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:14 +11:00
Michael Adam
6fdd25008f ctdb-vacuum: treat value 0 of tunable VacuumLimit as turning off repacking
I.e. no number of records found to delete will trigger the
repacking.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:14 +11:00
Michael Adam
1b2fc1f096 ctdb-vacuum: add consistency check for counts at end of process_delete_list()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:13 +11:00
Michael Adam
cf407d208a ctdb-vacuum: log error if records are left for deletion after ctdb_process_delete_list()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:13 +11:00
Michael Adam
23be632449 ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_record_traverse()
Spare malloc and free.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:13 +11:00
Michael Adam
be2f1a0c79 ctdb-vacuum: update comment for ctdb_process_delete_queue
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:13 +11:00
Michael Adam
cd877b6a21 ctdb-vacuum: rename ctdb_vacuum_db_fast --> ctdb_process_delete_queue
This describes more precisely what this does.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:13 +11:00
Michael Adam
c4478bd40d ctdb-vacuum: update comment for ctdb_vacuum_traverse_db
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:12 +11:00
Michael Adam
0309d5eda4 ctdb-vacuum: rename ctdb_vacuum_db_full --> ctdb_vacuum_traverse_db
This describes more precisely what it actually is, nowadays.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:12 +11:00
Michael Adam
ba49deb234 ctdb-vacuum: change full db traverse vacuuming to fill delete queue
This lets the "fast vacuum" delete queue traverse do the actual work.

On the positive side, we note that this lets the "full vacuuming"
treat the records that have never been migrated with data correctly.
These had previously been added to the delete list for complicated
cross-node deletion instead of directly deleting them.

On the other hand side, there might be a slight overhead
since the records are read again in the delete queu traverse,
but this is OK because this change is in preparation of
untangling the db traverse altogether from the vacuum run,
making it independent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:12 +11:00
Michael Adam
d0b7b38825 ctdb-vacuum: run the fast vacuum after the db traverse
This in preparation of modifying the db traverse to
fill the delete_queue that is processed by the fast
vacuum run, instead of filling the same lists as the
fast vacuum run for further processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:12 +11:00
Michael Adam
04c2115b60 ctdb-vacuum: rename private->private_data in repack_traverse
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:12 +11:00
Michael Adam
951efa1097 ctdb-vacuum: rename private->private_data in vacuum_traverse
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:11 +11:00
Michael Adam
01f359cafc ctdb-vacuum: extract check for full vacuum run out of ctdb_vacuum_db_full()
This is more consistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:11 +11:00
Michael Adam
c88fd19714 ctdb-vacuum: add consistency check for counts to ctdb_vacuum_db_fast()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:11 +11:00
Michael Adam
5d5907c7cf ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_queue_traverse()
this spares malloc and free

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:11 +11:00
Michael Adam
fe68b3c494 ctdb-vacuum: simplify delete_record_traverse() - free treats NULL
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:11 +11:00
Michael Adam
593bddf2e8 ctdb-vacuum: simplify delete_queue_traverse() - free treats NULL pointers.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:10 +11:00
Michael Adam
24bec3d31b ctdb-vacuum: reduce indentation in delete_queue_traverse
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:10 +11:00
Michael Adam
48f2d11588 ctdb-vacuum: treat value 0 of tunable RepackLimit as turned off.
I.e. when RepackLimit is set to 0, no size of the freelist
should trigger a repack in vacuuming.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:10 +11:00
Michael Adam
af5568b267 ctdb-vacuum: fix treatment of remaining records and statistics in delete_record_traverse()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:10 +11:00
Michael Adam
b4e0b01a8c ctdb-vacuum: cast freelist_size in comparison.
At this point, it is >= 0 anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:10 +11:00
Michael Adam
6a46a25530 ctdb-vacuum: improve output of delete list statistics
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-03-06 11:31:09 +11:00
Amitay Isaacs
fb2631f5df ctdb-daemon: Do not support connection tracking if there are no public IPs
CTDB tracks connections to be able to send tickle ACKs and gratuitous
ARPs.  When there are no public IPs, there is no need for tickle ACKs
and gratuitous ARPs.

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

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Mar  4 03:01:38 CET 2014 on sn-devel-104
2014-03-04 03:01:38 +01:00
Amitay Isaacs
af3a168ed3 ctdb-util: Do not use mlockall() on AIX
Memory lockdown causes recovery daemon to crash on AIX.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-03-04 01:02:11 +01:00
Amitay Isaacs
44520dcefc ctdb-build: AIX does not have working C99 vsnprintf, requires libreplace
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-03-04 01:02:11 +01:00
Amitay Isaacs
96203d9126 ctdb-build: Remove auto-generated header file in distclean
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-03-04 01:02:11 +01:00
Amitay Isaacs
7d05baa96b ctdb-recoverd: Check if callback function is registered before calling
Fix suggested by by Kevin Osborn <kosborn@overlandstorage.com>.

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

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb 27 13:54:59 CET 2014 on sn-devel-104
2014-02-27 13:54:59 +01:00
Amitay Isaacs
026996550d ctdb-daemon: After updating tickles on other nodes, set update flag to false
tcp_update_flag is set to true whenever tickles are added or deleted.
This flag is used to determine whether or not to send tickles list to
other nodes.  Once tickles list is sent to other nodes successfully,
set tcp_update_flag to false, so ctdbd does not keep sending same tickles
list every TickleUpdateInterval (20 seconds).

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-02-27 11:49:39 +01:00
Martin Schwenke
0723fedced ctdb-daemon: Implement ctdb_control_startup()
This doesn't implement what was recommended.  That would require
careful error handling, probably with a fallback to this code anyway.
This is simple and does no worse that the current code.  That is, the
new node is updated on the next call to tdb_update_tcp_tickles().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-02-27 11:49:39 +01:00
Amitay Isaacs
75ca1216a6 ctdb-daemon: Fix whitespaces
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-02-27 11:49:39 +01:00
Amitay Isaacs
f2cd999189 ctdb-daemon: Always talloc tickle array off vnn instead of ctdb->nodes
This fixes ctdb crash reported in bug #10366.
Fix suggested by Kevin Osborn <kosborn@overlandstorage.com>.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-02-27 11:49:39 +01:00
Martin Schwenke
fcf846a795 ctdb-eventscripts: Switch on dumping of stuck nfsd threads
This feature was added quite a while ago but was not enabled by
default.  It is a useful feature so enable it to dump stack traces of
up to 5 stuck processes by default.

This can be disabled by setting:

  CTDB_NFS_DUMP_STUCK_THREADS=0

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Feb 25 04:06:45 CET 2014 on sn-devel-104
2014-02-25 04:06:45 +01:00
Martin Schwenke
c743fc4345 ctdb-scripts: Update a misleading comment
This comment was true when 50.samba was spaghetti because it tried to
automatically manage both smbd (and nmbd) and winbind.  It isn't true
anymore.

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

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Feb 19 04:07:12 CET 2014 on sn-devel-104
2014-02-19 04:07:12 +01:00
Martin Schwenke
d4298e9e9d ctdb-tests: Improvements to tests INSTALL script
* Should stop on 1st error

* Fix up value of CTDB_TESTS_ARE_INSTALLED

* Improve fixing of broken symlinks in INSTALL

  This is all of the links in tests/eventscript/etc-ctdb/ so no need
  to list them.  Just find and fix them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-02-19 12:04:47 +11:00
Martin Schwenke
24b734f084 ctdb-recoverd: LCP2 cleanups
* Remove unnecessary candimbl parameter.

  This parameter can be cheaply calculated in
  lcp2_failback_candidate().  The compiler will probably do an
  excellent job optimising it.  :-)

* Clarify a debug statement

  This is much clearer than doing a complex recalculation of a known
  value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-02-19 12:04:47 +11:00
Martin Schwenke
9e5ef44f32 ctdb-recoverd: Optimise check for rebalance candidates in LCP2
Currently this can be checked many times.  However, there's no point
calling the rebalance/failback code at all if there are no rebalance
candidates.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-02-19 12:04:47 +11:00
Martin Schwenke
2532149f8f ctdb-scripts: Enhancements to hung script debugging
* Add stack dumps for "interesting" processes that sometimes get
  stuck, so try to print stack traces for them if they appear in the
  pstree output.

* Add new configuration variables CTDB_DEBUG_HUNG_SCRIPT_LOGFILE and
  CTDB_DEBUG_HUNG_SCRIPT_STACKPAT.  These are primarily for testing
  but the latter may be useful for live debugging.

* Load CTDB configuration so that above configuration variables can be
  set/changed without restarting ctdbd.

Add a test that tries to ensure that all of this is working.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-02-19 12:04:47 +11:00