1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

213 Commits

Author SHA1 Message Date
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
Ronnie Sahlberg
0f92fa224c RB_TREE: Add mechanism to abort a traverse
This patch changes the callback signature for traversal
functions to allow a client to abort a traverse before it finishes.
Updates to all callers and examples as well as rb-test tool.

(This used to be ctdb commit 8ab0c63ad36cfbbb1e5fed46a1f4c47b1fdb581f)
2011-11-08 13:40:28 +11: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
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
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
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
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
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
Michael Adam
28fdb00a22 vacuum: Only run full vacuumig (db traverse) every VacuumFastPathCount times.
(This used to be ctdb commit 23b8c8c5fc8604ee0bd6da1f4b5152277eb5f1c0)
2011-03-14 13:35:48 +01:00
Michael Adam
cab1f75db5 vacuum: reset the fast path count in the event handle if it exceeds the limit.
(This used to be ctdb commit 91e6d36a190b1c9e4c8b18f7833e51c5c9a67574)
2011-03-14 13:35:48 +01:00
Michael Adam
f502e5aa98 vacuum: bump the number of fast-path runs in the vacuum child destructor
(This used to be ctdb commit c0668bfe0bb4e69988ae34d875568d08539e6fb9)
2011-03-14 13:35:47 +01:00
Michael Adam
3c4c560019 vacuum: add a fast_path_count to the vacuum_handle.
(This used to be ctdb commit 53a39d0cc5ea251c2189ec8178ccb769fa046c43)
2011-03-14 13:35:47 +01:00
Michael Adam
8395fcc079 vacuum: traverse the delete_queue befor traversing the database.
(This used to be ctdb commit 04c335f9195a5fd83c91a57d06b1e4eaa511844e)
2011-03-14 13:35:47 +01:00
Michael Adam
bb22135f28 vacuum: add delete_queue_traverse() for traversal of the delete_queue.
(This used to be ctdb commit 5eee05c4d256c08f4ee60a1a69efda6844e39729)
2011-03-14 13:35:47 +01:00
Michael Adam
08ab829f0b vacuum: reduce indentation in add_record_to_delete_tree()
This simplyfies the logical structure a bit by using early return.

(This used to be ctdb commit 4d32908fdcec120426536a761e1d0be60f076198)
2011-03-14 13:35:47 +01:00
Michael Adam
6a1857ee70 vacuum: refactor new add_record_to_delete_tree() out of vacuum_traverse().
This will be reused by the traversal of the delete_queue list.

(This used to be ctdb commit 4407e5a7fb045ce56b6d902f7116de663ea648cb)
2011-03-14 13:35:46 +01:00
Michael Adam
d331d7a7b3 vacuum: skip adding records to list of records to send to lmaster on lmaster
This list is skipped afterwards when the lists are processed.

(This used to be ctdb commit e99834c1a2eea60f7f974c0689ae0a65cfe178ff)
2011-03-14 13:35:46 +01:00
Michael Adam
3d7bfc7a3e vacuum: refactor new add_record_to_vacuum_fetch_list() out of vacuum_traverse().
This is the function that fills the list of records to send to each lmaster
with the VACUUM_FETCH message.

This function will be reused in the traverse function for the delete_queue.

(This used to be ctdb commit d4ab790c1f679e833eb97816762fcfcee15ccb10)
2011-03-14 13:35:46 +01:00
Michael Adam
ee593284d5 server: rename ctdb_repack_db() to ctdb_vacuum_and_repack_db()
(This used to be ctdb commit 6c603f85726d2efac9710af7c4875ded2ca7230e)
2011-03-14 13:35:46 +01:00
Michael Adam
6a1cfe82f1 vaccum: clear the fast-path vacuuming delete_queue after creating the vacuuming child.
Maybe we should keep a copy for the case that the vacuuming fails?

(This used to be ctdb commit f19fe5b45748a6998c6950a5b1db7ec2c4468c1c)
2011-03-14 13:35:45 +01:00
Michael Adam
3cb3620acf vacuum: check lmaster against num_nodes instead of vnn_map->size
When lmaster is bigger than the biggest recorded node number,
then exit the traverse with error.

(This used to be ctdb commit 3930c7796b72bbf275bbca8aaeceec3e705a964b)
2011-03-14 13:35:43 +01:00
Michael Adam
dd75ae8c15 vacuum: reduce indentation of the loop sending VACUUM_FETCH controls
This slightly improves the code structure in that loop.

(This used to be ctdb commit bc4990e600c53433a924a0d70e3488a5a6bdc1ff)
2011-03-14 13:35:43 +01:00
Michael Adam
70fa7394fa vacuum: correctly send TRY_DELETE_RECORDS ctrl to all active nodes
Originally, the control was sent to all records in the vnn_map, but
there was something still missing here:
When a node can not become lmaster (via CTDB_CAPABILITY_LMASTER=no)
then it will not be part of the vnn_map. So such a node would
be active but never receive the TRY_DELETE_RECORDS control from a
vacuuming run.

This is fixed in this change by correctly building the list of
active nodes first in the same way that the recovery process does it.

(This used to be ctdb commit 49247df4a47a8a107fa7dd7b187e69e243e6bdbe)
2011-03-14 13:35:43 +01:00
Michael Adam
33b5d9c1a1 vacuum: in ctdb_vacuum_db, fix the length of the array of vacuum fetch lists
This patch fixes segfaults in the vacuum child when at least one
node has been stopped or removed from the cluster:

The size of the vnn_map is only the number of active nodes
(that can be lmaster). But the node numbers that are referenced
by the vnn_map spread over all configured nodes.

Since the array of vacuum fetch lists is referenced by the
key's lmaster's node number later on, the array needs to
be of size num_nodes instad of vnn_map->size.

(This used to be ctdb commit 136508e3f4dd0acc210dde938ad59ef38b63d3a1)
2011-03-11 23:00:51 +01:00
Michael Adam
8d49f4878c Fix typos in a comment in vacuum_traverse.
(This used to be ctdb commit 6a4df8242ee4d095ff03229a168b83bcd84c8a7a)
2011-03-09 21:14:14 +01:00
Ronnie Sahlberg
c4006ce844 Add ctdb_fork(0 which will fork a child process and drop the real-time
scheduler for the child.

Use ctdb_fork() from callers where we dont want the child to be running
at real-time privilege.

(This used to be ctdb commit 58795a4c9e0624e20fa3e0023b65127053edd103)
2011-01-11 07:40:41 +11:00
Ronnie Sahlberg
ef2e8d3c95 If tdb_open() fails when trying to open the vacuuming database,
print errno so we get some idea of why this failed.

(This used to be ctdb commit 3695462ade497356d1b86c6fd1bc1765f1d11e57)
2010-10-14 14:03:19 +11:00
Ronnie Sahlberg
f98ffde65a Dont log a normal vacuuming message about a missing record and using default vacuuming intervals as an error.
This is normal for a new system until the vacuuming has been initialized.

(This used to be ctdb commit ffd5fdd23b1cb07078759a78cd1d884f92aa4851)
2010-10-07 14:40:24 +11:00
Ronnie Sahlberg
2e8aac6689 Merge commit 'rusty/ports-from-1.0.112' into foo
(This used to be ctdb commit 13e58d92f5f1723e850a82ae030d0ca57e89b1ee)
2010-08-19 13:17:56 +10:00
Ronnie Sahlberg
4c05f1900c Merge commit 'rusty/vacuum-fix-master'
(This used to be ctdb commit dc301b324d2c14a2425a965c076113c4fe97903e)
2010-08-19 13:16:35 +10:00
Rusty Russell
9fbb191b78 logging: give a unique logging name to each forked child.
This means we can distinguish which child is logging, esp. via syslog where we have no pid.

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

(This used to be ctdb commit 68b3761a0874429b90731741f0531f76dcfbb081)
2010-08-18 11:46:32 +09:30
Rusty Russell
5f2d43157d vacuum: disabling vacuuming during a freeze
We shouldn't even think about vacuuming when we've frozen the database
(which is earlier than when we set CTDB_RECOVERY_ACTIVE)

CQ:S1018154 & S1018349
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit d8df6835a931082af232c4b94f1dede6f16169f9)
2010-08-18 11:01:52 +09:30
Rusty Russell
0b07f91d36 vacuum: fix crash on vacuum abort
Martin Schwenke discovered that 517f05e42f17766b1e8db8f1f4789cbad968e304
("freeze: abort vacuuming when we're going to freeze.") used ctdb_db for
a logging message which is in fact uninitialized, causing a crash (even
if it wasn't actually logged).

Initialize it properly.  Also fix incorrect format in another logging
message introduced in that same change.

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

(This used to be ctdb commit 8e518950ba281502318d6300f7a5ec6cdf6b5674)
2010-08-18 11:00:11 +09:30
Rusty Russell
af55c910a4 freeze: abort vacuuming when we're going to freeze.
There are some reports of freeze timeouts, and it looks like vacuuming might
be the culprit.  So we add code to tell them to abort when a freeze is
going on.

(This is based on the 1.0.112 branch version 517f05e42f, but far
 simpler since tdb is now robust against processes being killed during
 transaction commit)

CQ:S1018154 & S1018349
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit f5d7dc679501e607c2c83a248a89d3cada9df146)
2010-08-18 10:54:28 +09:30
Rusty Russell
f93440c4b7 event: Update events to latest Samba version 0.9.8
In Samba this is now called "tevent", and while we use the backwards
compatibility wrappers they don't offer EVENT_FD_AUTOCLOSE: that is now
a separate tevent_fd_set_auto_close() function.

This is based on Samba version 7f29f817fa939ef1bbb740584f09e76e2ecd5b06.

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


(This used to be ctdb commit 85e5e760cc91eb3157d3a88996ce474491646726)
2010-08-18 09:16:31 +09:30
Ronnie Sahlberg
761a075de9 rename ctdb_send_message to ctdb_client_send_message to resolve colission with the function of the same name in libctdb
(This used to be ctdb commit ac3292c12832484a22715f1d46aa23f3b7c8a6f6)
2010-06-02 09:45:21 +10:00
Christian Ambach
3cf183ca40 adjust a vacuum log level
made the severity of the decreasing interval log level the same as for the increasing,
they are both just info logs because they don't report errors

(This used to be ctdb commit fde29921f14a815ea68911d758485c9070f4eb2a)
2010-03-11 18:11:57 +11:00
Ronnie Sahlberg
d7c00d8d7e Drop the debug level for logging fd creation to DEBUG_DEBUG
(This used to be ctdb commit eae1d4f9e52e73b4d8769868fffdafa590d03784)
2010-02-04 06:37:41 +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
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
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