summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_freeze.c
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-daemon: Add implementation of VACUUM_FETCH controlAmitay Isaacs2019-10-241-1/+8
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Fix signed/unsigned comparisons by declaring as unsignedMartin Schwenke2019-07-051-5/+5
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-daemon: Invalidate records if a node becomes INACTIVEAmitay Isaacs2018-10-081-1/+23
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add a function to check if db access is allowedAmitay Isaacs2017-09-121-0/+18
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13021 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add accessors for CTDB_DB_FLAGS_PERSISTENT flagAmitay Isaacs2017-06-291-1/+1
| | | | | | | | | | This allows to differentiate between the two database models. ctdb_db_persistent() - replicated and permanent ctdb_db_volatile() - distributed and temporary Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop implementation of global transaction controlsAmitay Isaacs2016-07-281-100/+0
| | | | | | | | | These were used in serial recovery and for restoring databases using older ctdb tool. New code uses database specific transaction controls. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Remove ctdb_db_prio_frozen() functionAmitay Isaacs2016-07-251-17/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Drop function thaw_priority()Amitay Isaacs2016-07-251-16/+10
| | | | | | | | | There are no database priorities anymore, so the function name does not make any sense. Call the code in thaw_priority() directly from ctdb_control_thaw(). Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Drop priorites from freeze/thaw codeAmitay Isaacs2016-07-251-90/+47
| | | | | | | | | | | Parallel database recovery freezes databases in parallel and irrespective of database priority. So drop priority from freeze/thaw code. Database priority will be dropped completely soon. Now FREEZE and THAW controls operate on all the databases. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-server: Replace ctdb_logging.h with common/logging.hAmitay Isaacs2015-11-161-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-daemon: Rename struct ctdb_control_transdb to ctdb_transdbAmitay Isaacs2015-11-041-9/+9
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Rename struct ctdb_req_control to ctdb_req_control_oldAmitay Isaacs2015-11-041-5/+5
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Separate prototypes for common client/server functionsAmitay Isaacs2015-10-301-1/+1
| | | | | | | | 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>
* ctdb-daemon: Remove dependency on includes.hAmitay Isaacs2015-10-301-5/+12
| | | | | | | 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>
* ctdb-daemon: Introduce per database generationAmitay Isaacs2015-10-071-2/+3
| | | | | | | | | | | The database generation for each database is updated only during recovery. After recovery is complete the database generation would be the same as the global generation. The database generation is required for parallel database recovery. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use individual database freeze in blocking freezeAmitay Isaacs2015-10-071-8/+21
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Ensure all databases get frozen during freezeAmitay Isaacs2015-10-071-4/+45
| | | | | | | | | | | It's possible that the databases can get attached after initial freeze. This typically happens during startup as CTDB will only attach persistent databases and go in to startup freeze. During recovery, the recovery master will attach all the missing databases and then send freeze controls. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Make function ctdb_start_freeze staticAmitay Isaacs2015-10-071-1/+1
| | | | | | | | Since the banning code does not call this function anymore, it can be made static. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Fix a log messageAmitay Isaacs2015-10-071-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use database specific information in wipe databaseAmitay Isaacs2015-10-071-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use single database transactions for global transactionsAmitay Isaacs2015-10-071-6/+13
| | | | | | | | | This cascades the global transaction controls to individual database transaction operations. This ensures that the individual database state is correctly set when processing global transaction controls. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add controls for transactions on a single databaseAmitay Isaacs2015-10-071-0/+177
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Rename ctdb_control_wipe_database to ctdb_control_transdbAmitay Isaacs2015-10-071-1/+1
| | | | | | | The same structure is required in new controls for database transactions. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: simplify code with TALLOC_FREEAmitay Isaacs2015-10-071-4/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Improve log message to indicate subsequent freeze operationAmitay Isaacs2015-10-071-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use single database freeze/thaw code for existing controlsAmitay Isaacs2015-10-071-7/+107
| | | | | | | | | This changes the locking behaviour when the databases are frozen. Instead of a single lock helper locking all databases with a priority, a lock helper is launched for every database. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Move destructor closer to where it is usedAmitay Isaacs2015-10-071-9/+9
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Add controls to freeze/thaw a single databaseAmitay Isaacs2015-10-071-0/+182
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Avoid the use of ctdb->freeze_mode variableAmitay Isaacs2015-10-071-11/+9
| | | | | | | | Use ctdb->freeze_mode only in ctdb_freeze.c and use the functions to check if databases are frozen everywhere else. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Refactor code to check if databases are frozenAmitay Isaacs2015-10-071-0/+29
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use ctdb_db_iterator to commit transaction on databasesAmitay Isaacs2015-10-071-20/+33
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use ctdb_db_iterator to start transaction on databasesAmitay Isaacs2015-10-071-24/+33
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use ctdb_db_iterator to cancel transaction on databasesAmitay Isaacs2015-10-071-21/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Use ctdb_db_prio_iterator to cancel transaction on databasesAmitay Isaacs2015-10-071-24/+26
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Remove commented test codeAmitay Isaacs2015-10-071-10/+0
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-freeze: Do an early exit if freeze is pendingAmitay Isaacs2015-10-071-14/+17
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystemMartin Schwenke2014-09-101-1/+1
| | | | | | | | | | | | | | | 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>
* ctdb-locking: Talloc lock request from client specified contextAmitay Isaacs2014-09-051-2/+2
| | | | | | | | | This makes sure that when the client context is destroyed, the lock request goes away. If the lock requests is already scheduled, then the lock child process will be terminated. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-daemon: Do not thaw databases if recovery is activeAmitay Isaacs2014-07-071-3/+10
| | | | | | | | This prevents ctdb tool from thawing databases prematurely in thaw/wipedb/restoredb commands if recovery is active. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* freeze: Make ctdb_start_freeze() a void functionAmitay Isaacs2013-07-021-14/+6
| | | | | | | | | If this function fails due to memory errors, there is no way to recover. The best course of action is to abort. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 46efe7a886f8c4c56f19536adc98a73c22db906a)
* freeze: If priority is invalid here, it's time to abortAmitay Isaacs2013-07-021-6/+1
| | | | | | | | | | | ctdb_start_freeze() is called from ctdb_control_freeze() which fixes the priority if it's 0 and return error if it's invalid. Other callers of ctdb_start_freeze() are internal to CTDB. So if priority is invalid in ctdb_start_freeze(), definitely something is seriously wrong. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 87716e8f504d659515d3dbcf93badbf106873bc8)
* freeze: Log message from ctdb_start_freeze() and ctdb_control_freeze()Amitay Isaacs2013-07-021-2/+3
| | | | | | | | | | | This ensures that whenever databases are frozen either via sending control or by calling ctdb_start_freeze(), the action is logged. Since ctdb_control_freeze() calls ctdb_start_freeze(), move logging of message in early return condition if databases are already frozen. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 478e24bceda3fedfba54ccb48faa115df726b819)
* build: Fix tdb.h path to enable building with system TDB libraryMathieu Parent2013-06-141-1/+1
| | | | (This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
* ctdb_freeze: Replace locking functions with locking APIAmitay Isaacs2012-10-201-140/+18
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 01ee86d2aafbcda658ef6acc2bba6d6781ae4047)
* ctdbd: Return explicit boolean values for function returning boolAmitay Isaacs2012-07-161-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3de2830ae68241ee95bcc14dc1bb896ff18d86ce)
* server: Replace BOOL datatype with bool, True/False with true/falseAmitay Isaacs2012-05-281-1/+1
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 6e5cbe8fff71985e5a2fc16b7e9f2b868011ff5d)
* Track all child process so we never send a signal to an unrelated process ↵Ronnie Sahlberg2012-05-031-3/+3
| | | | | | | | | | | (our child died and kernel wrapped the pid-space and reused the pid for a different process Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned. Capture SIGCHLD to track also which child processes have terminated. Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a (This used to be ctdb commit f73a4b1495830bcdd094a93732a89dd53b3c2f78)
* Remove explicit include of lib/tevent/tevent.h.Amitay Isaacs2012-04-131-1/+0
| | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
* This needs more testing firstRonnie Sahlberg2011-03-211-5/+0
| | | | | | | | Revert "ctdbd: call tdb_reopen_all() in freeze child." This reverts commit 3d9828861c771a060923f3181fa8224e0122bffc. (This used to be ctdb commit 55c3446c9ba82d24b1d7db92bc3611fd8027b7fb)
* ctdbd: call tdb_reopen_all() in freeze child.Rusty Russell2011-03-211-0/+5
| | | | | | | In theory, the ctdbd parent shouldn't be holding any locks, but it's a good idea to always call tdb_reopen_all() after a fork(). (This used to be ctdb commit 3d9828861c771a060923f3181fa8224e0122bffc)