Everytime we give a delegation to another node we count this as one delegation.
If the same record is delegated to several nodes we count one for each node.
Everytime a record has all its delegations revoked we count this as one revoke.
(This used to be ctdb commit
b098bcf8007be63889aaed640a951b0eeaa9d191)
uint32_t num_recoveries;
struct timeval statistics_start_time;
struct timeval statistics_current_time;
+ uint32_t total_ro_delegations;
+ uint32_t total_ro_revokes;
};
/*
if (header.flags & CTDB_REC_RO_REVOKE_COMPLETE) {
header.flags &= ~(CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE);
+ CTDB_INCREMENT_STAT(ctdb, total_ro_revokes);
if (ctdb_ltdb_store(ctdb_db, call->key, &header, data) != 0) {
ctdb_fatal(ctdb, "Failed to write header with cleared REVOKE flag");
}
}
ctdb_queue_packet(ctdb, &r->hdr);
+ CTDB_INCREMENT_STAT(ctdb, total_ro_delegations);
talloc_free(r);
return;
if (header.flags & CTDB_REC_RO_REVOKE_COMPLETE) {
header.flags &= ~(CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE);
+ CTDB_INCREMENT_STAT(ctdb, total_ro_revokes);
if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
ctdb_fatal(ctdb, "Failed to write header with cleared REVOKE flag");
}
STATISTICS_FIELD(pending_childwrite_calls),
STATISTICS_FIELD(memory_used),
STATISTICS_FIELD(max_hop_count),
+ STATISTICS_FIELD(total_ro_delegations),
+ STATISTICS_FIELD(total_ro_revokes),
};
tmp = s->statistics_current_time.tv_sec - s->statistics_start_time.tv_sec;
seconds = tmp%60;