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

32 Commits

Author SHA1 Message Date
Volker Lendecke
4e479737f3 Fix some nonempty blank lines
(This used to be commit 010c7101e5)
2008-08-24 12:48:30 +02:00
Volker Lendecke
3d13cdfa92 Fix some C++ warnings
(This used to be commit dd9e4e6db0)
2008-08-24 12:48:23 +02:00
Andrew Tridgell
11331eeae5 allow nested ctdb transactions in the same manner that they are
allowed for tdb. This is needed for the registry db backend.
(This used to be commit 4b04ec29c7)
2008-08-13 11:54:11 +02:00
Andrew Tridgell
65a78a6a52 drop retries to 5
(This used to be commit a2f70fc175)
2008-08-13 11:54:11 +02:00
Andrew Tridgell
ca64c340c7 use CTDB_CONTROL_TRANS2_COMMIT_RETRY to prevent the counter getting
out of sync
(This used to be commit 571ec7893c)
2008-08-13 11:54:11 +02:00
Andrew Tridgell
fe3dd9b3e6 fixed lots of places that paniced on a failed transaction_commit,
thinking it was a failure of a transaction cancel
(This used to be commit 22dbe158ed)
2008-08-13 11:54:10 +02:00
Andrew Tridgell
0f8a6859e6 cope with the control failing completely without returning a status
(This used to be commit fe6a03e7b1)
2008-08-13 11:54:10 +02:00
Andrew Tridgell
2592565bde handle two special cases
1) when all nodes write the same value to the record, or when writing
   a value that is already there, we can skip the write and save
   ourselves a network transactions

2) when all remote nodes fail an update, and we then fail a replay, we
   don't need to trigger a recovery. This solves a corner case where
   we could get into a recovery loop
(This used to be commit 2481bfce43)
2008-08-13 11:54:10 +02:00
Andrew Tridgell
62bbcc6135 put a limit on the number of retries. I found a case where a recovery
could lead to it blocking forever
(This used to be commit a633390d3a)
2008-08-13 11:54:09 +02:00
Andrew Tridgell
7e9229e17a we need to commit, not cancel, on record destruction
(This used to be commit ba64a757f8)
2008-08-13 11:54:09 +02:00
Andrew Tridgell
5031f2a6e2 all persistent databases now do all stores via automatic transactions
(This used to be commit 76fbe56e82)
2008-08-13 11:54:09 +02:00
Andrew Tridgell
ee314d6930 fixed fetch of empty records
(This used to be commit 037516f136)
2008-08-13 11:54:09 +02:00
Andrew Tridgell
b3f4b7768f cleanup debugging and fix handling of empty transaction
(This used to be commit 2e85cbe88b)
2008-08-13 11:54:08 +02:00
Andrew Tridgell
0f41961e4f first cut at adding full transactions for ctdb to samba3
(This used to be commit f91a3e0f7b)
2008-08-13 11:54:08 +02:00
Michael Adam
286974e35a dbwrap ctdb: fix a DEBUG message.
Michael
(This used to be commit d776d8df26)
2008-08-13 11:54:08 +02:00
Michael Adam
ebaf208fc3 dbwrap ctdb: don't retry when tdb_store failed in db_ctdb_persistent_store().
Only retry when ctdbd_persisten_update() failed.

Michael
(This used to be commit ff413a4614)
2008-08-13 11:54:07 +02:00
Michael Adam
b45305b5d8 dbwrap ctdb: add a partial mapping from tdb_error to NTSTATUS and use it for store.
Michael
(This used to be commit eaf76c751f)
2008-08-13 11:54:07 +02:00
Michael Adam
873e74705f dbwrap ctdb: add db_ctdb_delete_persistent() and use it for persistent DBs
as delete_rec operation from fetch_locked()

Michael
(This used to be commit f4aab595a0)
2008-08-13 11:54:07 +02:00
Michael Adam
dd7ac4f38d dbwrap ctdb: call db_ctdb_store() in db_ctdb_delete().
to reduce code duplication.

Michael
(This used to be commit 09a197e756)
2008-08-13 11:54:07 +02:00
Michael Adam
5dcf20961e dbwrap ctdb: add a retry loop to the persistent store operation.
This is because ctdbd can fail in performing the persistent_store
due to race conditions, and this does not mean it can't succeed
the next time.

To not loop infinitely, this makes use of a new parametric option:
"dbwrap ctdb:max store retries" (integer) which defaults to 5
and sets the upper limit for the number or repeats of the
fetch/store cycle.

Michael
(This used to be commit 2bcc9e6ece)
2008-08-13 11:54:06 +02:00
Michael Adam
ed66929647 dbwrap ctdb: release the lock before calling ctdbd_persistent_store()
in the persistent db_ctdb_store operation.

This is to prevent deadlocks in db_ctdb_persistent_store().

There is a tradeoff: Usually, the record is still locked
after db->store operation. This lock is usually released
via the talloc destructor with the TALLOC_FREE to
the record. So we have two choices:

- Either re-lock the record after the call to persistent_store
  or cancel_persistent update and this way not changing any
  assumptions callers may have about the state, but possibly
  introducing new race conditions.

- Or don't lock the record again but just remove the
  talloc_destructor. This is less racy but assumes that
  the lock is always released via TALLOC_FREE of the record.

I choose the first variant for now since it seems less racy.
We can't guarantee that we succeed in getting the lock
anyways. The only real danger here is that a caller
performs multiple store operations after a fetch_locked()
which is currently not the case.

Michael
(This used to be commit d004c9a728)
2008-08-13 11:54:06 +02:00
Michael Adam
fd070dc9af dbwrap ctdb: remove erroneously duplicated comment.
Michael
(This used to be commit c939c55e51)
2008-08-13 11:54:06 +02:00
Ronnie Sahlberg
fb97047a84 Use transaction start/cancel for persistent writes to avoid leaving the database in an inconsistent state if we crash during the operation
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
(This used to be commit 09329f1f91)
2008-08-13 11:54:06 +02:00
Andrew Tridgell
f8534d5c78 fixed permissions on ctdb databases
(This used to be commit 123fc3980a)
2008-08-06 10:51:04 +02:00
Volker Lendecke
541b8dec4e Add transactions to the dbwrap API
Only filled in for tdb so far, for rbt it's pointless, and ctdb itself needs to
be extended
(This used to be commit 0a55e018dd)
2008-03-10 21:08:44 +01:00
Alexander Bokovoy
68694369fc Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbb)
2008-01-16 12:09:48 +03:00
Volker Lendecke
95b9e23095 Fix dbwrap debug output
(This used to be commit 9f9c933c16)
2007-11-09 15:10:14 +01:00
Volker Lendecke
a116d7c7d9 r24773: Fix a ctdb connection lockup
The lockup could happen when packet_read_sync() gets two packets in a row, the
first one being an async message, and the second one being the response to a
ctdb request.

Also add some debug msg to ctdb_conn.c, and cut off the "locking key" messages
to only dump 20 hex chars at debug level 10. >10 will dump everything.
(This used to be commit 0a55880a24)
2007-10-10 12:30:20 -05:00
Stefan Metzmacher
ebdfd34548 r24113: some little fixes to get the correct error message
when using "clustering = yes" and ctdbd isn't running

metze
(This used to be commit c5f020ba1f)
2007-10-10 12:29:08 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
de565785f5 r23410: Merge the core of the cluster code.
I'm 100% certain I've forgotten to merge something, but the main code
should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and
messages_ctdbd.c.

There should be no changes to the non-cluster case, it does survive make
test on my laptop.

It survives some very basic tests with ctdbd enables, I did not do the
full test suite for clusters yet.

Phew...

Volker
(This used to be commit 15553d6327)
2007-10-10 12:23:14 -05:00