This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
commit a239c898c12a92cb5fb74f0eb74bc5919db45b94
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Dec 8 17:48:02 2023 -0600
sanlock: skip short delay in delta lease reacquire
When a host with the same host name reacquires the
same host_id, the "fast" delta lease reacquire was
still applying the short delay (default 20s) which
should not be necessary. Reduce this further to
just 1 second when the lease is also free.
---
src/delta_lease.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/delta_lease.c b/src/delta_lease.c
index 9d5aafd..d36d4e0 100644
--- a/src/delta_lease.c
+++ b/src/delta_lease.c
@@ -340,6 +340,7 @@ int delta_lease_acquire(struct task *task,
uint32_t checksum;
int other_io_timeout, other_host_dead_seconds, other_id_renewal_seconds;
int i, error, rv, delay, delta_large_delay;
+ int fast_free_delay = 0;
log_space(sp, "delta_acquire begin %.48s:%llu",
sp->space_name, (unsigned long long)host_id);
@@ -361,6 +362,19 @@ int delta_lease_acquire(struct task *task,
leader.io_timeout, sp->io_timeout);
}
+ /*
+ * This delay-free reacquire could probably be used whenever
+ * our_host_name matches the current leader.resource_name,
+ * regardless of wheter the lease is free (i.e. we cleanly
+ * released the lease last time we held it.)
+ */
+ if (!strncmp(leader.resource_name, our_host_name, NAME_ID_SIZE) &&
+ (leader.timestamp == LEASE_FREE)) {
+ log_space(sp, "delta_acquire free fast reacquire");
+ fast_free_delay = 1;
+ goto write_new;
+ }
+
if (leader.timestamp == LEASE_FREE)
goto write_new;
@@ -475,7 +489,10 @@ int delta_lease_acquire(struct task *task,
memcpy(&leader1, &leader, sizeof(struct leader_record));
- delay = 2 * other_io_timeout;
+ if (fast_free_delay)
+ delay = 1;
+ else
+ delay = 2 * other_io_timeout;
log_space(sp, "delta_acquire delta_short_delay %d", delay);
for (i = 0; i < delay; i++) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date