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

3342 Commits

Author SHA1 Message Date
Ronnie Sahlberg
f7febd28af dont stop checking interfaces after the first bond device
continue the loop to process all other interfaces too

(This used to be ctdb commit 500ade4e6a58ea786a665f6be7cf30f43c882570)
2010-10-09 10:55:43 +11:00
Ronnie Sahlberg
51a38dc4a4 Spotted by rusty.
Add a missing $
so we delete $_ip   and not _ip

(This used to be ctdb commit e9d04c5f419eaa0338a3beefba32c52be00242a8)
2010-10-08 15:53:36 +11:00
Ronnie Sahlberg
6a7ecb7f42 change the hash function to use the much better Jenkins hash
from the tdb library

cq S1020233

(This used to be ctdb commit f7e91ae905cd61249028e15f2cb509ea69f10b9e)
2010-10-08 13:18:18 +11:00
Ronnie Sahlberg
8bdaa7d41f Merge commit 'rusty/tdb-update'
(This used to be ctdb commit 23510bf858c06a3710d1cc741d32bad3675fd97e)
2010-10-08 12:49:08 +11:00
Rusty Russell
7253342a70 idtree: fix right shift of signed ints, crash on large ids on AIX
Right-shifting signed integers in undefined; indeed it seems that on
AIX with their compiler, doing a 30-bit shift on (INT_MAX-200) gives
0, not 1 as we might expect.

The obvious fix is to make id and oid unsigned: l (level count) is also
logically unsigned.

(Note: Samba doesn't generally get to ids > 1 billion, but ctdb does)

Reported-by: Chris Cowan <cc@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@samba.org>
Autobuild-Date: Wed Oct  6 08:31:09 UTC 2010 on sn-devel-104

(This used to be ctdb commit 90b7e79446f06990f82c0128b2581e15497094fe)
2010-10-08 12:30:19 +11:00
Ronnie Sahlberg
d0054d383d get rid of the "ctdb setflags" command since
1, we dont need it
2, it uses the ugly "modify flags" control that should die

(This used to be ctdb commit 25f96db966230e90291eee57841c9faaae33713b)
2010-10-07 16:19:24 +11:00
Rusty Russell
c333126496 idtree: fix right shift of signed ints, crash on large ids on AIX
Right-shifting signed integers in undefined; indeed it seems that on
AIX with their compiler, doing a 30-bit shift on (INT_MAX-200) gives
0, not 1 as we might expect.

The obvious fix is to make id and oid unsigned: l (level count) is also
logically unsigned.

(Note: Samba doesn't generally get to ids > 1 billion, but ctdb does)

Reported-by: Chris Cowan <cc@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@samba.org>
Autobuild-Date: Wed Oct  6 08:31:09 UTC 2010 on sn-devel-104

(This used to be ctdb commit 53d49df2d4519c35b270c30660e2504af2a5ed5c)
2010-10-07 15:24:46 +10:30
Jelmer Vernooij
f6e29e22f4 pytdb: Add __version__ attribute.
(This used to be ctdb commit 2b81314eb94d31f4efadd2a3dcf2f6e176338d3f)
2010-10-07 15:18:51 +10:30
Jelmer Vernooij
d8d8778aaf pytdb: Include Python.h first to prevent warning.
(This used to be ctdb commit 247dacde0d0de1358cc2c27d08914be605272023)
2010-10-07 15:18:30 +10:30
Kirill Smelkov
5f2bb5c83a pytdb: Check errors after PyObject_New() calls
The call could fail with e.g. MemoryError, and we'll dereference NULL
pointer without checking.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit 09369aa86e233a58ed131fa5b7584b6c86527d40)
2010-10-07 15:18:29 +10:30
Kirill Smelkov
30219892d0 pytdb: Add support for tdb_repack()
Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit ce84abcc6be31554da73920280e6bfc5b63b1464)
2010-10-07 15:18:27 +10:30
Kirill Smelkov
8270f9bd4f pytdb: Add TDB_INCOMPATIBLE_HASH open flag
In 2dcf76 Rusty added TDB_INCOMPATIBLE_HASH open flag which selects
Jenkins lookup3 hash for new databases.

Expose this flag to python users too.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit 07880810941850e81442b888cd70d810d3f80fc3)
2010-10-07 15:18:25 +10:30
Rusty Russell
ac90f15424 tdb: fix non-WAF build, commit 1.2.6 ABI file.
Sorry Jeremy.

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

(This used to be ctdb commit 7db9838cb5af0d334efbbcb96bfa51d19b35941a)
2010-10-07 15:17:43 +10:30
Rusty Russell
74b2eacede tdb: TDB_INCOMPATIBLE_HASH, to allow safe changing of default hash.
This flag to tdb_open/tdb_open_ex effects creation of a new database:
1) Uses the Jenkins lookup3 hash instead of the old gdbm hash if none is
   specified,
2) Places a non-zero field in header->rwlocks, so older versions of TDB will
   refuse to open it.

This means that the caller (ie Samba) can set this flag to safely
change the hash function.  Versions of TDB from this one on will either
use the correct hash or refuse to open (if a different hash is specified).
Older TDB versions will see the nonzero rwlocks field and refuse to open
it under any conditions.

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

(This used to be ctdb commit dd86b24ae5307fe09d4ae22b7070d747013a2b07)
2010-10-07 15:17:38 +10:30
Rusty Russell
6a4c5c8e71 tdb: automatically identify Jenkins hash tdbs
If the caller to tdb_open_ex() doesn't specify a hash, and tdb_old_hash
doesn't match, try tdb_jenkins_hash.

This was Metze's idea: it makes life simpler, especially with the upcoming
TDB_INCOMPATIBLE_HASH flag.

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

(This used to be ctdb commit 3f7ed2b46cb304d553d3f7bd34554d695b8ccc52)
2010-10-07 15:17:18 +10:30
Rusty Russell
9faf6888d4 tdb: add Bob Jenkins lookup3 hash as helper hash.
This is a better hash than the default: shipping it with tdb makes it easy
for callers to use it as the hash by passing it to tdb_open_ex().

This version taken from CCAN and modified, which took it from
http://www.burtleburtle.net/bob/c/lookup3.c.

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

(This used to be ctdb commit 58c9d90c758aa7c062d84ab97f62947190526356)
2010-10-07 15:17:05 +10:30
Volker Lendecke
140592fe13 tdb: add restore
Based on an idea by Simon McVittie, largely rewritten

(This used to be ctdb commit 7cda5507f90d7598d745a1acfc66c2afa73cd4b5)
2010-10-07 15:15:45 +10:30
Günther Deschner
1cd12ba7f0 lib/tdb: fix c++ build warning in tdb_header_hash().
Guenther

(This used to be ctdb commit e34e639c214b010ff18140b769a8c9245c92006f)
2010-10-07 15:11:53 +10:30
Jelmer Vernooij
4892ad57de pytdb: Make filename argument optional.
(This used to be ctdb commit 3cc73c51caff51e0cba688aefd6f37e632c0e8d4)
2010-10-07 15:11:48 +10:30
Kirill Smelkov
665b3fbaa7 pytdb: Add support for tdb_freelist_size()
Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit dcdd83e6d6786f0857acdf9aa04bca74a7ccf14d)
2010-10-07 15:11:26 +10:30
Kirill Smelkov
f1a720f08f pytdb: Add support for tdb_transaction_prepare_commit()
Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit fd16bcc1434841d84fdf78f80163c97c0b52b3fe)
2010-10-07 15:11:24 +10:30
Kirill Smelkov
7b88df14e0 pytdb: Add support for tdb_enable_seqnum, tdb_get_seqnum and tdb_increment_seqnum_nonblock
Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit 1778fd02eec6e64737167c46173c0c76c85cc4d9)
2010-10-07 15:11:23 +10:30
Kirill Smelkov
2473345d46 pytdb: Update open flags to match those for tdb_open() in tdb.h
Namely TDB_NOSYNC, TDB_SEQNUM, TDB_VOLATILE, TDB_ALLOW_NESTING and
TDB_DISALLOW_NESTING were missing.

Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit d0c28ff1fedd27a99a7550fcc74e18cb1f536986)
2010-10-07 15:11:21 +10:30
Kirill Smelkov
95386b0283 pytdb: Fix repr segfault for internal db
The problem was tdb->name is NULL for TDB_INTERNAL databases, and
so it was crashing ...

    #0  0xb76944f3 in strlen () from /lib/i686/cmov/libc.so.6
    #1  0x0809862b in PyString_FromFormatV (format=0xb72b6a26 "Tdb('%s')", vargs=0xbfc26a94 "")
        at ../Objects/stringobject.c:211
    #2  0x08098888 in PyString_FromFormat (format=0xb72b6a26 "Tdb('%s')") at ../Objects/stringobject.c:358
    #3  0xb72b65f2 in tdb_object_repr (self=0xb759e060) at ./pytdb.c:439

Cc: 597089@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit 3ff413baf04ce28eb54a80141250ae1284b2a521)
2010-10-07 15:11:14 +10:30
Kirill Smelkov
7c72d220b5 pytdb: Add support for tdb_add_flags() & tdb_remove_flags()
Note, unlike tdb_open where flags is `int', tdb_{add,remove}_flags want
flags as `unsigned', so instead of "i" I used "I" in PyArg_ParseTuple.

Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

(This used to be ctdb commit 7389f8a8a634c2fe0f068831326d92e6bfa0d046)
2010-10-07 15:08:13 +10:30
Andrew Tridgell
bf8dfcfe7d tdb: added TDB_NO_FSYNC env variable
this might help reduce test times and load on test machines

(This used to be ctdb commit 5c4240c364c52073ca64fddf2aa2c1593db0093b)
2010-10-07 15:08:04 +10:30
Rusty Russell
bc2094c9ca tdb: increment version to 1.2.4
(This used to be ctdb commit f1c06608245ec34493c330d891e04c250ad64b20)
2010-10-07 15:07:22 +10:30
Rusty Russell
fc47015894 tdb: put example hashes into header, so we notice incorrect hash_fn.
This is Stefan Metzmacher <metze@samba.org>'s patch with minor changes:
1) Use the TDB_MAGIC constant so both hashes aren't of strings.
2) Check the hash in tdb_check (paranoia, really).
3) Additional check in the (unlikely!) case where both examples hash to 0.
4) Cosmetic changes to var names and complaint message.

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

(This used to be ctdb commit 63c582c99128c3623e270e8425966cab7744fb2f)
2010-10-07 15:05:59 +10:30
Rusty Russell
ef329186d6 tdb: fix tdb_check() on other-endian tdbs.
We must not endian-convert the magic string, just the rest.

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

(This used to be ctdb commit 525390863ad39acea08ceb88531dc59d118fcad4)
2010-10-07 15:05:58 +10:30
Rusty Russell
05da60f770 tdb: fix tdb_check() on read-only TDBs to actually work.
Commit bc1c82ea13 "Fix tdb_check() to work with read-only tdb databases."
claimed to do this, but tdb_lockall_read() fails on read-only databases.

Also make sure we can still do tdb_check() inside a transaction (weird,
but we previously allowed it so don't break the API).

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

(This used to be ctdb commit 2558eb250011893d09dbeaedaffeefa0e397142f)
2010-10-07 15:05:56 +10:30
Rusty Russell
3bd7dd8bd8 tdb: make check more robust against recovery failures.
We can end up with dead areas when we die during transaction commit;
tdb_check() fails on such a (valid) database.

This is particularly noticable now we no longer truncate on recovery;
if the recovery area was at the end of the file we used to remove it
that way.

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

(This used to be ctdb commit b4162a95ff9ae28cda8d9c76c51c9480104517a7)
2010-10-07 15:05:55 +10:30
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
b67754fa4d when printing machinereadable statistics only print the header with the fieldnames once
(This used to be ctdb commit 70c8d429d7c13cbbd08184ff8f0aa506de5adccc)
2010-09-30 15:08:12 +10:00
Ronnie Sahlberg
1a716ec300 add a machinereadable version of ctdb stats/statistics
(This used to be ctdb commit 3a033156c48d821d48fd18f12c3b0ac14bbddc93)
2010-09-30 15:01:08 +10:00
Ronnie Sahlberg
3ba7ac13eb Create a tunable for how often to collect rolling statistics and initialize it to 1 second
(This used to be ctdb commit cb8c779bb5d9862abbe08919aa181a1a1b2bef18)
2010-09-30 15:00:57 +10:00
Ronnie Sahlberg
9f66a93f12 Add rolling statistics that are collected across 10 second intervals.
Add a new command "ctdb stats [num]" that prints the [num] most recent statistics intervals collected.

(This used to be ctdb commit e6e16fcd5a45ebd3739a8160c8fb5f44494edb9e)
2010-09-29 12:14:45 +10:00
Ronnie Sahlberg
41b6e09fb1 Add a new statistics structure to keep the current running statistics
(This used to be ctdb commit 09e5a2fb47c312f71f455cdbf8d9cabcca1041a4)
2010-09-29 12:14:35 +10:00
Ronnie Sahlberg
39c367a68f Create macros to update the statistics counters and use these macros
everywhere instead of manipulating the coutenrs directly.

(This used to be ctdb commit 2e648df890e5713bc575965d87937827b068d0d7)
2010-09-29 12:14:24 +10:00
Ronnie Sahlberg
869242a7cd Add back monitoring for time skips, forward as well as backward.
This serviceability tool was lost during the migration from the old eventsystem to the tevent system.

(This used to be ctdb commit b4c00b4ac30ec215629f44f802ce9660abcd7a48)
2010-09-28 08:59:35 +10:00
Ronnie Sahlberg
107d020cfa update/improve the log message related to rerecovery timeouts
(This used to be ctdb commit 8b4d1df3abcae03cf7a339d8390c816682a43019)
2010-09-28 08:47:12 +10:00
Ronnie Sahlberg
c6e20a06c7 set up a handler to catch and log debug messages from the tevent layer
(This used to be ctdb commit fdb4c02f595fa207310a9a48da3fefd653fa9e4b)
2010-09-28 08:30:26 +10:00
Ronnie Sahlberg
22ea35f17d adda GETPUBLICIPS control to libctdb and use this in the test example
enhance the test example to show the new releaseip/takeip messages

(This used to be ctdb commit 21cc57883e6c02b0e037211b26d1d866d5d7f03d)
2010-09-15 14:58:11 +10:00
Stefan Metzmacher
0b5bd411ca server/banning: also release all ips if we're banning ourself
metze

(This used to be ctdb commit c386f2c62f06f1c60047b7d4b1ec7a9eec11873c)
2010-09-14 15:50:31 +10:00
Stefan Metzmacher
5e46150490 server/recoverd: if we can't get the recovery lock, ban ourself
metze

(This used to be ctdb commit 80b8889267339b870868841ff077e850bc5b52e2)
2010-09-14 15:49:01 +10:00
Stefan Metzmacher
ff77985f38 server/recoverd: do takeover_run after verifying the reclock file
metze

(This used to be ctdb commit 93df096773c89f21f77b3bcf9aa90bf28881b852)
2010-09-14 15:48:37 +10:00
Stefan Metzmacher
96ddf2f607 server/monitor: ask for a takeoverrun after propagating our new flags
metze

(This used to be ctdb commit 942f44123350d4d0c4ad7f3fcd5ff2d0d175739b)
2010-09-14 15:48:10 +10:00
Ronnie Sahlberg
d8d8b9e1d7 add a new serverid to send a message everytime an ip address is taken on the local node
(This used to be ctdb commit 1261f3d9702800a4e59550c881350daf479f00ef)
2010-09-13 15:43:19 +10:00
Ronnie Sahlberg
991a6ae2a0 Update the comment for the range reserved for SAMBA and
define a new symbol to represent this range similarly to NFSD and ISCSID

Keep the old symbol name to be backward compatible with software using
these headers.

(This used to be ctdb commit 2ce34e50d057ba95249117a581658a5ad7e8eb60)
2010-09-13 15:10:36 +10:00
Ronnie Sahlberg
09a08b0da3 define and reserve a range of ctdb message ports for use by nfs and iscsi servers
(This used to be ctdb commit 84a44ac8ee74dd7af15e378c6cafbedb95feec60)
2010-09-13 15:10:24 +10:00
Ronnie Sahlberg
65382a59d1 Add two new server types to the server_id structure.
NFSD and ISCSID for now.

(This used to be ctdb commit 4cd4bab68f0ba0305a585a2aabcb6871cdb11d96)
2010-09-13 15:10:12 +10:00