src/delta_lease.c | 120 +++++++++++++++++++++++++++++--------------------
src/delta_lease.h | 38 ++++++---------
src/direct.c | 36 ++++++++------
src/direct.h | 3 -
src/direct_lib.c | 7 ++
src/host_id.c | 67 ++++++++++++++++++++++-----
src/host_id.h | 1
src/main.c | 8 ++-
src/paxos_lease.c | 11 +---
src/sanlock_internal.h | 3 +
src/sanlock_rv.h | 3 -
11 files changed, 192 insertions(+), 105 deletions(-)
New commits:
commit 00f59855385474053dca7cc59bebd4c7c343aa94
Author: David Teigland <teigland(a)redhat.com>
Date: Fri Jun 10 17:31:32 2011 -0500
sanlock: use unique host name in delta leases
Also return an error for add_lockspace if we fail to
acquire the delta_lease (instead of retrying forever).
diff --git a/src/delta_lease.c b/src/delta_lease.c
index b5624c1..6806f94 100644
--- a/src/delta_lease.c
+++ b/src/delta_lease.c
@@ -76,7 +76,6 @@ static int verify_leader(struct sync_disk *disk,
const char *caller)
{
struct leader_record leader_rr;
- char resource_name[NAME_ID_SIZE];
uint32_t sum;
int result, rv;
@@ -112,18 +111,6 @@ static int verify_leader(struct sync_disk *disk,
goto fail;
}
- memset(resource_name, 0, NAME_ID_SIZE);
- snprintf(resource_name, NAME_ID_SIZE, "host_id_%llu",
- (unsigned long long)host_id);
-
- if (strncmp(lr->resource_name, resource_name, NAME_ID_SIZE)) {
- log_error("verify_leader %llu wrong resource name %.48s %.48s %s",
- (unsigned long long)host_id,
- lr->resource_name, resource_name, disk->path);
- result = SANLK_LEADER_RESOURCE;
- goto fail;
- }
-
sum = leader_checksum(lr);
if (lr->checksum != sum) {
@@ -202,19 +189,26 @@ static int delta_lease_leader_reap(struct task *task,
return error;
}
-/* TODO: do we need to set the watchdog to expire in host_dead_seconds just
- * before we do the write here? The algorithm depends on io timeouts to
- * protect against this write happening at a latest possible time, but since
- * our ios don't ever really timeout reliably, we need to timeout in
- * host_dead_seconds.
- * And can we touch the watchdog immediately after the write, or do we
- * need to wait for the read to complete also? */
+/*
+ * delta_lease_acquire:
+ * set the owner of host_id to our_host_name.
+ *
+ * paxos_lease_acquire:
+ * set the owner of resource_name to host_id.
+ *
+ * our_host_name is a unique host identifier used to detect when two different
+ * hosts are trying to acquire the same host_id (since both will be using the
+ * same host_id, that host_id won't work to distinguish between them.) We copy
+ * our_host_name into leader.resource_name, so in a sense the owner_id and
+ * resource_name fields of the leader_record switch functions: the common
+ * resource is the ower_id, and the distinguishing id is the resource_name.
+ */
int delta_lease_acquire(struct task *task,
struct space *sp,
struct sync_disk *disk,
char *space_name,
- uint64_t our_host_id,
+ char *our_host_name,
uint64_t host_id,
struct leader_record *leader_ret)
{
@@ -230,7 +224,6 @@ int delta_lease_acquire(struct task *task,
if (error < 0)
return error;
- retry:
if (leader.timestamp == LEASE_FREE)
goto write_new;
@@ -260,8 +253,11 @@ int delta_lease_acquire(struct task *task,
while (1) {
memcpy(&leader1, &leader, sizeof(struct leader_record));
- log_space(sp, "delta_acquire delta_large_delay %d delay %d",
- delta_large_delay, delay);
+ /* TODO: we could reread every several seconds to see if
+ it has changed, so we can abort more quickly if so */
+
+ log_space(sp, "delta_acquire %llu delta_large_delay %d delay %d",
+ (unsigned long long)host_id, delta_large_delay, delay);
sleep(delay);
error = delta_lease_leader_read(task, disk, space_name, host_id,
@@ -275,25 +271,40 @@ int delta_lease_acquire(struct task *task,
if (leader.timestamp == LEASE_FREE)
break;
- /* TODO: fail and return an error? */
+ log_erros(sp, "delta_acquire %llu busy %llu %llu %llu %.48s",
+ (unsigned long long)host_id,
+ (unsigned long long)leader.owner_id,
+ (unsigned long long)leader.owner_generation,
+ (unsigned long long)leader.timestamp,
+ leader.resource_name);
+ return SANLK_HOSTID_BUSY;
}
write_new:
new_ts = time(NULL);
leader.timestamp = new_ts;
- leader.owner_id = our_host_id;
+ leader.owner_id = host_id;
leader.owner_generation++;
+ snprintf(leader.resource_name, NAME_ID_SIZE, "%s", our_host_name);
leader.checksum = leader_checksum(&leader);
- log_space(sp, "delta_acquire write new %llu", (unsigned long long)new_ts);
+ log_space(sp, "delta_acquire %llu write %llu %llu %llu %.48s",
+ (unsigned long long)host_id,
+ (unsigned long long)leader.owner_id,
+ (unsigned long long)leader.owner_generation,
+ (unsigned long long)leader.timestamp,
+ leader.resource_name);
error = write_sector(disk, host_id - 1, (char *)&leader, sizeof(struct
leader_record),
task, "delta_leader");
if (error < 0)
return error;
+ memcpy(&leader1, &leader, sizeof(struct leader_record));
+
delay = 2 * task->io_timeout_seconds;
- log_space(sp, "delta_acquire delta_short_delay %d", delay);
+ log_space(sp, "delta_acquire %llu delta_short_delay %d",
+ (unsigned long long)host_id, delay);
sleep(delay);
error = delta_lease_leader_read(task, disk, space_name, host_id, &leader,
@@ -301,32 +312,39 @@ int delta_lease_acquire(struct task *task,
if (error < 0)
return error;
- if ((leader.timestamp != new_ts) || (leader.owner_id != our_host_id))
- goto retry;
+ if (memcmp(&leader1, &leader, sizeof(struct leader_record))) {
+ log_erros(sp, "delta_acquire %llu busy %llu %llu %llu %.48s",
+ (unsigned long long)host_id,
+ (unsigned long long)leader.owner_id,
+ (unsigned long long)leader.owner_generation,
+ (unsigned long long)leader.timestamp,
+ leader.resource_name);
+ return SANLK_HOSTID_BUSY;
+ }
memcpy(leader_ret, &leader, sizeof(struct leader_record));
return SANLK_OK;
}
-/* our_host_id and host_id will always be the same, i.e. we
- only ever try to acquire/renew our own host_id */
-
int delta_lease_renew(struct task *task,
struct space *sp,
struct sync_disk *disk,
char *space_name,
- uint64_t our_host_id,
- uint64_t our_host_id_generation,
- uint64_t host_id,
int prev_result,
struct leader_record *leader_last,
struct leader_record *leader_ret)
{
struct leader_record leader;
+ uint64_t host_id;
uint64_t new_ts;
int io_timeout_save;
int error;
+ if (!leader_last)
+ return -EINVAL;
+
+ host_id = leader_last->owner_id;
+
/* if the previous renew timed out in this initial read, and that read
is now complete, we can use that result here instead of discarding
it and doing another. */
@@ -335,7 +353,8 @@ int delta_lease_renew(struct task *task,
error = delta_lease_leader_reap(task, disk, space_name, host_id,
&leader, "delta_renew_reap");
- log_space(sp, "delta_renew reap %d", error);
+ log_space(sp, "delta_renew %llu reap %d",
+ (unsigned long long)host_id, error);
if (error == SANLK_OK) {
task->read_timeout = NULL;
@@ -351,11 +370,14 @@ int delta_lease_renew(struct task *task,
return error;
read_done:
- if (!our_host_id_generation)
- our_host_id_generation = leader.owner_generation;
-
- if (leader.owner_id != our_host_id ||
- leader.owner_generation != our_host_id_generation) {
+ /* We can't always memcmp(&leader, leader_last) because previous writes
+ may have timed out and we don't know if they were actually written
+ or not. We can definately verify that we're still the owner,
+ though, which is the main thing we need to know. */
+
+ if (leader.owner_id != leader_last->owner_id ||
+ leader.owner_generation != leader_last->owner_generation ||
+ memcmp(leader.resource_name, leader_last->resource_name, NAME_ID_SIZE)) {
log_erros(sp, "delta_renew %llu not owner", (unsigned long long)host_id);
log_leader_error(0, space_name, host_id, disk, leader_last,
"delta_renew_last");
log_leader_error(0, space_name, host_id, disk, &leader,
"delta_renew_read");
@@ -380,9 +402,9 @@ int delta_lease_renew(struct task *task,
leader.checksum = leader_checksum(&leader);
/* extend io timeout for this one write; we need to give this write
- * every chance to succeed, and there's no point in letting it time
- * out. there's nothing we would do but retry it, and timing out and
- * retrying unnecessarily would probably be counter productive. */
+ every chance to succeed, and there's no point in letting it time
+ out. there's nothing we would do but retry it, and timing out and
+ retrying unnecessarily would probably be counter productive. */
io_timeout_save = task->io_timeout_seconds;
task->io_timeout_seconds = task->host_dead_seconds;
@@ -430,13 +452,18 @@ int delta_lease_release(struct task *task,
struct space *sp,
struct sync_disk *disk,
char *space_name GNUC_UNUSED,
- uint64_t host_id,
struct leader_record *leader_last,
struct leader_record *leader_ret)
{
struct leader_record leader;
+ uint64_t host_id;
int error;
+ if (!leader_last)
+ return -EINVAL;
+
+ host_id = leader_last->owner_id;
+
log_space(sp, "delta_release %llu begin", (unsigned long long)host_id);
memcpy(&leader, leader_last, sizeof(struct leader_record));
@@ -491,7 +518,6 @@ int delta_lease_init(struct task *task,
leader->max_hosts = 1;
leader->timestamp = LEASE_FREE;
strncpy(leader->space_name, space_name, NAME_ID_SIZE);
- snprintf(leader->resource_name, NAME_ID_SIZE, "host_id_%d", i+1);
leader->checksum = leader_checksum(leader);
}
diff --git a/src/delta_lease.h b/src/delta_lease.h
index b264286..9206c76 100644
--- a/src/delta_lease.h
+++ b/src/delta_lease.h
@@ -17,31 +17,27 @@ int delta_lease_leader_read(struct task *task,
const char *caller);
int delta_lease_acquire(struct task *task,
- struct space *sp,
- struct sync_disk *disk,
- char *space_name,
- uint64_t our_host_id,
- uint64_t host_id,
- struct leader_record *leader_ret);
+ struct space *sp,
+ struct sync_disk *disk,
+ char *space_name,
+ char *our_host_name,
+ uint64_t host_id,
+ struct leader_record *leader_ret);
int delta_lease_renew(struct task *task,
- struct space *sp,
- struct sync_disk *disk,
- char *space_name,
- uint64_t our_host_id,
- uint64_t our_host_id_generation,
- uint64_t host_id,
- int prev_result,
- struct leader_record *leader_last,
- struct leader_record *leader_ret);
+ struct space *sp,
+ struct sync_disk *disk,
+ char *space_name,
+ int prev_result,
+ struct leader_record *leader_last,
+ struct leader_record *leader_ret);
int delta_lease_release(struct task *task,
- struct space *sp,
- struct sync_disk *disk,
- char *space_name,
- uint64_t host_id,
- struct leader_record *leader_last,
- struct leader_record *leader_ret);
+ struct space *sp,
+ struct sync_disk *disk,
+ char *space_name GNUC_UNUSED,
+ struct leader_record *leader_last,
+ struct leader_record *leader_ret);
int delta_lease_init(struct task *task,
struct sync_disk *disk,
diff --git a/src/direct.c b/src/direct.c
index 280c5c7..50d5cbf 100644
--- a/src/direct.c
+++ b/src/direct.c
@@ -185,6 +185,7 @@ static int do_delta_action(int action,
struct task *task,
struct sanlk_lockspace *ls,
int max_hosts,
+ char *our_host_name,
struct leader_record *leader_ret)
{
struct leader_record leader;
@@ -214,16 +215,20 @@ static int do_delta_action(int action,
case ACT_ACQUIRE_ID:
rv = delta_lease_acquire(task, &space, &sd,
ls->name,
- ls->host_id,
+ our_host_name,
ls->host_id,
&leader);
break;
case ACT_RENEW_ID:
+ rv = delta_lease_leader_read(task, &sd,
+ ls->name,
+ ls->host_id,
+ &leader,
+ "direct_renew");
+ if (rv < 0)
+ return rv;
rv = delta_lease_renew(task, &space, &sd,
ls->name,
- ls->host_id,
- 0, /* local_host_generaion */
- ls->host_id,
-1,
&leader,
&leader);
@@ -238,8 +243,8 @@ static int do_delta_action(int action,
return rv;
rv = delta_lease_release(task, &space, &sd,
ls->name,
- ls->host_id,
- &leader, &leader);
+ &leader,
+ &leader);
break;
case ACT_READ_ID:
case ACT_READ_LEADER:
@@ -269,19 +274,20 @@ static int do_delta_action(int action,
* sanlock client add_lockspace|rem_lockspace -s LOCKSPACE
*/
-int direct_acquire_id(struct task *task, struct sanlk_lockspace *ls)
+int direct_acquire_id(struct task *task, struct sanlk_lockspace *ls,
+ char *our_host_name)
{
- return do_delta_action(ACT_ACQUIRE_ID, task, ls, -1, NULL);
+ return do_delta_action(ACT_ACQUIRE_ID, task, ls, -1, our_host_name, NULL);
}
int direct_release_id(struct task *task, struct sanlk_lockspace *ls)
{
- return do_delta_action(ACT_RELEASE_ID, task, ls, -1, NULL);
+ return do_delta_action(ACT_RELEASE_ID, task, ls, -1, NULL, NULL);
}
int direct_renew_id(struct task *task, struct sanlk_lockspace *ls)
{
- return do_delta_action(ACT_RENEW_ID, task, ls, -1, NULL);
+ return do_delta_action(ACT_RENEW_ID, task, ls, -1, NULL, NULL);
}
int direct_read_id(struct task *task,
@@ -295,7 +301,7 @@ int direct_read_id(struct task *task,
memset(&leader, 0, sizeof(struct leader_record));
- rv = do_delta_action(ACT_READ_ID, task, ls, -1, &leader);
+ rv = do_delta_action(ACT_READ_ID, task, ls, -1, NULL, &leader);
*timestamp = leader.timestamp;
*owner_id = leader.owner_id;
@@ -316,7 +322,7 @@ int direct_live_id(struct task *task,
time_t start;
int rv;
- rv = do_delta_action(ACT_READ_ID, task, ls, -1, &leader_begin);
+ rv = do_delta_action(ACT_READ_ID, task, ls, -1, NULL, &leader_begin);
if (rv < 0)
return rv;
@@ -325,7 +331,7 @@ int direct_live_id(struct task *task,
while (1) {
sleep(1);
- rv = do_delta_action(ACT_READ_ID, task, ls, -1, &leader);
+ rv = do_delta_action(ACT_READ_ID, task, ls, -1, NULL, &leader);
if (rv < 0)
return rv;
@@ -381,7 +387,7 @@ int direct_init(struct task *task,
int rv = -1;
if (ls && ls->host_id_disk.path[0]) {
- rv = do_delta_action(ACT_INIT, task, ls, max_hosts, NULL);
+ rv = do_delta_action(ACT_INIT, task, ls, max_hosts, NULL, NULL);
} else if (res) {
if (!num_hosts)
@@ -411,7 +417,7 @@ int direct_read_leader(struct task *task,
int rv = -1;
if (ls && ls->host_id_disk.path[0])
- rv = do_delta_action(ACT_READ_LEADER, task, ls, -1, leader_ret);
+ rv = do_delta_action(ACT_READ_LEADER, task, ls, -1, NULL, leader_ret);
else if (res)
rv = do_paxos_action(ACT_READ_LEADER, task, res,
diff --git a/src/direct.h b/src/direct.h
index 952cc00..a4af3b8 100644
--- a/src/direct.h
+++ b/src/direct.h
@@ -20,7 +20,8 @@ int direct_release(struct task *task,
struct sanlk_resource *res,
struct leader_record *leader_ret);
-int direct_acquire_id(struct task *task, struct sanlk_lockspace *ls);
+int direct_acquire_id(struct task *task, struct sanlk_lockspace *ls,
+ char *our_host_name);
int direct_release_id(struct task *task, struct sanlk_lockspace *ls);
int direct_renew_id(struct task *task, struct sanlk_lockspace *ls);
diff --git a/src/direct_lib.c b/src/direct_lib.c
index 50c75b2..fa26736 100644
--- a/src/direct_lib.c
+++ b/src/direct_lib.c
@@ -35,6 +35,13 @@ int host_id_disk_info(char *name GNUC_UNUSED, struct sync_disk *disk
GNUC_UNUSED
return -1;
}
+int get_rand(int a, int b);
+
+int get_rand(int a, int b)
+{
+ return a + (int) (((float)(b - a + 1)) * random() / (RAND_MAX+1.0));
+}
+
static void setup_task_lib(struct task *task, int use_aio, int io_timeout_sec)
{
memset(task, 0, sizeof(struct task));
diff --git a/src/host_id.c b/src/host_id.c
index 3075d3f..3586d34 100644
--- a/src/host_id.c
+++ b/src/host_id.c
@@ -21,6 +21,7 @@
#include <syslog.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <sys/utsname.h>
#include "sanlock_internal.h"
#include "diskio.h"
@@ -33,6 +34,10 @@
static unsigned int space_id_counter = 1;
+static struct random_data rand_data;
+static char rand_state[32];
+static pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER;
+
struct list_head spaces;
struct list_head spaces_add;
struct list_head spaces_rem;
@@ -195,9 +200,7 @@ static void *lockspace_thread(void *arg_in)
{
struct task task;
struct space *sp;
- char space_name[NAME_ID_SIZE];
struct leader_record leader;
- uint64_t our_host_id, our_host_id_generation;
time_t last_attempt, last_success;
int rv, result, delta_length, gap;
int delta_result = 0;
@@ -205,8 +208,6 @@ static void *lockspace_thread(void *arg_in)
int stop = 0;
sp = (struct space *)arg_in;
- our_host_id = sp->host_id;
- memcpy(&space_name, sp->space_name, NAME_ID_SIZE);
setup_task_timeouts(&task, main_task.io_timeout_seconds);
setup_task_aio(&task, main_task.use_aio, HOSTID_AIO_CB_SIZE);
@@ -222,8 +223,9 @@ static void *lockspace_thread(void *arg_in)
}
opened = 1;
- result = delta_lease_acquire(&task, sp, &sp->host_id_disk, space_name,
- our_host_id, our_host_id, &leader);
+ result = delta_lease_acquire(&task, sp, &sp->host_id_disk,
+ sp->space_name, our_host_name_global,
+ sp->host_id, &leader);
delta_result = result;
delta_length = time(NULL) - last_attempt;
@@ -257,7 +259,6 @@ static void *lockspace_thread(void *arg_in)
goto out;
sp->host_generation = leader.owner_generation;
- our_host_id_generation = leader.owner_generation;
while (1) {
if (stop)
@@ -282,9 +283,8 @@ static void *lockspace_thread(void *arg_in)
last_attempt = time(NULL);
result = delta_lease_renew(&task, sp, &sp->host_id_disk,
- space_name, our_host_id,
- our_host_id_generation, our_host_id,
- delta_result, &leader, &leader);
+ sp->space_name, delta_result,
+ &leader, &leader);
delta_result = result;
delta_length = time(NULL) - last_attempt;
@@ -324,8 +324,8 @@ static void *lockspace_thread(void *arg_in)
close_watchdog_file(sp);
out:
if (delta_result == SANLK_OK)
- delta_lease_release(&task, sp, &sp->host_id_disk, space_name,
- our_host_id, &leader, &leader);
+ delta_lease_release(&task, sp, &sp->host_id_disk,
+ sp->space_name, &leader, &leader);
if (opened)
close(sp->host_id_disk.fd);
@@ -550,10 +550,53 @@ void free_lockspaces(int wait)
pthread_mutex_unlock(&spaces_mutex);
}
+/* return a random int between a and b inclusive */
+
+int get_rand(int a, int b)
+{
+ int32_t val;
+ int rv;
+
+ pthread_mutex_lock(&rand_mutex);
+ rv = random_r(&rand_data, &val);
+ pthread_mutex_unlock(&rand_mutex);
+ if (rv < 0)
+ return rv;
+
+ return a + (int) (((float)(b - a + 1)) * val / (RAND_MAX+1.0));
+}
+
void setup_spaces(void)
{
+ struct utsname name;
+ struct timeval tv;
+
INIT_LIST_HEAD(&spaces);
INIT_LIST_HEAD(&spaces_add);
INIT_LIST_HEAD(&spaces_rem);
+
+ memset(rand_state, 0, sizeof(rand_state));
+ memset(&rand_data, 0, sizeof(rand_data));
+
+ initstate_r(time(NULL), rand_state, sizeof(rand_state), &rand_data);
+
+ /* use host name from command line */
+
+ if (com.our_host_name[0]) {
+ memcpy(our_host_name_global, com.our_host_name, SANLK_NAME_LEN);
+ return;
+ }
+
+ /* make up something that's likely to be different among hosts */
+
+ memset(&our_host_name_global, 0, sizeof(our_host_name_global));
+ uname(&name);
+ gettimeofday(&tv, NULL);
+
+ snprintf(our_host_name_global, NAME_ID_SIZE, "%llu.%llu.%d.%s",
+ (unsigned long long)tv.tv_sec,
+ (unsigned long long)tv.tv_usec,
+ get_rand(1, RAND_MAX-1),
+ name.nodename);
}
diff --git a/src/host_id.h b/src/host_id.h
index 5cc8b50..703cb3f 100644
--- a/src/host_id.h
+++ b/src/host_id.h
@@ -18,5 +18,6 @@ int add_lockspace(struct sanlk_lockspace *ls);
int rem_lockspace(struct sanlk_lockspace *ls);
void free_lockspaces(int wait);
void setup_spaces(void);
+int get_rand(int a, int b);
#endif
diff --git a/src/main.c b/src/main.c
index 5ac6c54..e75e320 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1511,11 +1511,13 @@ static int print_daemon_state(char *str)
memset(str, 0, SANLK_STATE_MAXSTR);
snprintf(str, SANLK_STATE_MAXSTR-1,
+ "our_host_name=%s "
"use_aio=%d "
"io_timeout=%d "
"id_renewal=%d "
"id_renewal_fail=%d "
"id_renewal_warn=%d",
+ our_host_name_global,
main_task.use_aio,
main_task.io_timeout_seconds,
main_task.id_renewal_seconds,
@@ -2623,6 +2625,9 @@ static int read_command_line(int argc, char *argv[])
case 'p':
com.pid = atoi(optionarg);
break;
+ case 'e':
+ strncpy(com.our_host_name, optionarg, NAME_ID_SIZE);
+ break;
case 'i':
com.local_host_id = atoll(optionarg);
break;
@@ -2888,7 +2893,8 @@ static int do_direct(void)
break;
case ACT_ACQUIRE_ID:
- rv = direct_acquire_id(&main_task, &com.lockspace);
+ rv = direct_acquire_id(&main_task, &com.lockspace,
+ com.our_host_name);
log_tool("acquire_id done %d", rv);
break;
diff --git a/src/paxos_lease.c b/src/paxos_lease.c
index e842b93..82010db 100644
--- a/src/paxos_lease.c
+++ b/src/paxos_lease.c
@@ -963,13 +963,6 @@ static int paxos_lease_leader_dblock_read(struct task *task,
return rv;
}
-/* return a random int between a and b inclusive */
-
-static int get_rand(int a, int b)
-{
- return a + (int) (((float)(b - a + 1)) * random() / (RAND_MAX+1.0));
-}
-
static int write_new_leader(struct task *task,
struct token *token,
struct leader_record *nl,
@@ -1287,9 +1280,13 @@ int paxos_lease_acquire(struct task *task,
if (error == SANLK_DBLOCK_MBAL) {
us = get_rand(0, 1000000);
+ if (us < 0)
+ us = token->host_id * 100;
+
/* not a problem, but interesting to see, so use log_error */
log_errot(token, "paxos_acquire %llu retry delay %d us",
(unsigned long long)next_lver, us);
+
usleep(us);
our_mbal += cur_leader.max_hosts;
goto retry_ballot;
diff --git a/src/sanlock_internal.h b/src/sanlock_internal.h
index 6201085..560bbda 100644
--- a/src/sanlock_internal.h
+++ b/src/sanlock_internal.h
@@ -480,6 +480,7 @@ struct command_line {
int num_hosts; /* -n */
int max_hosts; /* -m */
int res_count;
+ char our_host_name[SANLK_NAME_LEN+1];
char *dump_path;
struct sanlk_lockspace lockspace; /* -s LOCKSPACE */
struct sanlk_resource *res_args[SANLK_MAX_RESOURCES]; /* -r RESOURCE */
@@ -513,5 +514,7 @@ enum {
ACT_READ_LEADER,
};
+EXTERN char our_host_name_global[SANLK_NAME_LEN+1];
+
#endif
diff --git a/src/sanlock_rv.h b/src/sanlock_rv.h
index 6b0510f..9683477 100644
--- a/src/sanlock_rv.h
+++ b/src/sanlock_rv.h
@@ -47,9 +47,10 @@
#define SANLK_RELEASE_LVER -250
#define SANLK_RELEASE_OWNER -251
-/* delta_lease_renew */
+/* delta_lease_renew, delta_lease_acquire */
#define SANLK_RENEW_OWNER -260
#define SANLK_RENEW_DIFF -261
+#define SANLK_HOSTID_BUSY -262
#endif