The branch, master has been updated via d98f68f9182 ctdb-daemon: Drop implementation of old-style database pull/push controls via 7d826731d48 ctdb-protocol: Drop marshalling functions for old-style database pull/push via 3bbb4a85357 ctdb-protocol: Drop client functions for old-style database pull/push via 28986954738 ctdb-client: Drop unused synchronous functions for database pull/push via 2efce7d4774 ctdb-recovery: Simplify database push function names via f4e2206e88b ctdb-recovery: Drop unnecessary database push wrapper via 225a699633b ctdb-recovery: Drop passing of capabilities into database pull via 595c1a7c0fd ctdb-recovery: Simplify database pull function names via f9685766421 ctdb-recovery: Remove use of old pull and push controls via d9d8bf8c54c ctdb-tests: Simplify comment in large database recovery test from ed9abf94b31 utils/asn1: avoid undefined behaviour warning
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit d98f68f9182632aa1a086084d90b745ddeaed3d7 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 21:35:14 2020 +1000 ctdb-daemon: Drop implementation of old-style database pull/push controls Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> Autobuild-User(master): Amitay Isaacs <ami...@samba.org> Autobuild-Date(master): Fri Sep 11 06:29:32 UTC 2020 on sn-devel-184 commit 7d826731d484f79443635feb0eb9e989d893b068 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 21:30:34 2020 +1000 ctdb-protocol: Drop marshalling functions for old-style database pull/push Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 3bbb4a85357ce9dcf62f0efab7c6b3cdbd21f6c7 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 17:30:18 2020 +1000 ctdb-protocol: Drop client functions for old-style database pull/push Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 289869547383c4b243aedd0f0e2256c94abe53fb Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 17:28:30 2020 +1000 ctdb-client: Drop unused synchronous functions for database pull/push Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 2efce7d4774d4af1330722f039caaaec49cc4855 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 17:25:26 2020 +1000 ctdb-recovery: Simplify database push function names Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit f4e2206e88bbe0bc55d5b5e8071c0f70f75fa6cb Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 17:19:48 2020 +1000 ctdb-recovery: Drop unnecessary database push wrapper Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 225a699633b81568635ba18999db8088b978c56f Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 21:47:09 2020 +1000 ctdb-recovery: Drop passing of capabilities into database pull This is no longer necessary because the capability new style database pull is assumed to always be available. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit 595c1a7c0fd7b6069f1bbbd055d5efe4d8eb1869 Author: Martin Schwenke <mar...@meltin.net> Date: Thu Aug 6 17:07:09 2020 +1000 ctdb-recovery: Simplify database pull function names Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit f9685766421690ee2d47f63579af21a955cb64b2 Author: Martin Schwenke <mar...@meltin.net> Date: Wed Aug 5 18:05:51 2020 +1000 ctdb-recovery: Remove use of old pull and push controls Removes use of the old controls without cleaning up the code. Clean up can be done later. After this change the CTDB_CAP_FRAGMENTED_CONTROLS capability is no longer checked. This capability can be removed along with the controls. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> commit d9d8bf8c54c248f14133332444a065f0daeae196 Author: Martin Schwenke <mar...@meltin.net> Date: Wed Aug 5 17:40:42 2020 +1000 ctdb-tests: Simplify comment in large database recovery test The older style controls mentioned are being removed. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Amitay Isaacs <ami...@gmail.com> ----------------------------------------------------------------------- Summary of changes: ctdb/client/client_control_sync.c | 58 --- ctdb/client/client_sync.h | 9 - ctdb/include/ctdb_private.h | 4 - ctdb/protocol/protocol.h | 4 +- ctdb/protocol/protocol_api.h | 10 - ctdb/protocol/protocol_client.c | 49 --- ctdb/protocol/protocol_control.c | 48 --- ctdb/protocol/protocol_debug.c | 2 - ctdb/server/ctdb_control.c | 7 +- ctdb/server/ctdb_recover.c | 216 ---------- ctdb/server/ctdb_recovery_helper.c | 433 ++------------------- .../INTEGRATION/database/recovery.002.large.sh | 14 +- ctdb/tests/src/protocol_common_ctdb.c | 36 -- 13 files changed, 47 insertions(+), 843 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c index e56a2b2f18d..b9a25ce2b2c 100644 --- a/ctdb/client/client_control_sync.c +++ b/ctdb/client/client_control_sync.c @@ -268,64 +268,6 @@ int ctdb_ctrl_get_dbmap(TALLOC_CTX *mem_ctx, struct tevent_context *ev, return 0; } -int ctdb_ctrl_pull_db(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct ctdb_client_context *client, int destnode, - struct timeval timeout, struct ctdb_pulldb *pulldb, - struct ctdb_rec_buffer **recbuf) -{ - struct ctdb_req_control request; - struct ctdb_reply_control *reply; - int ret; - - ctdb_req_control_pull_db(&request, pulldb); - ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout, - &request, &reply); - if (ret != 0) { - DEBUG(DEBUG_ERR, - ("Control PULL_DB failed to node %u, ret=%d\n", - destnode, ret)); - return ret; - } - - ret = ctdb_reply_control_pull_db(reply, mem_ctx, recbuf); - if (ret != 0) { - DEBUG(DEBUG_ERR, - ("Control PULL_DB failed, ret=%d\n", ret)); - return ret; - } - - return 0; -} - -int ctdb_ctrl_push_db(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct ctdb_client_context *client, int destnode, - struct timeval timeout, struct ctdb_rec_buffer *recbuf) -{ - struct ctdb_req_control request; - struct ctdb_reply_control *reply; - int ret; - - ctdb_req_control_push_db(&request, recbuf); - ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout, - &request, &reply); - if (ret != 0) { - DEBUG(DEBUG_ERR, - ("Control PUSH_DB failed to node %u, ret=%d\n", - destnode, ret)); - return ret; - } - - ret = ctdb_reply_control_push_db(reply); - if (ret != 0) { - DEBUG(DEBUG_ERR, - ("Control PUSH_DB failed, ret=%d\n", ret)); - return ret; - } - - return 0; -} - - int ctdb_ctrl_get_recmode(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct ctdb_client_context *client, int destnode, struct timeval timeout, diff --git a/ctdb/client/client_sync.h b/ctdb/client/client_sync.h index b29e669fba4..dc8b67395e3 100644 --- a/ctdb/client/client_sync.h +++ b/ctdb/client/client_sync.h @@ -65,15 +65,6 @@ int ctdb_ctrl_get_dbmap(TALLOC_CTX *mem_ctx, struct tevent_context *ev, int destnode, struct timeval timeout, struct ctdb_dbid_map **dbmap); -int ctdb_ctrl_pull_db(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct ctdb_client_context *client, int destnode, - struct timeval timeout, struct ctdb_pulldb *pulldb, - struct ctdb_rec_buffer **recbuf); - -int ctdb_ctrl_push_db(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct ctdb_client_context *client, int destnode, - struct timeval timeout, struct ctdb_rec_buffer *recbuf); - int ctdb_ctrl_get_recmode(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct ctdb_client_context *client, int destnode, struct timeval timeout, diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 9ca87332d61..8eb6686f953 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -794,10 +794,6 @@ int ctdb_control_getnodemap(struct ctdb_context *ctdb, uint32_t opcode, int ctdb_control_reload_nodes_file(struct ctdb_context *ctdb, uint32_t opcode); -int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata, - TDB_DATA *outdata); -int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata); - int32_t ctdb_control_db_pull(struct ctdb_context *ctdb, struct ctdb_req_control_old *c, TDB_DATA indata, TDB_DATA *outdata); diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h index 35543a67cf9..e4b76c6b986 100644 --- a/ctdb/protocol/protocol.h +++ b/ctdb/protocol/protocol.h @@ -236,8 +236,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0, CTDB_CONTROL_GET_NODEMAPv4 = 10, /* obsolete */ CTDB_CONTROL_SET_DMASTER = 11, /* obsolete */ /* #12 removed */ - CTDB_CONTROL_PULL_DB = 13, - CTDB_CONTROL_PUSH_DB = 14, + CTDB_CONTROL_PULL_DB = 13, /* obsolete */ + CTDB_CONTROL_PUSH_DB = 14, /* obsolete */ CTDB_CONTROL_GET_RECMODE = 15, CTDB_CONTROL_SET_RECMODE = 16, CTDB_CONTROL_STATISTICS_RESET = 17, diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h index bdb4bc0e2ea..7bbe33b22fe 100644 --- a/ctdb/protocol/protocol_api.h +++ b/ctdb/protocol/protocol_api.h @@ -221,16 +221,6 @@ int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply, TALLOC_CTX *mem_ctx, struct ctdb_dbid_map **dbmap); -void ctdb_req_control_pull_db(struct ctdb_req_control *request, - struct ctdb_pulldb *pulldb); -int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply, - TALLOC_CTX *mem_ctx, - struct ctdb_rec_buffer **recbuf); - -void ctdb_req_control_push_db(struct ctdb_req_control *request, - struct ctdb_rec_buffer *recbuf); -int ctdb_reply_control_push_db(struct ctdb_reply_control *reply); - void ctdb_req_control_get_recmode(struct ctdb_req_control *request); int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply, int *recmode); diff --git a/ctdb/protocol/protocol_client.c b/ctdb/protocol/protocol_client.c index cde544feb52..6d850be86df 100644 --- a/ctdb/protocol/protocol_client.c +++ b/ctdb/protocol/protocol_client.c @@ -281,55 +281,6 @@ int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply, return reply->status; } -/* CTDB_CONTROL_PULL_DB */ - -void ctdb_req_control_pull_db(struct ctdb_req_control *request, - struct ctdb_pulldb *pulldb) -{ - request->opcode = CTDB_CONTROL_PULL_DB; - request->pad = 0; - request->srvid = 0; - request->client_id = 0; - request->flags = 0; - - request->rdata.opcode = CTDB_CONTROL_PULL_DB; - request->rdata.data.pulldb = pulldb; -} - -int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply, - TALLOC_CTX *mem_ctx, - struct ctdb_rec_buffer **recbuf) -{ - if (reply->rdata.opcode != CTDB_CONTROL_PULL_DB) { - return EPROTO; - } - - if (reply->status == 0) { - *recbuf = talloc_steal(mem_ctx, reply->rdata.data.recbuf); - } - return reply->status; -} - -/* CTDB_CONTROL_PUSH_DB */ - -void ctdb_req_control_push_db(struct ctdb_req_control *request, - struct ctdb_rec_buffer *recbuf) -{ - request->opcode = CTDB_CONTROL_PUSH_DB; - request->pad = 0; - request->srvid = 0; - request->client_id = 0; - request->flags = 0; - - request->rdata.opcode = CTDB_CONTROL_PUSH_DB; - request->rdata.data.recbuf = recbuf; -} - -int ctdb_reply_control_push_db(struct ctdb_reply_control *reply) -{ - return ctdb_reply_control_generic(reply, CTDB_CONTROL_PUSH_DB); -} - /* CTDB_CONTROL_GET_RECMODE */ void ctdb_req_control_get_recmode(struct ctdb_req_control *request) diff --git a/ctdb/protocol/protocol_control.c b/ctdb/protocol/protocol_control.c index 4fd5a5a7d4d..fb6b0219ef7 100644 --- a/ctdb/protocol/protocol_control.c +++ b/ctdb/protocol/protocol_control.c @@ -68,14 +68,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd) case CTDB_CONTROL_GET_DBMAP: break; - case CTDB_CONTROL_PULL_DB: - len = ctdb_pulldb_len(cd->data.pulldb); - break; - - case CTDB_CONTROL_PUSH_DB: - len = ctdb_rec_buffer_len(cd->data.recbuf); - break; - case CTDB_CONTROL_GET_RECMODE: break; @@ -447,14 +439,6 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd, ctdb_uint32_push(&cd->data.loglevel, buf, &np); break; - case CTDB_CONTROL_PULL_DB: - ctdb_pulldb_push(cd->data.pulldb, buf, &np); - break; - - case CTDB_CONTROL_PUSH_DB: - ctdb_rec_buffer_push(cd->data.recbuf, buf, &np); - break; - case CTDB_CONTROL_SET_RECMODE: ctdb_uint32_push(&cd->data.recmode, buf, &np); break; @@ -741,16 +725,6 @@ static int ctdb_req_control_data_pull(uint8_t *buf, size_t buflen, ret = ctdb_uint32_pull(buf, buflen, &cd->data.loglevel, &np); break; - case CTDB_CONTROL_PULL_DB: - ret = ctdb_pulldb_pull(buf, buflen, mem_ctx, - &cd->data.pulldb, &np); - break; - - case CTDB_CONTROL_PUSH_DB: - ret = ctdb_rec_buffer_pull(buf, buflen, mem_ctx, - &cd->data.recbuf, &np); - break; - case CTDB_CONTROL_SET_RECMODE: ret = ctdb_uint32_pull(buf, buflen, &cd->data.recmode, &np); break; @@ -1102,13 +1076,6 @@ static size_t ctdb_reply_control_data_len(struct ctdb_reply_control_data *cd) len = ctdb_dbid_map_len(cd->data.dbmap); break; - case CTDB_CONTROL_PULL_DB: - len = ctdb_rec_buffer_len(cd->data.recbuf); - break; - - case CTDB_CONTROL_PUSH_DB: - break; - case CTDB_CONTROL_GET_RECMODE: break; @@ -1449,13 +1416,6 @@ static void ctdb_reply_control_data_push(struct ctdb_reply_control_data *cd, ctdb_dbid_map_push(cd->data.dbmap, buf, &np); break; - case CTDB_CONTROL_PULL_DB: - ctdb_rec_buffer_push(cd->data.recbuf, buf, &np); - break; - - case CTDB_CONTROL_PUSH_DB: - break; - case CTDB_CONTROL_DB_ATTACH: ctdb_uint32_push(&cd->data.db_id, buf, &np); break; @@ -1622,14 +1582,6 @@ static int ctdb_reply_control_data_pull(uint8_t *buf, size_t buflen, &cd->data.dbmap, &np); break; - case CTDB_CONTROL_PULL_DB: - ret = ctdb_rec_buffer_pull(buf, buflen, mem_ctx, - &cd->data.recbuf, &np); - break; - - case CTDB_CONTROL_PUSH_DB: - break; - case CTDB_CONTROL_DB_ATTACH: ret = ctdb_uint32_pull(buf, buflen, &cd->data.db_id, &np); break; diff --git a/ctdb/protocol/protocol_debug.c b/ctdb/protocol/protocol_debug.c index 56f14e32b09..694285515e1 100644 --- a/ctdb/protocol/protocol_debug.c +++ b/ctdb/protocol/protocol_debug.c @@ -114,8 +114,6 @@ static void ctdb_opcode_print(uint32_t opcode, FILE *fp) { CTDB_CONTROL_GET_DBMAP, "GET_DBMAP" }, { CTDB_CONTROL_GET_NODEMAPv4, "GET_NODEMAPv4" }, { CTDB_CONTROL_SET_DMASTER, "SET_DMASTER" }, - { CTDB_CONTROL_PULL_DB, "PULL_DB" }, - { CTDB_CONTROL_PUSH_DB, "PUSH_DB" }, { CTDB_CONTROL_GET_RECMODE, "GET_RECMODE" }, { CTDB_CONTROL_SET_RECMODE, "SET_RECMODE" }, { CTDB_CONTROL_STATISTICS_RESET, "STATISTICS_RESET" }, diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c index 95f3b175934..206ea149693 100644 --- a/ctdb/server/ctdb_control.c +++ b/ctdb/server/ctdb_control.c @@ -285,15 +285,14 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb, case CTDB_CONTROL_SETVNNMAP: return ctdb_control_setvnnmap(ctdb, opcode, indata, outdata); - case CTDB_CONTROL_PULL_DB: - CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_pulldb)); - return ctdb_control_pull_db(ctdb, indata, outdata); + case CTDB_CONTROL_PULL_DB: + return control_not_implemented("PULL_DB", NULL); case CTDB_CONTROL_SET_DMASTER: return control_not_implemented("SET_DMASTER", NULL); case CTDB_CONTROL_PUSH_DB: - return ctdb_control_push_db(ctdb, indata); + return control_not_implemented("PUSH_DB", NULL); case CTDB_CONTROL_GET_RECMODE: { return ctdb->recovery_mode; diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index 1654c6d3978..108d8bb404b 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -191,128 +191,6 @@ ctdb_control_reload_nodes_file(struct ctdb_context *ctdb, uint32_t opcode) return 0; } -/* - a traverse function for pulling all relevent records from pulldb - */ -struct pulldb_data { - struct ctdb_context *ctdb; - struct ctdb_db_context *ctdb_db; - struct ctdb_marshall_buffer *pulldata; - uint32_t len; - uint32_t allocated_len; - bool failed; -}; - -static int traverse_pulldb(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *p) -{ - struct pulldb_data *params = (struct pulldb_data *)p; - struct ctdb_rec_data_old *rec; - struct ctdb_context *ctdb = params->ctdb; - struct ctdb_db_context *ctdb_db = params->ctdb_db; - - /* add the record to the blob */ - rec = ctdb_marshall_record(params->pulldata, 0, key, NULL, data); - if (rec == NULL) { - params->failed = true; - return -1; - } - if (params->len + rec->length >= params->allocated_len) { - params->allocated_len = rec->length + params->len + ctdb->tunable.pulldb_preallocation_size; - params->pulldata = talloc_realloc_size(NULL, params->pulldata, params->allocated_len); - } - if (params->pulldata == NULL) { - DEBUG(DEBUG_CRIT,(__location__ " Failed to expand pulldb_data to %u\n", rec->length + params->len)); - ctdb_fatal(params->ctdb, "failed to allocate memory for recovery. shutting down\n"); - } - params->pulldata->count++; - memcpy(params->len+(uint8_t *)params->pulldata, rec, rec->length); - params->len += rec->length; - - if (ctdb->tunable.db_record_size_warn != 0 && rec->length > ctdb->tunable.db_record_size_warn) { - DEBUG(DEBUG_ERR,("Data record in %s is big. Record size is %d bytes\n", ctdb_db->db_name, (int)rec->length)); - } - - talloc_free(rec); - - return 0; -} - -/* - pull a bunch of records from a ltdb, filtering by lmaster - */ -int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DATA *outdata) -{ - struct ctdb_pulldb *pull; - struct ctdb_db_context *ctdb_db; - struct pulldb_data params; - struct ctdb_marshall_buffer *reply; - - pull = (struct ctdb_pulldb *)indata.dptr; - - ctdb_db = find_ctdb_db(ctdb, pull->db_id); - if (!ctdb_db) { - DEBUG(DEBUG_ERR,(__location__ " Unknown db 0x%08x\n", pull->db_id)); - return -1; - } - - if (!ctdb_db_frozen(ctdb_db)) { - DEBUG(DEBUG_ERR, - ("rejecting ctdb_control_pull_db when not frozen\n")); - return -1; - } - - reply = talloc_zero(outdata, struct ctdb_marshall_buffer); - CTDB_NO_MEMORY(ctdb, reply); - - reply->db_id = pull->db_id; - - params.ctdb = ctdb; - params.ctdb_db = ctdb_db; - params.pulldata = reply; - params.len = offsetof(struct ctdb_marshall_buffer, data); - params.allocated_len = params.len; - params.failed = false; - - if (ctdb_db->unhealthy_reason) { - /* this is just a warning, as the tdb should be empty anyway */ - DEBUG(DEBUG_WARNING,("db(%s) unhealty in ctdb_control_pull_db: %s\n", - ctdb_db->db_name, ctdb_db->unhealthy_reason)); - } - - /* If the records are invalid, we are done */ - if (ctdb_db->invalid_records) { - goto done; - } - - if (ctdb_lockdb_mark(ctdb_db) != 0) { - DEBUG(DEBUG_ERR,(__location__ " Failed to get lock on entire db - failing\n")); - return -1; - } - - if (tdb_traverse_read(ctdb_db->ltdb->tdb, traverse_pulldb, ¶ms) == -1) { - DEBUG(DEBUG_ERR,(__location__ " Failed to get traverse db '%s'\n", ctdb_db->db_name)); - ctdb_lockdb_unmark(ctdb_db); - talloc_free(params.pulldata); - return -1; - } - - ctdb_lockdb_unmark(ctdb_db); - -done: - outdata->dptr = (uint8_t *)params.pulldata; - outdata->dsize = params.len; - - if (ctdb->tunable.db_record_count_warn != 0 && params.pulldata->count > ctdb->tunable.db_record_count_warn) { - DEBUG(DEBUG_ERR,("Database %s is big. Contains %d records\n", ctdb_db->db_name, params.pulldata->count)); - } - if (ctdb->tunable.db_size_warn != 0 && outdata->dsize > ctdb->tunable.db_size_warn) { - DEBUG(DEBUG_ERR,("Database %s is big. Contains %d bytes\n", ctdb_db->db_name, (int)outdata->dsize)); - } - - - return 0; -} - struct db_pull_state { struct ctdb_context *ctdb; struct ctdb_db_context *ctdb_db; @@ -446,100 +324,6 @@ done: return 0; } -/* - push a bunch of records into a ltdb, filtering by rsn - */ -int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata) -{ - struct ctdb_marshall_buffer *reply = (struct ctdb_marshall_buffer *)indata.dptr; - struct ctdb_db_context *ctdb_db; - unsigned int i; - int ret; - struct ctdb_rec_data_old *rec; - - if (indata.dsize < offsetof(struct ctdb_marshall_buffer, data)) { - DEBUG(DEBUG_ERR,(__location__ " invalid data in pulldb reply\n")); - return -1; - } - - ctdb_db = find_ctdb_db(ctdb, reply->db_id); - if (!ctdb_db) { - DEBUG(DEBUG_ERR,(__location__ " Unknown db 0x%08x\n", reply->db_id)); - return -1; - } - - if (!ctdb_db_frozen(ctdb_db)) { - DEBUG(DEBUG_ERR, - ("rejecting ctdb_control_push_db when not frozen\n")); - return -1; - } - - if (ctdb_lockdb_mark(ctdb_db) != 0) { - DEBUG(DEBUG_ERR,(__location__ " Failed to get lock on entire db - failing\n")); - return -1; - } - -- Samba Shared Repository