diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-06-07 16:44:24 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2017-06-19 15:44:14 +0200 |
commit | 1548ab99a2ae61315cf38ff982156bb3b9e61ca2 (patch) | |
tree | 1b36b762b9d72b71d4215f498be1beaf50936283 /ctdb/include | |
parent | 5304b7023df755a23a516a10a1c94f28f1446813 (diff) | |
download | samba-1548ab99a2ae61315cf38ff982156bb3b9e61ca2.tar.gz |
ctdb-locking: Reduce logging in case of contention
Currently, every lock helper will log a message if it cannot get a lock.
This can spam the logs and overwhelm syslog if there are hundreds of
lock helpers waiting for contended record.
Instead keep track of the record for which we have already logged once
with specific timeout interval. If we get timeout interval larger than
the previously logged interval, then log again once. This will reduce
the amount of logs for contended records to a single log entry per 10
seconds per record.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/include')
-rw-r--r-- | ctdb/include/ctdb_private.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 6c7dd7941b7..dd54f35689d 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -23,6 +23,8 @@ #include "ctdb_client.h" #include <sys/socket.h> +#include "common/db_hash.h" + /* array of tcp connections */ @@ -376,6 +378,7 @@ struct ctdb_db_context { struct lock_context *lock_current; struct lock_context *lock_pending; int lock_num_current; + struct db_hash_context *lock_log; struct ctdb_call_state *pending_calls; |