*/
struct pulldb_data {
struct ctdb_context *ctdb;
+ struct ctdb_db_context *ctdb_db;
struct ctdb_marshall_buffer *pulldata;
uint32_t len;
bool failed;
{
struct pulldb_data *params = (struct pulldb_data *)p;
struct ctdb_rec_data *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);
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;
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.failed = false;
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;
}
{ "HopcountMakeSticky", 50, offsetof(struct ctdb_tunable, hopcount_make_sticky) },
{ "StickyDuration", 600, offsetof(struct ctdb_tunable, sticky_duration) },
{ "StickyPindown", 200, offsetof(struct ctdb_tunable, sticky_pindown) },
- { "NoIPTakeover", 0, offsetof(struct ctdb_tunable, no_ip_takeover), false }
+ { "NoIPTakeover", 0, offsetof(struct ctdb_tunable, no_ip_takeover), false },
+ { "DBRecordCountWarn", 100000, offsetof(struct ctdb_tunable, db_record_count_warn), false },
+ { "DBRecordSizeWarn", 10000000, offsetof(struct ctdb_tunable, db_record_size_warn), false },
+ { "DBSizeWarn", 100000000, offsetof(struct ctdb_tunable, db_size_warn), false }
};
/*