obnox/samba-ctdb.git
14 years ago3.4.2-ctdb-stable: bump vendor patch level to 25 samba-3.4.2-ctdb-stable 3.4.2-ctdb-25
Michael Adam [Mon, 22 Mar 2010 16:50:41 +0000 (17:50 +0100)]
3.4.2-ctdb-stable: bump vendor patch level to 25

14 years agos3: Add "net serverid" command
Volker Lendecke [Tue, 2 Mar 2010 16:02:01 +0000 (17:02 +0100)]
s3: Add "net serverid" command

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

Volker

14 years agos3: Fix a long-standing problem with recycled PIDs
Volker Lendecke [Tue, 2 Mar 2010 16:02:01 +0000 (17:02 +0100)]
s3: Fix a long-standing problem with recycled PIDs

When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker

14 years ago3.4.2-ctdb-stable: bump vendor patch level to 24 3.4.2-ctdb-24
Michael Adam [Mon, 22 Mar 2010 16:50:05 +0000 (17:50 +0100)]
3.4.2-ctdb-stable: bump vendor patch level to 24

14 years agos3: Implement an asynchronous echo responder process
Volker Lendecke [Thu, 18 Mar 2010 11:50:22 +0000 (12:50 +0100)]
s3: Implement an asynchronous echo responder process

This replies to echo requests when the main smbd is stuck somewhere

Signed-off-by: Stefan Metzmacher <metze@samba.org>
14 years agos3:smbd: disable SMB encryption when the echo handler is active
Stefan Metzmacher [Fri, 19 Mar 2010 14:47:11 +0000 (15:47 +0100)]
s3:smbd: disable SMB encryption when the echo handler is active

metze

14 years agos3:smbd: disallow readbraw and writebraw if the echo handler is active
Stefan Metzmacher [Mon, 22 Mar 2010 08:11:05 +0000 (09:11 +0100)]
s3:smbd: disallow readbraw and writebraw if the echo handler is active

metze

14 years agos3:smbd: disable sendfile if the echo handler is active
Stefan Metzmacher [Fri, 19 Mar 2010 11:08:13 +0000 (12:08 +0100)]
s3:smbd: disable sendfile if the echo handler is active

metze

14 years agos3:smbd: don't use recvfile if the echo handler is active
Stefan Metzmacher [Thu, 18 Mar 2010 19:22:26 +0000 (20:22 +0100)]
s3:smbd: don't use recvfile if the echo handler is active

metze

14 years agos3:smbd: setup a shared memory area for the signing state
Stefan Metzmacher [Mon, 22 Mar 2010 08:45:43 +0000 (09:45 +0100)]
s3:smbd: setup a shared memory area for the signing state

metze

14 years agos3:smbd: add echo handler information to struct smbd_server_connection
Stefan Metzmacher [Mon, 22 Mar 2010 08:43:48 +0000 (09:43 +0100)]
s3:smbd: add echo handler information to struct smbd_server_connection

metze

14 years agos3:param: add "async smb echo handler" option
Stefan Metzmacher [Mon, 22 Mar 2010 08:36:41 +0000 (09:36 +0100)]
s3:param: add "async smb echo handler" option

This will enable an extra forked process that will reply
to SMBecho requests, while the main process is blocked by another
request.

metze

14 years agos3:smbd: pass down trusted_channel via receive_smb_talloc()
Stefan Metzmacher [Thu, 18 Mar 2010 14:36:19 +0000 (15:36 +0100)]
s3:smbd: pass down trusted_channel via receive_smb_talloc()

metze

14 years agos3:smbd: let reply_readbraw_error use the locked socket
Stefan Metzmacher [Fri, 19 Mar 2010 11:04:32 +0000 (12:04 +0100)]
s3:smbd: let reply_readbraw_error use the locked socket

metze

14 years agos3:smbd: send keepalive packets under the socket lock
Stefan Metzmacher [Fri, 19 Mar 2010 11:02:27 +0000 (12:02 +0100)]
s3:smbd: send keepalive packets under the socket lock

metze

14 years agos3:smbd: smbd_[un]lock_socket() while accessing the socket to the client
Stefan Metzmacher [Thu, 18 Mar 2010 08:23:48 +0000 (09:23 +0100)]
s3:smbd: smbd_[un]lock_socket() while accessing the socket to the client

metze

14 years agos3:smbd: add smbd_[un]lock_socket() dummies
Stefan Metzmacher [Mon, 22 Mar 2010 08:34:07 +0000 (09:34 +0100)]
s3:smbd: add smbd_[un]lock_socket() dummies

metze

14 years agos3:smbd: add an option to skip signings checks srv_check_sign_mac for trusted channels
Stefan Metzmacher [Mon, 22 Mar 2010 08:31:57 +0000 (09:31 +0100)]
s3:smbd: add an option to skip signings checks srv_check_sign_mac for trusted channels

metze

14 years agos3:libsmb: add a smb_signing_init_ex() function
Stefan Metzmacher [Wed, 17 Mar 2010 14:07:07 +0000 (15:07 +0100)]
s3:libsmb: add a smb_signing_init_ex() function

Make it possible to overload memory handling functions.

metze

14 years agolib/util: add allocate_anonymous_shared()
Stefan Metzmacher [Mon, 22 Mar 2010 08:30:39 +0000 (09:30 +0100)]
lib/util: add allocate_anonymous_shared()

metze

14 years agolib/async_sock: handle queue = NULL in writev_send()
Stefan Metzmacher [Mon, 22 Mar 2010 09:12:42 +0000 (10:12 +0100)]
lib/async_sock: handle queue = NULL in writev_send()

metze

14 years agos3:smbd: use new simplified smb_signing code in the server
Stefan Metzmacher [Mon, 22 Mar 2010 15:04:58 +0000 (16:04 +0100)]
s3:smbd: use new simplified smb_signing code in the server

We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
(cherry picked from commit c16c90a1cb3b0e2ceadd3dea835a4e69acfc2fae)

14 years agos3:libsmb: add a much simplified smb_siging infrastructure
Stefan Metzmacher [Mon, 9 Mar 2009 07:42:05 +0000 (08:42 +0100)]
s3:libsmb: add a much simplified smb_siging infrastructure

It's the job of the caller to maintain the seqnum/mid mapping.

Hopefully we can use this code in s4 later too.

metze
(cherry picked from commit 2654653f55ed5744cc9fca6a79127386f55425e1)

14 years agos3:libsmb: rename smb_signing.c => clisigning.c
Stefan Metzmacher [Sun, 8 Mar 2009 16:47:08 +0000 (17:47 +0100)]
s3:libsmb: rename smb_signing.c => clisigning.c

This prepares a large simplification of the smb_signing code

metze
(cherry picked from commit 1a48d0793b9d3a76aff76580661626e5cd95f427)

14 years agos3:configure: prevent using external libtalloc with version >= 1.4.0
Michael Adam [Fri, 12 Feb 2010 15:46:33 +0000 (16:46 +0100)]
s3:configure: prevent using external libtalloc with version >= 1.4.0

There was an ABI change and this results in an error
"undefined symbol: _talloc_free"

Michael

14 years agos3:configure: Fix typo in libtalloc check.
Karolin Seeger [Tue, 27 Oct 2009 15:29:20 +0000 (16:29 +0100)]
s3:configure: Fix typo in libtalloc check.

Fix bug #6849. Thanks to Mike Frysinger <vapier@gentoo.org> for reporting
and providing the patch!

Karolin
(cherry picked from commit 5897c3de95b8f9fad4e136d2fc1a390fb366b7b9)

14 years agoasync_req: fix compile warning (typename is a C++ reserved word)
Michael Adam [Sat, 23 Jan 2010 00:16:13 +0000 (01:16 +0100)]
async_req: fix compile warning (typename is a C++ reserved word)

14 years agoclikrb5: Prefer krb5_free_keytab_entry_contents to krb5_kt_free_entry.
Jelmer Vernooij [Thu, 4 Jun 2009 21:43:31 +0000 (23:43 +0200)]
clikrb5: Prefer krb5_free_keytab_entry_contents to krb5_kt_free_entry.

Both functions exist in MIT Kerberos >= 1.7, but only
krb5_free_keytab_entry_contents has a prototype.
(cherry picked from commit b65ba0e26c781647e097f3f6fa279c7f3f7f4bd2)

Part of a fix for bug #6918 (Build breaks with krb5-client-1.7-6.1.i586).
(cherry picked from commit 15439ea62c29764207a8ad8b99fac4ce720cf3ad)

14 years agos3: fixed krb5 build problem on ubuntu karmic
Andrew Tridgell [Thu, 15 Oct 2009 23:40:50 +0000 (10:40 +1100)]
s3: fixed krb5 build problem on ubuntu karmic

Karmic has MIT krb5 1.7-beta3, which has the symbol
krb5_auth_con_set_req_cksumtype but no prototype for it.

See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531635
(cherry picked from commit a6e4cb500b4162cae1d906a1762507370b4ee89e)

Part of a fix for bug #6918.
(cherry picked from commit 1c34ec61f968a65709e3672be2ce5a1aa0752470)

14 years agos3: Add the "ctdb locktime warn threshold" parameter
Volker Lendecke [Fri, 5 Mar 2010 15:46:36 +0000 (16:46 +0100)]
s3: Add the "ctdb locktime warn threshold" parameter

This is mainly a debugging aid for post-mortem analysis in case a cluster file
system is slow.

14 years agos3: Add "log writeable files on exit" parameter
Volker Lendecke [Mon, 22 Mar 2010 10:19:10 +0000 (11:19 +0100)]
s3: Add "log writeable files on exit" parameter

This boolean option controls whether at exit time the server dumps a list of
files with debug level 0 that were still open for write. This is an
administrative aid to find the files that were potentially corrupt if the
network connection died.

14 years agos3: file_walk_table -> files_forall
Volker Lendecke [Mon, 22 Mar 2010 08:16:57 +0000 (09:16 +0100)]
s3: file_walk_table -> files_forall

This is more in line with the rest of the Samba code, like connections_forall
etc.

14 years agos3:net: add a command "net registry setsd_sdd"
Michael Adam [Tue, 2 Mar 2010 13:43:53 +0000 (14:43 +0100)]
s3:net: add a command "net registry setsd_sdd"

This permits to set the security descriptor of a registry
key from the unix command line.

Michael
(cherry picked from commit 27ae935a8df409ce7557bd369250fa450120fdfe)
(cherry picked from commit 3648046962a7cce0f9caeef6bd199ab1878bfdc1)

14 years agos3:net: add new subcommand "net registry getsd_sddl" to print secdesc in sddl format
Michael Adam [Fri, 26 Feb 2010 08:37:45 +0000 (09:37 +0100)]
s3:net: add new subcommand "net registry getsd_sddl" to print secdesc in sddl format

Michael
(cherry picked from commit caa27bb165a69766585ec4a13a6c09fa774d3b48)
(cherry picked from commit a885950fbfa049bc9b5474a42940430e1d6d6f6a)

14 years agos3:net: refactor getting of secdesc out of net_registry_getsd()
Michael Adam [Fri, 26 Feb 2010 08:31:03 +0000 (09:31 +0100)]
s3:net: refactor getting of secdesc out of net_registry_getsd()

New net_registry_getsd_internal does the work(),
net_registry_getsd() just prints the result.
This in preparation to add support for other output formats
than the currently used display_sec_desc().

Michael
(cherry picked from commit 9a9a70f62e31e03d427275fabc2f00bb418ffa8d)

14 years agos3:smbcacls: forbid change of debug level from config file
Michael Adam [Tue, 11 Aug 2009 21:35:48 +0000 (23:35 +0200)]
s3:smbcacls: forbid change of debug level from config file

Michael
(cherry picked from commit a038f1e05b8b7acb5e99257e59178e1ece4ce156)
(cherry picked from commit 2a684ee14be97e4d8e4b5a5f9ca59dafa439097f)

14 years agos3:smbcacls: also honour the "--sddl" flag when setting ACLs.
Michael Adam [Mon, 15 Mar 2010 11:16:52 +0000 (12:16 +0100)]
s3:smbcacls: also honour the "--sddl" flag when setting ACLs.

Michael
(cherry picked from commit bd5c0f1b09598d817be854e7df9369a98a3fdf9f)

14 years agos3:smbcacls: add switch "--sddl" to output acls as sddl encoded strings
Michael Adam [Sun, 28 Feb 2010 21:20:03 +0000 (22:20 +0100)]
s3:smbcacls: add switch "--sddl" to output acls as sddl encoded strings
(cherry picked from commit 9cea4d5969d3061689e7399e0a97f7f83ed31976)
(cherry picked from commit 734008358b7df2db2cea9f71a04196cf14223211)

14 years agos3: build sddl.c in samba3
Michael Adam [Sun, 28 Feb 2010 21:15:23 +0000 (22:15 +0100)]
s3: build sddl.c in samba3
(cherry picked from commit 72f4af8cc539674560fe683a7701637f4fac9dfe)

14 years agolibcli/security: fix sddl.c to be able to build it from source3
Michael Adam [Sun, 28 Feb 2010 21:01:49 +0000 (22:01 +0100)]
libcli/security: fix sddl.c to be able to build it from source3
(cherry picked from commit f37030b33afa989adaafa6d3d02751bd286f879b)
(cherry picked from commit 617d711e0b86704b918483a8161410ac1bb80cd8)

14 years agos4:move the sddl code down to the top level
Michael Adam [Fri, 26 Feb 2010 17:32:21 +0000 (18:32 +0100)]
s4:move the sddl code down to the top level

Michael
(cherry picked from commit 8a8e4a620636b098ae56f46be6112d9e68b1c665)

14 years agov3-4-ctdb: Bump ctdb vendor patch level to 23 3.4.2-ctdb-23
Volker Lendecke [Tue, 16 Feb 2010 15:44:58 +0000 (16:44 +0100)]
v3-4-ctdb: Bump ctdb vendor patch level to 23

14 years agos3: Fix timeout calculation if g_lock_lock is given a timeout < 60s
Volker Lendecke [Tue, 16 Feb 2010 14:21:25 +0000 (15:21 +0100)]
s3: Fix timeout calculation if g_lock_lock is given a timeout < 60s

Detected while showing this code to obnox :-)

14 years agos3: Slightly increase parallelism in g_lock
Volker Lendecke [Tue, 16 Feb 2010 11:31:58 +0000 (12:31 +0100)]
s3: Slightly increase parallelism in g_lock

There's no need to still hold the g_lock tdb-level lock while telling the
waiters to retry

14 years agos3: Avoid starving locks when many processes die at the same time
Volker Lendecke [Tue, 16 Feb 2010 11:28:53 +0000 (12:28 +0100)]
s3: Avoid starving locks when many processes die at the same time

In g_lock_unlock we have a little race between the process_exists and
messaging_send call: We only send to 5 waiters now, they all might have died
between us checking their existence and sending the message. This change makes
g_lock_lock retry at least once every minute.

14 years agos3: Avoid a thundering herd in g_lock_unlock
Volker Lendecke [Tue, 16 Feb 2010 11:22:08 +0000 (12:22 +0100)]
s3: Avoid a thundering herd in g_lock_unlock

Only notify the first 5 pending lock waiters. This avoids a thundering herd
problem that is really nasty in a cluster. It also makes acquiring a lock a bit
more FIFO, lock waiters are added to the end of the array.

14 years agos3: Optimize g_lock_lock for a heavily contended case
Volker Lendecke [Mon, 15 Feb 2010 15:57:16 +0000 (16:57 +0100)]
s3: Optimize g_lock_lock for a heavily contended case

Only check the existence of the lock owner in g_lock_parse, check the rest of
the records only when we got the lock successfully. This reduces the load on
process_exists which can involve a network roundtrip in the clustered case.

14 years agos3: Fix handling of processes that died in g_lock
Volker Lendecke [Mon, 15 Feb 2010 15:49:46 +0000 (16:49 +0100)]
s3: Fix handling of processes that died in g_lock

g_lock_parse might have thrown away entries from the locks array because the
processes were not around anymore. Don't store the orphaned entries.

14 years agos3: Fix a typo
Volker Lendecke [Mon, 15 Feb 2010 15:35:06 +0000 (16:35 +0100)]
s3: Fix a typo

14 years agov3-4-ctdb: Bump ctdb vendor patch level to 22 3.4.2-ctdb-22
Volker Lendecke [Wed, 10 Feb 2010 09:21:28 +0000 (10:21 +0100)]
v3-4-ctdb: Bump ctdb vendor patch level to 22

14 years agos3: notify_onelevel does not use seqnums, so don't open asking for it
Volker Lendecke [Fri, 12 Feb 2010 11:06:50 +0000 (12:06 +0100)]
s3: notify_onelevel does not use seqnums, so don't open asking for it

14 years agos3-events: make the old timed events compatible with tevent
Andrew Tridgell [Fri, 5 Feb 2010 03:25:03 +0000 (14:25 +1100)]
s3-events: make the old timed events compatible with tevent

tevent ensures that a timed event is only called once. The old events
code relied on the called handler removing the event itself. If the
handler removed the event after calling a function which invoked the
event loop then the timed event could loop forever.

This change makes the two timed event systems more compatible, by
allowing the handler to free the te if it wants to, but ensuring it is
off the linked list of events before the handler is called, and
ensuring it is freed even if the handler doesn't free it.

14 years agos3-smbd: add a rate limited cleanup of brl, connections and locking db
Andrew Tridgell [Fri, 5 Feb 2010 01:42:06 +0000 (12:42 +1100)]
s3-smbd: add a rate limited cleanup of brl, connections and locking db

On unclean shutdown we can end up with stale entries in the brlock,
connections and locking db. Previously we would do the cleanup on
every unclean exit, but that can cause smbd to be completely
unavailable for several minutes when a large number of child smbd
processes exit.

This adds a rate limited cleanup of the databases, with the default
that cleanup happens at most every 20s

14 years agos3-brlock: we don't need these MSG_SMB_UNLOCK calls now
Andrew Tridgell [Thu, 4 Feb 2010 07:02:52 +0000 (18:02 +1100)]
s3-brlock: we don't need these MSG_SMB_UNLOCK calls now

These have been replaced with the min timeout in blocking.c

14 years agos3-brlock: add a minimim retry time for pending blocking locks
Andrew Tridgell [Sat, 6 Feb 2010 04:59:43 +0000 (20:59 -0800)]
s3-brlock: add a minimim retry time for pending blocking locks

When we are waiting on a pending byte range lock, another smbd might
exit uncleanly, and therefore not notify us of the removal of the
lock, and thus not trigger the lock to be retried.

We coped with this up to now by adding a message_send_all() in the
SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
all smbd processes. That would generate O(N^2) work when a large
number of clients disconnected at once (such as on a network outage),
which could leave the whole system unusable for a very long time (many
minutes, or even longer).

By adding a minimum re-check time for pending byte range locks we
avoid this problem by ensuring that pending locks are retried at a
more regular interval.

14 years agopackaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call
Michael Adam [Tue, 9 Feb 2010 07:00:06 +0000 (08:00 +0100)]
packaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call

Michael

14 years agos3: Add a vfs_time_audit module
Abhidnya P Chirmule [Wed, 6 Jan 2010 18:45:24 +0000 (19:45 +0100)]
s3: Add a vfs_time_audit module

This warns if a file system is slow

14 years agov3-4-ctdb: bump ctdb vendor patch level to 21 3.4.2-ctdb-21
Michael Adam [Mon, 8 Feb 2010 14:49:35 +0000 (15:49 +0100)]
v3-4-ctdb: bump ctdb vendor patch level to 21

14 years agos3:registry: eliminate race condition in creating/scanning sorted subkeys
Michael Adam [Mon, 8 Feb 2010 10:01:47 +0000 (11:01 +0100)]
s3:registry: eliminate race condition in creating/scanning sorted subkeys

Called, from key_exists, scan_sorted_subkeys re-creates the sorted
subkeys record of the given key and then searches through it.
The race is that between creation and parsing of the sorted subkey
record, another process that stores some other subkey of the same
parent key will delete the sorted subkey record, resulting in an
WERR_BADFILE of an operation that should actually succeed.

This patch fixes the issue by wrapping the creation and parsing
into a transaction.

Michael

14 years agov3-4-ctdb: Bump ctdb vendor patch level to 20 3.4.2-ctdb-20
Michael Adam [Wed, 3 Feb 2010 16:16:57 +0000 (17:16 +0100)]
v3-4-ctdb: Bump ctdb vendor patch level to 20

Michael

14 years agos3:make "net conf addshare" atomic by wrapping all writes in one transaction
Michael Adam [Fri, 29 Jan 2010 14:04:25 +0000 (15:04 +0100)]
s3:make "net conf addshare" atomic by wrapping all writes in one transaction

Michael

14 years agov3-4-ctdb: bump the ctdb vendor patch level to 19 3.4.2-ctdb-19
Michael Adam [Mon, 25 Jan 2010 21:41:37 +0000 (22:41 +0100)]
v3-4-ctdb: bump the ctdb vendor patch level to 19

Michael

14 years agos3:g_lock: remove a nested event loop, replacing the inner loop by select
Michael Adam [Sat, 23 Jan 2010 00:17:06 +0000 (01:17 +0100)]
s3:g_lock: remove a nested event loop, replacing the inner loop by select

This made smbd crash in g_lock_lock() when trying to start a
transaction on a db with an already started transaction,
e.g. in a tcon_and_X where the share_info.tdb was not yet
initialized but share_info.tdb was already locked by another
process or writing acces to the winreg rpc pipe where the
registry tdb was already locked by another process.

What we really _want_ to do here by design is to react to
MSG_DBWRAP_G_LOCK_RETRY messages that are either sent
by a client doing g_lock_unlock or by ourselves when
we receive a CTDB_SRVID_SAMBA_NOTIFY or
CTDB_SRVID_RECONFIGURE message from ctdbd, i.e. when
either a client holding a lock or a complete node
has died.

Doing this properly involves calling tevent_loop_once(),
but doing this here with the main ctdbd messaging context
creates a nested event loop when g_lock_lock() is called
from the main event loop.

So as a quick fix, we act a little corasely here: we do
a select on the ctdb connection fd and when it is readable
or we get EINTR, then we retry without actually parsing
any ctdb packages or dispatching messages. This means that
we retry more often than necessary and intended by design,
but this does not harm and it is unobtrusive. When we have
finished, the main loop will pick up all the messages and
ctdb packets. The only extra twist is that we cannot use
timed events here but have to handcode a timeout for select.

Michael

14 years agos3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection
Michael Adam [Fri, 22 Jan 2010 23:05:15 +0000 (00:05 +0100)]
s3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection

Michael

14 years agos3:g_lock: remove an unreached code path.
Michael Adam [Fri, 22 Jan 2010 14:56:28 +0000 (15:56 +0100)]
s3:g_lock: remove an unreached code path.

Michael

14 years agov3-4-ctdb: bump the ctdb vendor patch level to 18. 3.4.2-ctdb-18
Michael Adam [Mon, 18 Jan 2010 12:17:28 +0000 (13:17 +0100)]
v3-4-ctdb: bump the ctdb vendor patch level to 18.

Michael

14 years agos3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__
Michael Adam [Mon, 18 Jan 2010 16:26:04 +0000 (17:26 +0100)]
s3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__

The key for reading and writing was inconsistent due to a
off by one data length.

Michael

14 years agov3-4-ctdb: Do not do any logrotation
Volker Lendecke [Thu, 14 Jan 2010 17:26:01 +0000 (18:26 +0100)]
v3-4-ctdb: Do not do any logrotation

14 years agos3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:53:54 +0000 (23:53 +0100)]
s3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.

This skips update of the __db_sequence_number__ record when nothing else has
been written. There are transactions that are just openend and then nothing
is written until transaction_commit is called. This is for instance the case
with registry initialization routines: They start a transaction and only
write somthing when the registry has not been initialized yet.
So this change will skip many db_seqnum bumps and TRANS3_COMMIT roundtrips.

Michael

14 years agos3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:51:34 +0000 (23:51 +0100)]
s3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.

I carefully prepared the return value only to "return 0;" at the bottom. :-(
This may well have hit us for instance in the nested cancel case
and produced random errors.

Michael

14 years agov3-4-ctdb: bump the ctdb vendor patch level to 17. 3.4.2-ctdb-17
Michael Adam [Thu, 7 Jan 2010 12:59:38 +0000 (13:59 +0100)]
v3-4-ctdb: bump the ctdb vendor patch level to 17.

Michael

14 years agos3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().
Michael Adam [Tue, 5 Jan 2010 23:37:21 +0000 (00:37 +0100)]
s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().

The logic bug was that if a record was found in the marshall buffer,
then always the ctdb header of tha last record in the marshall buffer
was returned, and not the ctdb header of the last occurrence of the
requested record.

This is fixed by introducing an additional temporary variable.

Michael

14 years agos3:dbwrap_ctdb: fix an uninitialized variable.
Michael Adam [Tue, 5 Jan 2010 15:17:27 +0000 (16:17 +0100)]
s3:dbwrap_ctdb: fix an uninitialized variable.

Michael

14 years agov3-4-ctdb: bump the ctdb vendor patch level to 16 3.4.2-ctdb-16
Michael Adam [Thu, 17 Dec 2009 12:42:34 +0000 (13:42 +0100)]
v3-4-ctdb: bump the ctdb vendor patch level to 16

Michael

14 years agos3:dbwrap_ctdb: fix two "may be used uninitialized" warnings
Michael Adam [Fri, 11 Dec 2009 23:38:14 +0000 (00:38 +0100)]
s3:dbwrap_ctdb: fix two "may be used uninitialized" warnings

Michael

14 years agos3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.
Michael Adam [Fri, 11 Dec 2009 23:30:37 +0000 (00:30 +0100)]
s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.

Don't treat this as an error but return seqnum 0 instead.

Michael

14 years agos3:dbwrap: If "-n" is given to dbwrap_torture, open db with CLEAR_IF_FIRST
Volker Lendecke [Fri, 11 Dec 2009 15:51:40 +0000 (16:51 +0100)]
s3:dbwrap: If "-n" is given to dbwrap_torture, open db with CLEAR_IF_FIRST

14 years agos3:build: remove checks for deprecated ctdb controls.
Michael Adam [Fri, 11 Dec 2009 15:45:38 +0000 (16:45 +0100)]
s3:build: remove checks for deprecated ctdb controls.

Michael

14 years agos3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions
Michael Adam [Fri, 11 Dec 2009 13:07:28 +0000 (14:07 +0100)]
s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions

For persistent databases, 64bit integer is kept in a special record
__db_sequence_number__. This record is incremented with each completed
transaction.

The retry mechanism for failing TRANS3_COMMIT controls inside the
db_ctdb_transaction_commit() function now relies one a modified
behaviour of ctdbd's treatment of persistent databases in recoveries.
Recently, a special treatment for persistent databases had been
introduced in ctdb (1.0.108) to work around the problems with the
orinal design of persistent transactions.
Now with the rewrite we need to revert to the old behaviour that
ctdb always takes the newest copies of all records.

This change also paves the way for a next step, which will make
recovery use the db seqnum to tell which node has the newest copy
of a persistent db and use that node's copy. This will greatly
reduce the amount of data transferred with each recovery.

Michael

14 years agos3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.
Michael Adam [Fri, 11 Dec 2009 11:30:57 +0000 (12:30 +0100)]
s3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.

The return values calculated by the callers were wrong anyways since
the new marshalling code does not set the local tdbs tdb error code.

Michael

14 years agos3:dbwrap_ctdb: update (C)
Michael Adam [Fri, 11 Dec 2009 09:35:50 +0000 (10:35 +0100)]
s3:dbwrap_ctdb: update (C)

Michael

14 years agobuild: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.
Michael Adam [Fri, 4 Dec 2009 10:49:21 +0000 (11:49 +0100)]
build: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.

This is the new implementation of ctdb transactions using the
global lock feature. It is needed by the current dbwrap_ctdb code.

Michael

14 years agos3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.
Volker Lendecke [Fri, 11 Dec 2009 14:37:52 +0000 (15:37 +0100)]
s3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.

14 years agos3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)
Michael Adam [Thu, 3 Dec 2009 16:29:54 +0000 (17:29 +0100)]
s3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)

This simplifies the transaction code a lot:

* transaction_start essentially consists of acquiring a global lock.

* No write operations at all are performed on the local database
  until the transaction is committed: Every store operation is just
  going into the marshall buffer.

* The commit operation calls a new simplified TRANS3_COMMIT control
  in ctdb which rolls out thae changes to all nodes including the
  node that is performing the transaction.

Michael

14 years agos3: setup debug for smbtorture
Volker Lendecke [Sun, 6 Dec 2009 23:36:51 +0000 (00:36 +0100)]
s3: setup debug for smbtorture

14 years agos3: Add ctdb_conn_msg_ctx()
Volker Lendecke [Fri, 4 Dec 2009 12:22:30 +0000 (13:22 +0100)]
s3: Add ctdb_conn_msg_ctx()

14 years agos3: Implement global locks in a g_lock tdb
Volker Lendecke [Sun, 25 Oct 2009 15:12:12 +0000 (16:12 +0100)]
s3: Implement global locks in a g_lock tdb

This is the basis to implement global locks in ctdb without depending on a
shared file system. The initial goal is to make ctdb persistent transactions
deterministic without too many timeouts.

14 years agos3: Add tdb_data_equal
Volker Lendecke [Thu, 3 Dec 2009 17:43:49 +0000 (18:43 +0100)]
s3: Add tdb_data_equal

14 years agov3-4-ctdb: Bump the vendor patch level to 15 3.4.2-ctdb-15
Volker Lendecke [Wed, 16 Dec 2009 03:19:15 +0000 (04:19 +0100)]
v3-4-ctdb: Bump the vendor patch level to 15

14 years agos3: Correctly handle timeouts for the ping-dc operation
Volker Lendecke [Wed, 16 Dec 2009 16:22:48 +0000 (17:22 +0100)]
s3: Correctly handle timeouts for the ping-dc operation

When a DC is too slow responding to the logonCtrl operation, we have to
invalidate the connection. Right now we can not recover from that condition
very well.

14 years agos3: Add "net registry getvaluesraw"
Volker Lendecke [Tue, 15 Dec 2009 19:17:01 +0000 (20:17 +0100)]
s3: Add "net registry getvaluesraw"

14 years agostreamline some log levels for invalid servicenames
Christian Ambach [Wed, 2 Dec 2009 19:06:37 +0000 (20:06 +0100)]
streamline some log levels for invalid servicenames

I don't think we need to log the fact that a user gave a wrong sharename in Explorer with the highest log level.
The level of this was not very consistent:
service.c: DEBUG(3,("find_service() failed to find service %s\n", service));
service.c: DEBUG(0,("%s (%s) couldn't find service %s\n",
smb2_tcon.c: DEBUG(1,("smbd_smb2_tree_connect: couldn't find service %s\n",

This changes the last two to 3 as the first one.

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
14 years agov3-4-ctdb: Bump the vendor patch level to 14. 3.4.2-ctdb-14
Michael Adam [Mon, 7 Dec 2009 13:29:11 +0000 (14:29 +0100)]
v3-4-ctdb: Bump the vendor patch level to 14.

Michael

14 years agopackaging(RHEL-CTDB): clean some commented out lines from the files sections
Michael Adam [Mon, 7 Dec 2009 13:27:28 +0000 (14:27 +0100)]
packaging(RHEL-CTDB): clean some commented out lines from the files sections

Michael

14 years agopackaging(RHEL-CTDB): explicitly list library versions in samba-winbind-32bit
Michael Adam [Mon, 7 Dec 2009 13:26:03 +0000 (14:26 +0100)]
packaging(RHEL-CTDB): explicitly list library versions in samba-winbind-32bit

Michael

14 years agopackaging(RHEL-CTDB): explicitly list library versions in samba-common
Michael Adam [Mon, 7 Dec 2009 13:25:32 +0000 (14:25 +0100)]
packaging(RHEL-CTDB): explicitly list library versions in samba-common

Michael

14 years agopackaging(RHEL-CTDB): explicitly list all packaged idmap/nss-info/charset modules
Michael Adam [Mon, 7 Dec 2009 13:20:24 +0000 (14:20 +0100)]
packaging(RHEL-CTDB): explicitly list all packaged idmap/nss-info/charset modules

in the samba-common package.
This is to  better be able to catch regressions or
build problems.

Michael

14 years agopackaging(RHEL-CTDB): explicitly list all the vfs modules in the main package
Michael Adam [Mon, 7 Dec 2009 13:16:15 +0000 (14:16 +0100)]
packaging(RHEL-CTDB): explicitly list all the vfs modules in the main package

Instead of the wildcard list, to better control regressions or
build problems.

Michael

14 years agopackaging(RHEL-CTDB): add some checks to test the built smbd
Michael Adam [Mon, 7 Dec 2009 13:12:05 +0000 (14:12 +0100)]
packaging(RHEL-CTDB): add some checks to test the built smbd

Test whether some required features have been built into smbd.
Can be extended...

Michael

14 years agopackaging(RHEL-CTDB): make everything instead of all in the build stage
Michael Adam [Mon, 7 Dec 2009 13:11:32 +0000 (14:11 +0100)]
packaging(RHEL-CTDB): make everything instead of all in the build stage

Michael