obnox/samba-ctdb.git
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

14 years agos3:build: fix detection of CTDB headers on systems without system-libtalloc
Michael Adam [Tue, 1 Dec 2009 14:22:20 +0000 (15:22 +0100)]
s3:build: fix detection of CTDB headers on systems without system-libtalloc

Michael

14 years agopackaging(RHEL-CTDB): package dbwrap_tool and dbwrap_torture in the common pkg
Michael Adam [Fri, 4 Dec 2009 22:29:22 +0000 (23:29 +0100)]
packaging(RHEL-CTDB): package dbwrap_tool and dbwrap_torture in the common pkg

Michael

14 years agos3:dbwrap_ctdb: increase the number of commit retries 5-->100
Michael Adam [Fri, 4 Dec 2009 13:53:05 +0000 (14:53 +0100)]
s3:dbwrap_ctdb: increase the number of commit retries 5-->100

This is to cope with timeouts when recoveries and transactions collide.
Maybe 100 is too hight, but 10 or even 20 have been too low in a
very busy environment.

Michael

14 years agos3:dbwrap_ctdb: increase the rsn of the __transaction_lock__ when storing
Michael Adam [Fri, 4 Dec 2009 13:49:53 +0000 (14:49 +0100)]
s3:dbwrap_ctdb: increase the rsn of the __transaction_lock__ when storing

so that it is correctly handled by recoveries.
Also set the dmaster explicitly.

Michael

14 years agos3: Fix the code to immediately disconnect from a non-working ctdbd
Volker Lendecke [Thu, 3 Dec 2009 00:55:52 +0000 (01:55 +0100)]
s3: Fix the code to immediately disconnect from a non-working ctdbd

14 years agoAdd a low-cost alternative to wbinfo -t: winfo --ping-dc
Volker Lendecke [Tue, 1 Dec 2009 10:45:03 +0000 (11:45 +0100)]
Add a low-cost alternative to wbinfo -t: winfo --ping-dc

14 years agoFix bug #6898 - Samba duplicates file content on appending. Move posix case semantics...
Jeremy Allison [Tue, 24 Nov 2009 03:19:07 +0000 (19:19 -0800)]
Fix bug #6898 - Samba duplicates file content on appending. Move posix case semantics out from under the VFS. Jeremy.

14 years agov3-4-ctdb: bump ctdb vendor patch level to 13 3.4.2-ctdb-13
Michael Adam [Mon, 30 Nov 2009 13:52:53 +0000 (14:52 +0100)]
v3-4-ctdb: bump ctdb vendor patch level to 13

Michael

14 years agos3: Do not connect to ctdb if it is blocked for some reason
Volker Lendecke [Mon, 16 Nov 2009 11:03:24 +0000 (12:03 +0100)]
s3: Do not connect to ctdb if it is blocked for some reason

14 years agos3: Fix the winbind piece of 58045: Correctly time out client smb requests
Volker Lendecke [Thu, 26 Nov 2009 16:58:01 +0000 (17:58 +0100)]
s3: Fix the winbind piece of 58045: Correctly time out client smb requests

14 years agos3:dbwrap_torture: use timeval_current/timeval_elapsed instead of start_timer/end_timer
Stefan Metzmacher [Tue, 24 Nov 2009 09:36:52 +0000 (10:36 +0100)]
s3:dbwrap_torture: use timeval_current/timeval_elapsed instead of start_timer/end_timer

metze

14 years agos3:fix the merged build of bin/smbtorture4
Michael Adam [Tue, 24 Nov 2009 10:43:56 +0000 (11:43 +0100)]
s3:fix the merged build of bin/smbtorture4

Michael

14 years agos3: Always try SamLogonEx
Volker Lendecke [Tue, 24 Nov 2009 15:51:30 +0000 (16:51 +0100)]
s3: Always try SamLogonEx

Required for cluster systems working in a Samba domain. With NT4 this won't
work, but real NT4 DCs should not be around in environments that pay big bucks
for a cluster... And if they are, they can always install a Samba DC trusting
that NT4 domain.

14 years agos3: add dbwrap_torture - a tool to stress test tdb transactions through dbwrap
Michael Adam [Mon, 23 Nov 2009 14:40:36 +0000 (15:40 +0100)]
s3: add dbwrap_torture - a tool to stress test tdb transactions through dbwrap

This can be used to also test tdb transactions on clustered installations
throught ctdb. The test is modeled after the ctdb_transaction.c test program
from the ctdb source code. It runs transactions in a tight loop on a test
database called "transactions.tdb" (by default), increasing a counter in each
iteration. In a clustered environment, a counter is maintained for each node.

Michael

14 years agos3:torture: move the torture-specific headers to new torture/torture.h
Michael Adam [Fri, 20 Nov 2009 16:47:21 +0000 (17:47 +0100)]
s3:torture: move the torture-specific headers to new torture/torture.h

Michael

14 years agogpfs: fix logic when gpfs:winattr is false (the default!)
Rusty Russell [Fri, 20 Nov 2009 09:39:57 +0000 (10:39 +0100)]
gpfs: fix logic when gpfs:winattr is false (the default!)

On my autocluster setup, it's not set.  Maybe it should be?  Otherwise
smbclient and some Windows client programs will get errors like:

        # smbclient //localhost/data -Uadministrator%XXX
        Domain=[VSOFS1] OS=[Unix] Server=[Samba 3.4.2-ctdb-10]
        smb: \> put /etc/resolv.conf resolv.conf
        NT_STATUS_ACCESS_DENIED closing remote file \resolv.conf
        smb: \>

Caused by attempting to update the time on close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Avoid races to change the machine password in winbind
Volker Lendecke [Thu, 19 Nov 2009 16:22:27 +0000 (17:22 +0100)]
s3: Avoid races to change the machine password in winbind

The machine password handler has code to deal with every node in the cluster
trying to change the machine password at the same time. However, it is not very
nice to the DC if everyone tries this simultaneously. This adds a random 0-255
second offset to our timed event. When this fires a bit later than strictly
calculated, someone else might have stepped in and have already changed it. The
timed event handler will handle this gracefully, it won't even try to do it
again.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Protect against flooding the DC with pwchange requests
Volker Lendecke [Thu, 19 Nov 2009 16:20:47 +0000 (17:20 +0100)]
s3: Protect against flooding the DC with pwchange requests

When there is a temporary problem changing passwords we flooded the DC with
pwchange requests. This gives the DC a 60-second break to recover.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Deal with races for password changes
Volker Lendecke [Thu, 19 Nov 2009 16:16:54 +0000 (17:16 +0100)]
s3: Deal with races for password changes

When two winbinds (in a cluster) change the password at the same time, the
later one gets an NT_STATUS_ACCESS_DENIED. The netlogon session works fine, but
the next time we retry the pwchange, we again get NT_STATUS_ACCESS_DENIED. This
code deals with this race by dropping just the NETLOGON pipe. The next caller
will re-open it automatically with the changed machine credentials.

With this race in place, we also have to recalculate the timeout for the next
pwchange event.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Re-check the timeout in machine_password_change_handler()
Volker Lendecke [Thu, 19 Nov 2009 16:14:40 +0000 (17:14 +0100)]
s3: Re-check the timeout in machine_password_change_handler()

Someone else might have come in between and changed the password since we
created that timed request

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Add some debugs to the winbind machine pwchange machinery
Volker Lendecke [Thu, 19 Nov 2009 16:11:32 +0000 (17:11 +0100)]
s3: Add some debugs to the winbind machine pwchange machinery

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Factor timeval_string out of current_timestring()
Volker Lendecke [Thu, 19 Nov 2009 10:50:13 +0000 (11:50 +0100)]
s3: Factor timeval_string out of current_timestring()

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password...
Günther Deschner [Mon, 5 Oct 2009 15:04:52 +0000 (17:04 +0200)]
s3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password() only when needed.

Guenther

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agov3-4-ctdb: Bumb vendor version number to 12 3.4.2-ctdb-12
Volker Lendecke [Thu, 12 Nov 2009 11:34:17 +0000 (12:34 +0100)]
v3-4-ctdb: Bumb vendor version number to 12

14 years agos3: Fix shadow copies after the change for in-path @GMT-
Volker Lendecke [Thu, 12 Nov 2009 11:30:58 +0000 (12:30 +0100)]
s3: Fix shadow copies after the change for in-path @GMT-

14 years agos3: Fix check_reduced_name for access to the share root itself
Volker Lendecke [Thu, 12 Nov 2009 11:29:19 +0000 (12:29 +0100)]
s3: Fix check_reduced_name for access to the share root itself

14 years agos3: Fix debug messages in check_reduced_name
Volker Lendecke [Thu, 12 Nov 2009 10:07:15 +0000 (11:07 +0100)]
s3: Fix debug messages in check_reduced_name

14 years agov3-4-ctdb: Bumb vendor version number to 11 3.4.2-ctdb-11
Volker Lendecke [Wed, 11 Nov 2009 16:07:32 +0000 (17:07 +0100)]
v3-4-ctdb: Bumb vendor version number to 11

14 years agos3:vfs_fs_capabilities: fix a debug message
Michael Adam [Tue, 10 Nov 2009 23:13:14 +0000 (00:13 +0100)]
s3:vfs_fs_capabilities: fix a debug message

Michael

14 years agos3: Try to avoid dns searches with an empty site
Volker Lendecke [Mon, 9 Nov 2009 16:06:48 +0000 (17:06 +0100)]
s3: Try to avoid dns searches with an empty site

14 years agos3: Fix in-path shadowcopy2 module
Volker Lendecke [Mon, 9 Nov 2009 10:06:30 +0000 (11:06 +0100)]
s3: Fix in-path shadowcopy2 module

14 years agoadd e2fsprogs-devel as build dependency this is needed for AD because it contains...
Christian Ambach [Mon, 6 Jul 2009 12:08:57 +0000 (14:08 +0200)]
add e2fsprogs-devel as build dependency this is needed for AD because it contains libcom/libcom_err files and headers

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Fix a crash in notify_remove_onelevel when "change notify = no"
Volker Lendecke [Thu, 5 Nov 2009 14:06:21 +0000 (15:06 +0100)]
s3: Fix a crash in notify_remove_onelevel when "change notify = no"

14 years agos3: Add parameter "ctdb timeout"
Volker Lendecke [Tue, 3 Nov 2009 04:41:02 +0000 (05:41 +0100)]
s3: Add parameter "ctdb timeout"

When something in the cluster blocks, it can happen that we wait indefinitely
long for ctdb, just adding to the blocking condition. In theory, nothing should
block, but as someone said "In practice the difference between theory and
practice is larger than in theory". This adds a timeout parameter in seconds,
after which we stop waiting for ctdb and panic.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agopackaging(RHEL-CTDB): add the current githash to the rpm release number by default
Michael Adam [Wed, 4 Nov 2009 11:26:46 +0000 (12:26 +0100)]
packaging(RHEL-CTDB): add the current githash to the rpm release number by default

Disable this (to build a release-rpm) by calling

USE_GITHASH=no makerpms.sh

Michael

14 years agos3:registry: add an extra check for dsize==0 to regdb_fetch_keys_internal() 3.4.2-ctdb-10
Michael Adam [Mon, 2 Nov 2009 23:51:27 +0000 (00:51 +0100)]
s3:registry: add an extra check for dsize==0 to regdb_fetch_keys_internal()

Don't only rely on dptr == NULL.
I stumbled over this one when rewriting some of the dbwrap_ctdb code.

Michael

14 years agos3:registry: add safety check for return value of tdb_unpack to regdb_fetch_keys_inte...
Michael Adam [Mon, 2 Nov 2009 23:47:37 +0000 (00:47 +0100)]
s3:registry: add safety check for return value of tdb_unpack to regdb_fetch_keys_internal()

Prevents segfaults in some situations.

(For a non existent or empty record, we sometimes rely on the fetch operation
 to return dsize==0 and sometimes we rely on dptr==NULL.)

Michael

14 years agos3:dbwrap_ctdb: add debug message to transaction_fetch_start()
Michael Adam [Sat, 31 Oct 2009 12:16:34 +0000 (13:16 +0100)]
s3:dbwrap_ctdb: add debug message to transaction_fetch_start()

for the case that another local process has started a transaction
bewteen releasing the transaction_lock record and starting the
transaction.

Michael

14 years agos3:dbwrap_ctdb: split combined check in two and add descriptive debug
Michael Adam [Sat, 31 Oct 2009 12:13:04 +0000 (13:13 +0100)]
s3:dbwrap_ctdb: split combined check in two and add descriptive debug

in db_ctdb_transaction_fetch_start() for error conditions when re-fetching
the transaction_lock record inside the transaction

Michael

14 years agos3:dbwrap_ctdb: fix race condition with concurrent transactions on the same node.
Michael Adam [Wed, 28 Oct 2009 23:01:45 +0000 (00:01 +0100)]
s3:dbwrap_ctdb: fix race condition with concurrent transactions on the same node.

In ctdb_transaction_commit(), when the trans2_commit control fails, there
is a race condition in the 1 second sleep between the local transaction_cancel
and the call to ctdb_replay_transaction(): The database is not locked, and
neither is the transaction_lock record. So another client can start and possibly
complete a new transaction in this gap, but only on the same node: The locking
of the transaction_lock record on a different node which involves migration of
the record to the other node has been disabled by introduction of the
transaction_active flag on the db which closes precisely this gap from the start
of the commit until the call to TRANS2_FINISH or TRANS2_ERROR.
But this mechanism does not cover the case where a process on the same node
tries to start a transaction: There is no obstacle to locking the transaction_lock
record because the record does not need to be migrated.

This commit closes this race condition in ctdb_transaction_fetch_start()
by using the new ctdb_ctrl_transaction_active() call to ask the local
ctdb daemon whether it has a transaction running on the database.
If so, the check is repeated until the running transaction is done.

This does introduce an additional call to the local ctdbd when starting
transactions, but it does close the (hopefully) last race condition.

Michael

14 years agos3:configure: add a check for the new CTDB_CONTROL_TRANS2_ACTIVE
Michael Adam [Wed, 28 Oct 2009 22:56:59 +0000 (23:56 +0100)]
s3:configure: add a check for the new CTDB_CONTROL_TRANS2_ACTIVE

Michael

14 years agos3:dbwrap_ctdb: add new db_ctdb_transaction_active() that calls CTDB_CONTROL_TRANS2_C...
Michael Adam [Wed, 28 Oct 2009 22:56:03 +0000 (23:56 +0100)]
s3:dbwrap_ctdb: add new db_ctdb_transaction_active() that calls CTDB_CONTROL_TRANS2_COMMIT

Michael

14 years agos3:dbwrap_ctdb: fix a race in starting concurrent transactions on a single node
Michael Adam [Wed, 28 Oct 2009 00:54:04 +0000 (01:54 +0100)]
s3:dbwrap_ctdb: fix a race in starting concurrent transactions on a single node

There are two races in concurrent transactions on a single node.
One in starting a transaction and one with replay during commit.

This commit closes the first race by storing the client pid in the
transaction-lock record and comparing the stored pid against its own
pid after releasing the lock and refetching the record inside the
transaction.

Michael

14 years agos3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch_start
Michael Adam [Wed, 28 Oct 2009 00:50:15 +0000 (01:50 +0100)]
s3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch_start

Michael

14 years agos3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch()
Michael Adam [Wed, 28 Oct 2009 00:28:38 +0000 (01:28 +0100)]
s3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch()

Michael

14 years agos3:dbwrap_ctdb: add a function db_ctdb_ltdb_fetch()
Michael Adam [Mon, 2 Nov 2009 23:55:41 +0000 (00:55 +0100)]
s3:dbwrap_ctdb: add a function db_ctdb_ltdb_fetch()

This fetches a record from the db and splits out the ctdb header.

Michael

14 years agos3:dbrwap_ctdb: add a function db_ctdb_ltdb_store()
Michael Adam [Thu, 22 Oct 2009 14:27:45 +0000 (16:27 +0200)]
s3:dbrwap_ctdb: add a function db_ctdb_ltdb_store()

and use it in db_ctdb_store() and db_ctdb_transaction_store().

Michael

14 years agos3:dbwrap_ctdb: reformat a comment slightly to enhance clearness.
Michael Adam [Thu, 22 Oct 2009 12:37:51 +0000 (14:37 +0200)]
s3:dbwrap_ctdb: reformat a comment slightly to enhance clearness.

Michael

14 years agos3:dbwrap_ctdb: fix some function header comments
Michael Adam [Mon, 25 May 2009 19:59:40 +0000 (21:59 +0200)]
s3:dbwrap_ctdb: fix some function header comments

Michael
(cherry picked from commit f5a5c6a5dcf6be2486c53138e24f8d76b64f882e)

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Fix a 100% CPU loop when ctdbd dies during a traverse
Volker Lendecke [Mon, 2 Nov 2009 15:59:15 +0000 (16:59 +0100)]
s3: Fix a 100% CPU loop when ctdbd dies during a traverse

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agodbwrap_ctdb: revert code accidentially committed in the vendor patch bump 8->9
Michael Adam [Tue, 27 Oct 2009 08:25:49 +0000 (09:25 +0100)]
dbwrap_ctdb: revert code accidentially committed in the vendor patch bump 8->9

Michael

14 years agov3-4-ctdb: Bump the ctdb verdor patch level to 10 (for the NEXT release =)
Michael Adam [Tue, 27 Oct 2009 08:26:44 +0000 (09:26 +0100)]
v3-4-ctdb: Bump the ctdb verdor patch level to 10 (for the NEXT release =)

Michael

14 years agov3-4-ctdb: Bump the ctdb verdor patch level to 9. 3.4.2-ctdb-9
Volker Lendecke [Thu, 22 Oct 2009 11:04:04 +0000 (13:04 +0200)]
v3-4-ctdb: Bump the ctdb verdor patch level to 9.

14 years agocluster_fatal() exit code should not indicate success.
Martin Schwenke [Thu, 22 Oct 2009 11:03:20 +0000 (13:03 +0200)]
cluster_fatal() exit code should not indicate success.

cluster_fatal() logs a fatal event and then exits with 0.  This seems
wrong.  Sometimes command like "net" use this code and return
incorrect empty output but then exit with 0.

This simply changes the exit code to 1.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agov3-4-ctdb: Bump the ctdb vendor patch level to 8. 3.4.2-ctdb-8
Volker Lendecke [Mon, 19 Oct 2009 10:19:33 +0000 (12:19 +0200)]
v3-4-ctdb: Bump the ctdb vendor patch level to 8.

14 years agos3: Attempt to fix a deadlock between smbd and ctdbd
Volker Lendecke [Fri, 16 Oct 2009 10:37:27 +0000 (12:37 +0200)]
s3: Attempt to fix a deadlock between smbd and ctdbd

In Samba we access the notify databases under the locking.tdb lock when closing a file. This leads to a deadlock with ctdb when doing a recovery.

This is a bad hack, and ctdb will need to get fixed for this. But for now, it
seems necessary.

14 years agos3: Fix shadow copy display on Windows 7
Volker Lendecke [Thu, 8 Oct 2009 12:02:39 +0000 (14:02 +0200)]
s3: Fix shadow copy display on Windows 7

Windows 7 is a bit more picky on our NT_STATUS_BUFFER_TOO_SMALL. Announce the
right buffer size, the same amount we later check for.

14 years agov3-4-ctdb: Bump the ctdb verdor patch level to 7. 3.4.2-ctdb-7
Volker Lendecke [Wed, 14 Oct 2009 10:52:48 +0000 (12:52 +0200)]
v3-4-ctdb: Bump the ctdb verdor patch level to 7.

14 years agos3:winbind: Only ever handle one event after a select call
Volker Lendecke [Wed, 7 Oct 2009 12:06:53 +0000 (14:06 +0200)]
s3:winbind: Only ever handle one event after a select call

While handling an fd event, the situation with other fds can change. I've just
seen a winbind stuck in the accept() call on the privileged pipe. I can only
imagine this happen because under high load we first handled other requests and
meanwhile the client on the privileged pipe went away.

14 years agoTo set file create/birth time Signed-off-by: Abhidnya Chirmule <achirmul@in.ibm.com> 3.4.2-ctdb-6
Abhidnya Chirmule [Tue, 8 Sep 2009 12:11:31 +0000 (14:11 +0200)]
To set file create/birth time Signed-off-by: Abhidnya Chirmule <achirmul@in.ibm.com>

14 years agos3: Add access_mask to the flock VFS call
Abhidnya P Chirmule [Tue, 6 Oct 2009 15:14:56 +0000 (17:14 +0200)]
s3: Add access_mask to the flock VFS call

14 years agos3:samr: Fix an uninitialized variable
Volker Lendecke [Tue, 6 Oct 2009 12:06:16 +0000 (14:06 +0200)]
s3:samr: Fix an uninitialized variable

14 years agos3-idmap: fix two uninitialized variable warnings in idmap_tdb2.
Günther Deschner [Thu, 20 Aug 2009 13:28:19 +0000 (15:28 +0200)]
s3-idmap: fix two uninitialized variable warnings in idmap_tdb2.

Guenther

14 years agov3-4-ctdb: Bump the ctdb verdor patch level to 6
Volker Lendecke [Tue, 6 Oct 2009 10:09:33 +0000 (12:09 +0200)]
v3-4-ctdb: Bump the ctdb verdor patch level to 6

14 years agochanged debuglevel for two messages in the GPFS module from 0 to 10 they spammed...
Christian Ambach [Sun, 27 Sep 2009 21:34:04 +0000 (23:34 +0200)]
changed debuglevel for two messages in the GPFS module from 0 to 10 they spammed the logs on a test machine and they are just debug messages, so let's move them to the level of the other debug messages in the file

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
14 years agos3:gpfs: Add support for the gpfs_ftruncate call
Volker Lendecke [Tue, 15 Sep 2009 00:19:14 +0000 (02:19 +0200)]
s3:gpfs: Add support for the gpfs_ftruncate call

14 years agos3:gencache: Make gencache_del() return success for expired entries
Volker Lendecke [Wed, 23 Sep 2009 13:47:05 +0000 (15:47 +0200)]
s3:gencache: Make gencache_del() return success for expired entries

This fixes nasty error messages from "net cache flush"

14 years agos3:gencache: Remove some over-paranoid locking
Volker Lendecke [Wed, 23 Sep 2009 13:41:06 +0000 (15:41 +0200)]
s3:gencache: Remove some over-paranoid locking

14 years agos3:gencache: Add a "was_expired" argument to gencache_get_data_blob
Volker Lendecke [Wed, 23 Sep 2009 13:21:40 +0000 (15:21 +0200)]
s3:gencache: Add a "was_expired" argument to gencache_get_data_blob

This is set to true if the routine returns failure due to an existing but
expired entry.

14 years agos3: Fix vfs_shadow_copy2 to allow in-path @GMT-xxx
Andrew Tridgell [Wed, 16 Sep 2009 01:22:56 +0000 (03:22 +0200)]
s3: Fix vfs_shadow_copy2 to allow in-path @GMT-xxx

14 years agoAdd a "connectpath" operation to the shadow_copy2 module
Volker Lendecke [Mon, 2 Feb 2009 10:52:08 +0000 (11:52 +0100)]
Add a "connectpath" operation to the shadow_copy2 module

14 years agoAdd SMB_VFS_CONNECTPATH operation
Volker Lendecke [Thu, 28 May 2009 17:20:14 +0000 (19:20 +0200)]
Add SMB_VFS_CONNECTPATH operation

This is required for the shadow_copy2 module and "wide links = no". The file
system snapshots by nature are typically outside of share directory. So the
REALPATH result fails the wide links = no test.

14 years agoRemove a variable used just once
Volker Lendecke [Fri, 30 Jan 2009 14:04:44 +0000 (15:04 +0100)]
Remove a variable used just once