From de565785f5e1f097bd75f57331425c4185185f80 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Jun 2007 17:02:09 +0000 Subject: 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 15553d6327a3aecdd2b0b94a3656d04bf4106323) --- source3/include/ctdbd_conn.h | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 source3/include/ctdbd_conn.h (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h new file mode 100644 index 0000000000..79d8abe59d --- /dev/null +++ b/source3/include/ctdbd_conn.h @@ -0,0 +1,65 @@ +/* + Unix SMB/CIFS implementation. + Samba3 ctdb connection handling + Copyright (C) Volker Lendecke 2007 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +struct ctdbd_connection; + +NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, + struct ctdbd_connection **pconn); +NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx, + struct ctdbd_connection **pconn); + +uint32 ctdbd_vnn(const struct ctdbd_connection *conn); + +NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn, + struct messaging_context *msg_ctx); + +NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn, + uint32 dst_vnn, uint64 dst_srvid, + struct messaging_rec *msg); + +BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, + pid_t pid); + +char *ctdbd_dbpath(struct ctdbd_connection *conn, + TALLOC_CTX *mem_ctx, uint32_t db_id); + +NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, const char *name, + uint32_t *db_id, int tdb_flags); + +NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id, + TDB_DATA key); + +NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id, + TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data); + +NTSTATUS ctdbd_traverse(uint32 db_id, + void (*fn)(TDB_DATA key, TDB_DATA data, + void *private_data), + void *private_data); + +NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, + const struct sockaddr_in *server, + const struct sockaddr_in *client, + void (*release_ip_handler)(const char *ip_addr, + void *private_data), + void *private_data); + +NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); + -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/ctdbd_conn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 79d8abe59d..1c38fcafad 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/include/ctdbd_conn.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 1c38fcafad..eecc100ee6 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ struct ctdbd_connection; -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/ctdbd_conn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index eecc100ee6..425cc65a00 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -33,7 +33,7 @@ NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn, uint32 dst_vnn, uint64 dst_srvid, struct messaging_rec *msg); -BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, +bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, pid_t pid); char *ctdbd_dbpath(struct ctdbd_connection *conn, -- cgit From 68694369fc96354452979b07425f3f48c4f73bbe Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 16 Jan 2008 12:09:48 +0300 Subject: Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb) Signed-off-by: Alexander Bokovoy (This used to be commit 0c8e23afbbb2d081fc23908bafcad04650bfacea) --- source3/include/ctdbd_conn.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 425cc65a00..6e1b2f737a 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -17,6 +17,9 @@ along with this program. If not, see . */ +#ifndef _CTDBD_CONN_H +#define _CTDBD_CONN_H + struct ctdbd_connection; NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, @@ -62,3 +65,6 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); +NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); + +#endif /* _CTDBD_CONN_H */ -- cgit From fb97047a840037c2c7237b9de681e386eeedffae Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 18 Jul 2008 18:50:16 +1000 Subject: 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 (This used to be commit 09329f1f9114af44fc4e5e4f29a7315912313125) --- source3/include/ctdbd_conn.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 6e1b2f737a..3ea895d133 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -66,5 +66,7 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); +NTSTATUS ctdbd_start_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); +NTSTATUS ctdbd_cancel_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); #endif /* _CTDBD_CONN_H */ -- cgit From 0f41961e4ffaa602a5b19a1e0899bffa491c886f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Aug 2008 16:20:05 +1000 Subject: first cut at adding full transactions for ctdb to samba3 (This used to be commit f91a3e0f7b7737c1d0667cd961ea950e2b93e592) --- source3/include/ctdbd_conn.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include/ctdbd_conn.h') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 3ea895d133..39f50c2cfc 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -69,4 +69,9 @@ NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, T NTSTATUS ctdbd_start_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); NTSTATUS ctdbd_cancel_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); +NTSTATUS ctdbd_control_local(struct ctdbd_connection *conn, uint32 opcode, + uint64_t srvid, uint32_t flags, TDB_DATA data, + TALLOC_CTX *mem_ctx, TDB_DATA *outdata, + int *cstatus); + #endif /* _CTDBD_CONN_H */ -- cgit