1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

190 Commits

Author SHA1 Message Date
Amitay Isaacs
a376ba8b34 ctdb-vacuum: Do not use freeze_mode outside freeze code
If the database is not frozen and recovery mode is not active, then
vacuuming can continue.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-07-25 21:29:42 +02:00
Martin Schwenke
8f73ae03cc ctdb-daemon: Drop the "schedule for deletion" messages to DEBUG level
Thousands of these can be generated each second, rendering INFO level
debugging useless.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-12 19:16:17 +01:00
Christof Schmitt
03b27bd139 ctdb: Use prctl_set_comment from lib/util
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-11-18 04:05:13 +01:00
Amitay Isaacs
f50db5cba5 ctdb-server: Replace ctdb_logging.h with common/logging.h
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-16 00:46:15 +01:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Amitay Isaacs
b99436e425 ctdb-daemon: Rename struct ctdb_rec_data to ctdb_rec_data_old
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-11-04 00:47:14 +01:00
Amitay Isaacs
afc5d8a442 ctdb-daemon: Rename struct ctdb_node_map to ctdb_node_map_old
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-11-04 00:47:14 +01:00
Amitay Isaacs
4647787773 ctdb-daemon: Separate prototypes for common client/server functions
This groups function prototypes for common client/server functions in
common/common.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
01c6c90e98 ctdb-daemon: Remove dependency on includes.h
Instead of includes.h, include the required header files explicitly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
2fdb332fad ctdb-daemon: Stop using tevent compatibility definitions
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
b900adc55c ctdb-daemon: Separate prototypes for system specific functions
This groups function prototypes for system specific functions in
common/system.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-10-30 02:00:27 +01:00
Amitay Isaacs
dbb1958284 ctdb-vacuum: Use non-blocking lock when traversing delete tree
This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-12-05 14:43:07 +01:00
Amitay Isaacs
d35f512cd9 ctdb-vacuum: Use non-blocking lock when traversing delete queue
This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-12-05 14:43:07 +01:00
Amitay Isaacs
e4597f8771 ctdb-vacuum: Stagger vacuuming child processes
This prevents multiple child processes being forked at the same time
for vacuuming TDBs.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-12-05 14:43:07 +01:00
Amitay Isaacs
a0628e317d ctdb-vacuum: Track time for vacuuming in database statistics
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-12-05 14:43:07 +01:00
Martin Schwenke
acf26089f1 ctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystem
This makes it consistent with Samba, to ease transition.

Update unit test code to link to with tdb_wrap instead of including
db_wrap.c.

There are some potential whitespace fixes in this commit that have
been ignored.  CTDB's lib/tdb_wrap will be deleted after the
transition to Samba's lib/tdb_wrap, so there's no point polishing it
too much.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-09-10 01:36:15 +02:00
Martin Schwenke
c1558adeaa ctdb: Use sys_read() and sys_write() to ensure correct signal interaction
... and avoid compiler warnings in some cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-08-21 04:46:13 +02:00
Michael Adam
9d6f187b58 ctdb:vacuum: stop vacuuming when the first delete_list traverse fails.
This indirect caller of delete_marshall_traverse was missed
in fa4a81c86b
which lets failure of the second travers fail the vacuum run.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-07-23 15:11:15 +02:00
Amitay Isaacs
f87b7f664f ctdb-vacuum: Use existing function ctdb_marshall_finish
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul 23 09:44:00 CEST 2014 on sn-devel-104
2014-07-23 09:44:00 +02:00
Amitay Isaacs
6edc4f23e9 ctdb-vacuum: Use ctdb_marshall_add to add a record to marshall buffer
This avoids duplicate code and extra talloc in ctdb_marshall_record.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-23 07:18:11 +02:00
Amitay Isaacs
fa4a81c86b ctdb-vacuum: If talloc_realloc fails, terminate traverse
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-23 07:18:11 +02:00
Amitay Isaacs
9a4a9ccda3 ctdb-vacuum: Fix talloc hierarchy in delete_marshall_traverse
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-23 07:18:11 +02:00
Michael Adam
5334881afa ctdb:vacuum: always run freelist_size again
and not only if repack_limit != 0. This partially reverts
commit 48f2d11588.

With the new tdb code this defragments the
free list by merging adjacent records.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
026d79cb00 ctdb:vacuum: add missing return to ctdb_vacuum_traverse_db() error path.
This got lost in commit 1994870299
("ctdb-vacuum: make ctdb_vacuum_traverse_db() void.")

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
b8658b3959 ctdb:vacuum: remove now unused talloc ctx argument from ctdb_vacuum_db()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
c3cb8c277a ctdb:vacuum: move init of vdata into init_vdata funcion
This is a small code cleanup.
vdata is only used in ctdb_vacuum_db() and not in
ctdb_vacuum_and_repack_db() where it is currently initialized.

This patch moves creation and all previously scattered
initialization of vacuum_data into ctdb_vacuum_init_vacuum_data
which is called from ctdb_vacuum_db.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
3cf018935e ctdb:vacuum: remove vacuum limit from vdata - not used
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
a99035a4c5 ctdb:vacuum: remove a superfluous comment.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
385e2236fb ctdb:vacuum: untangle assignmend and check for return of tdb_repack()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
e0a11369cf ctdb:vacuum: remove a superfluous and misleading comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
413f99f86e ctdb:vacuum: remove now unused ctdb_repack_tdb().
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
368683d7af ctdb:vacuum: use plain tdb_repack() instead of ctdb_repack_tdb()
Since we usually have 0 records left for repack-deletion,
repacking is essentially used for the purpose of defragmenting
the freelist, we can use the vanilla tdb_repack function.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
ec2f1abe48 ctdb:vacuum: remove a comment in ctdb_vacuum_and_repack_db()
The repack operation now mainly defragments the freelist
and does not usually delete any records any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
Michael Adam
67e5746b23 ctdb:vacuum: adapt debug message for repacking.
Now we usually have records to delete == 0 after the preceding
vacuum run. Anyways, deletion is not a major aspect any more
of the repack run and will vanish soon.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-17 09:33:10 +02:00
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