summaryrefslogtreecommitdiffstats
path: root/source3/lib/serverid.c
Commit message (Collapse)AuthorAgeFilesLines
* serverid: don't leak lock_path onto talloc tosDavid Disseldorp2014-11-031-1/+9
| | | | | | | Also check for allocation failures. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove unused serverid_register_msg_flags()Volker Lendecke2014-07-311-55/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* serverid: Fix an incompatible pointer assignmentVolker Lendecke2014-05-271-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* s3:lib: always use db_open(serverid.tdb)Stefan Metzmacher2014-05-121-35/+14
| | | | | | | We should not create an empty local serverid.tdb in a cluster setup... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tdb_wrap: Remove tdb_wrap_open_ againVolker Lendecke2014-03-311-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* serverid: Avoid passing lp_ctx to tdb_wrap_open in serverid_parent_initVolker Lendecke2014-03-311-3/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:build: remove global CLUSTER_SUPPORT defineStefan Metzmacher2014-03-241-4/+0
| | | | | | | | | | All ctdb specific code is isolated in samba-cluster-support.so now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104
* s3:serverid: use ctdb_serverids_exist_supported() runtime checkStefan Metzmacher2014-03-241-5/+9
| | | | | | | | This is better than a compile time check for HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-071-1/+2
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:lib: readd the CTDB_CONTROL_CHECK_SRVIDS optimization to serverids_exist()Stefan Metzmacher2012-08-241-0/+45
| | | | metze
* s3:lib: only loop over the server_ids we need to verify in serverids_exist()Stefan Metzmacher2012-08-241-11/+23
| | | | metze
* s3:lib: use server_id_is_disconnected() in serverids_exist()Stefan Metzmacher2012-08-241-0/+4
| | | | metze
* s3:lib: inline processes_exist() into serverids_exist()Stefan Metzmacher2012-08-241-14/+99
| | | | metze
* s3:lib: SERVERID_UNIQUE_ID_NOT_TO_VERIFY only means not to verify the ↵Stefan Metzmacher2012-08-241-3/+4
| | | | | | | | 'unique_id' part It doesn't mean the the server_id is always valid. metze
* s3:lib: implement serverid_exists() as wrapper of serverids_exist()Stefan Metzmacher2012-08-241-30/+5
| | | | metze
* s3:lib: remove CTDB_CONTROL_CHECK_SRVIDS optimization in serverids_exist() ↵Stefan Metzmacher2012-08-241-6/+0
| | | | | | | | for now This will be readded... metze
* s3:lib: implement serverid_equal() as macro of server_id_equal()Stefan Metzmacher2012-08-171-21/+0
| | | | metze
* s3-param: Rename loadparm_s3_context -> loadparm_s3_helpersAndrew Bartlett2012-06-271-1/+1
| | | | | | | | | | | | | | | | | This helps clarify the role of this structure and wrapper function. The purpose here is to provide helper functions to the lib/param loadparm_context that point back at the s3 lp_ functions. This allows a struct loadparm_context to be passed to any point in the code, and always refer to the correct loadparm system. If this has not been set, the variables loaded in the lib/param code will be returned. As requested by Michael Adam. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
* s3:serverid: don't ignore the result of dbwrap_parse_record()Stefan Metzmacher2012-06-221-1/+6
| | | | metze
* s3:move serverid_equal() to serverid.cMichael Adam2012-06-211-0/+21
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tdb_wrap: Move to specific directory.Jelmer Vernooij2012-03-101-1/+1
| | | | | | | | | | It's a bit confusing to mix low-level and high-level libraries. We had multiple libraries in one directory, and there were have circular dependencies with other libraries outside that directory (in this case, samba-hostconfig). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
* s3: Add SERVERID_UNIQUE_ID_NOT_TO_VERIFY, bug 8760Volker Lendecke2012-02-151-0/+20
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Feb 15 21:10:22 CET 2012 on sn-devel-104
* s3: Add a "lock_order" argument to db_openVolker Lendecke2012-01-181-1/+2
| | | | | | | This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
* s3-dbwrap: Make dbwrap_parse_record return NTSTATUSVolker Lendecke2011-12-151-4/+6
| | | | | | | Also, the parser now returns void. The parser is called if and only if dbwrap_parse_record returns NT_STATUS_OK. Signed-off-by: Michael Adam <obnox@samba.org>
* s3-ctdb: Make use of CTDB_CONTROL_CHECK_SRVIDSVolker Lendecke2011-11-301-0/+13
| | | | | | | | This should be a lot quicker than PROCESS_EXISTS followed by looking at serverid.tdb Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Nov 30 12:47:27 CET 2011 on sn-devel-104
* s3: Add serverids_existVolker Lendecke2011-10-271-0/+34
|
* lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett2011-10-131-1/+10
| | | | | | | | This passes down a struct loadparm_context to allow these parameters to be checked. This may be s3 or s4 context, allowing the #if _SAMBA_BUILD_ macro to go away safely. Andrew Bartlett
* s3:serverid: convert to using dbwrap wrapper functions onlyMichael Adam2011-10-111-16/+24
| | | | Avoid direct use of the db_record and db_context structs.
* s3:serverid: use dbwrap_traverse_read() in serverid_traverse_read()Michael Adam2011-10-111-1/+5
| | | | | | This also fixes the return value: originally the int return value of traverse_read which is a count of the records traversed or negative upon failure, was simply casted into a bool return value.
* s3:serverid: use dbwrap_traverse() in serverid_traverse()Michael Adam2011-10-111-1/+4
| | | | | | This also fixes the return value: Originally, the int returned by the traverse method, which is the count of the traverse was casted into a bool return value.
* s3: Slightly simplify serverid_existsVolker Lendecke2011-08-221-1/+1
| | | | | | | procid_is_me() works fine in the clustering case as well Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Aug 22 21:28:13 CEST 2011 on sn-devel-104
* Re-arrange the optimization to reduce tdb fcntl calls if smbd is notIra Cooper2011-08-201-1/+5
| | | | | | | | clustered. procid_is_me() is much cheaper to test and can optimize up to 50% of the calls to serverid_exists(). Volker please check. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Aug 20 01:15:07 CEST 2011 on sn-devel-104
* s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam2011-07-291-1/+1
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
* s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam2011-07-291-0/+1
| | | | | | Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and make the fallbacke implementation functoins non-static and create a dbwrap_private.h header file that contains their prototypes.
* tdb_compat: Higher level API fixes.Rusty Russell2011-06-201-1/+1
| | | | | | | | | | | | My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3-server_id Add task_id to server_id to match Samba4Andrew Bartlett2011-06-091-0/+3
| | | | | | | | | | This will allow this structure to be shared, and allow us to create a common messaging system between all Samba processes. Samba4 uses the task_id to indicate the different tasks within a single unix process. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* lib/util Move source3 tdb_wrap_open() into the common code.Andrew Bartlett2011-05-061-0/+1
| | | | | | | | | This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-cluster Always fill in the clustering vnn elementAndrew Bartlett2011-02-171-6/+0
| | | | | | This avoids this structure being partially uninitialised. Adnrew Bartlett
* s3: Fix serverid_existsVolker Lendecke2010-12-191-0/+4
| | | | | | | In the cluster case it can happen that a node just died and we did not yet have the time to clean up serverid.tdb. If the corresponding serverid.tdb record that represented a process was migrated away from the dead record, it represents existence of a process where it is already dead.
* Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison2010-09-271-2/+2
| | | | | | | | | | TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
* s3: Remove talloc_autofree_context() from serverid_db()Volker Lendecke2010-09-261-2/+2
| | | | | If we needed an explicit tdb_close() in the destructor, we'd be hosed long ago.
* s3: Remove talloc_autofree_context() from serverid_parent_init()Volker Lendecke2010-09-261-3/+2
|
* s3-build: use dbwrap.h only where needed.Günther Deschner2010-08-261-0/+1
| | | | Guenther
* s3: Fix serverid_register_msg_flagsVolker Lendecke2010-08-181-4/+2
| | | | Thanks, Andreas, for pointing this out! (How drunk have I been?...)
* s3-lib: Fixed a possible crash bug.Andreas Schneider2010-08-181-0/+2
| | | | Volker please check!
* Fix warning on 64-bit machines.Jeremy Allison2010-07-201-1/+1
| | | | Jeremy.
* s3: Put serverid_key and serverid_data togetherVolker Lendecke2010-07-051-5/+5
|
* s3: Remove an unused variable -- thanks, metze!Volker Lendecke2010-07-041-2/+1
|