ctdb-locking: Reduce logging in case of contention
authorAmitay Isaacs <amitay@gmail.com>
Wed, 7 Jun 2017 06:44:24 +0000 (16:44 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 19 Jun 2017 13:44:14 +0000 (15:44 +0200)
commit1548ab99a2ae61315cf38ff982156bb3b9e61ca2
tree1b36b762b9d72b71d4215f498be1beaf50936283
parent5304b7023df755a23a516a10a1c94f28f1446813
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>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_lock.c
ctdb/server/ctdb_ltdb_server.c