cluster: RHEL48 - rgmanager: halvm: Check ownership before stripping tags
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: eeb82f2666b3fff9669a6956d4e0e27d40b1d47c
Parent: 26a1b3ec5c6831fda8e46f5e0ff133c5605f91eb
Author: Jonathan E. Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Jan 25 17:56:41 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Aug 13 17:47:55 2010 -0400
rgmanager: halvm: Check ownership before stripping tags
Resolves: rhbz#624165
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/lvm_by_lv.sh | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
index 6691181..1937b9f 100644
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ b/rgmanager/src/resources/lvm_by_lv.sh
@@ -218,6 +218,15 @@ lv_activate_and_tag()
ocf_log err "Unable to delete tag from $lv_path"
return $OCF_ERR_GENERIC
fi
+
+ if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then
+ ocf_log notice "Removing ownership tag ($tag) from $lv_path"
+ lvchange --deltag $tag $lv_path
+ if [ $? -ne 0 ]; then
+ ocf_log err "Unable to delete tag from $lv_path"
+ return $OCF_ERR_GENERIC
+ fi
+ fi
fi
return $OCF_SUCCESS
13 years, 8 months
cluster: RHEL47 - rgmanager: halvm: Check ownership before stripping tags
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 60994d6844f4bd921c88e7a0f6a5fcb2252aea0f
Parent: a3a98947a6a289d95f95c143132a3b9054d57b2e
Author: Jonathan E. Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Jan 25 17:56:41 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Aug 13 17:48:24 2010 -0400
rgmanager: halvm: Check ownership before stripping tags
Resolves: rhbz#624164
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/lvm_by_lv.sh | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
index 6691181..1937b9f 100644
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ b/rgmanager/src/resources/lvm_by_lv.sh
@@ -218,6 +218,15 @@ lv_activate_and_tag()
ocf_log err "Unable to delete tag from $lv_path"
return $OCF_ERR_GENERIC
fi
+
+ if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then
+ ocf_log notice "Removing ownership tag ($tag) from $lv_path"
+ lvchange --deltag $tag $lv_path
+ if [ $? -ne 0 ]; then
+ ocf_log err "Unable to delete tag from $lv_path"
+ return $OCF_ERR_GENERIC
+ fi
+ fi
fi
return $OCF_SUCCESS
13 years, 8 months
cluster: RHEL6 - gfs_controld: fix plock owner syncing
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: aa4bde63a2307636f5f64c03082aab80eb6dd27e
Parent: 4de775010f746bf2369e6d4904bc4439769ffb56
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:50:31 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:50:31 2010 -0500
gfs_controld: fix plock owner syncing
- The R_GOT_UNOWN flag was not always being set on resources when
the owner was set to 0. This would cause subsequent syncing of
plock state to write the incorrect owner into the checkpoint.
bz 617306
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/gfs_controld/plock.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c
index 710e73a..e487d41 100644
--- a/group/gfs_controld/plock.c
+++ b/group/gfs_controld/plock.c
@@ -1692,10 +1692,13 @@ static int unpack_section_buf(struct mountgroup *mg, char *numbuf, int buflen)
INIT_LIST_HEAD(&r->waiters);
INIT_LIST_HEAD(&r->pending);
- if (cfgd_plock_ownership)
+ if (cfgd_plock_ownership) {
sscanf(numbuf, "r%llu.%d", &num, &owner);
- else
+ if (!owner)
+ r->flags |= R_GOT_UNOWN;
+ } else {
sscanf(numbuf, "r%llu", &num);
+ }
r->number = num;
r->owner = owner;
@@ -2175,6 +2178,7 @@ void purge_plocks(struct mountgroup *mg, int nodeid, int unmount)
if (r->owner == nodeid) {
r->owner = 0;
+ r->flags |= R_GOT_UNOWN;
send_pending_plocks(mg, r);
}
13 years, 8 months
dlm: master - dlm_controld: ignore plocks until checkpoint time
by David Teigland
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=2a7c1503...
Commit: 2a7c15034a0101d9bb8948f1b40fc70728a79419
Parent: b5e48c2ee2af3440bb9f348536042aff45660d3f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:05:18 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:20:19 2010 -0500
dlm_controld: ignore plocks until checkpoint time
After our join confchg, we need to ignore plock messages
until the point in time where the ckpt_node saves plock
state (final start message received). At that time we need
to shift from ignoring plock messages to saving plock
messages that will be applied on top of the plock state that
is read from the checkpoint. The code was not ignoring
plock messages during the first stage of the process, which
led to incorrect plock state.
bz 623810
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 35 +++++++++++++++++++++++++++++++++++
group/dlm_controld/plock.c | 10 +++++++---
2 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 2e5a1bb..9b0d223 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1099,6 +1099,10 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
"need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
hd->msgdata2, ls->need_plocks);
+ log_plock(ls, "receive_plocks_stored %d:%u flags %x sig %x "
+ "need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
+ hd->msgdata2, ls->need_plocks);
+
ls->last_plock_sig = hd->msgdata2;
if (!ls->need_plocks)
@@ -1269,6 +1273,8 @@ static void prepare_plocks(struct lockspace *ls)
struct member *memb;
uint32_t sig;
+ log_plock(ls, "prepare_plocks");
+
if (!cfgd_enable_plock || ls->disable_plock)
return;
@@ -1569,6 +1575,12 @@ static void dlm_header_in(struct dlm_header *hd)
hd->msgdata2 = le32_to_cpu(hd->msgdata2);
}
+/* after our join confchg, we want to ignore plock messages (see need_plocks
+ checks below) until the point in time where the ckpt_node saves plock
+ state (final start message received); at this time we want to shift from
+ ignoring plock messages to saving plock messages to apply on top of the
+ plock state that we read. */
+
static void deliver_cb(cpg_handle_t handle,
const struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid,
@@ -1576,6 +1588,7 @@ static void deliver_cb(cpg_handle_t handle,
{
struct lockspace *ls;
struct dlm_header *hd;
+ int ignore_plock;
ls = find_ls_handle(handle);
if (!ls) {
@@ -1606,6 +1619,8 @@ static void deliver_cb(cpg_handle_t handle,
return;
}
+ ignore_plock = 0;
+
switch (hd->type) {
case DLM_MSG_START:
receive_start(ls, hd, len);
@@ -1614,6 +1629,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock)
receive_plock(ls, hd, len);
else
@@ -1624,6 +1643,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_OWN:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_own(ls, hd, len);
else
@@ -1635,6 +1658,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_DROP:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_drop(ls, hd, len);
else
@@ -1647,6 +1674,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_SYNC_WAITER:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_sync(ls, hd, len);
else
@@ -1701,6 +1732,10 @@ static void deliver_cb(cpg_handle_t handle,
log_error("unknown msg type %d", hd->type);
}
+ if (ignore_plock)
+ log_plock(ls, "msg %s nodeid %d need_plock ignore",
+ msg_name(hd->type), nodeid);
+
apply_changes(ls);
}
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index e292e95..41b0423 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1562,11 +1562,12 @@ void process_saved_plocks(struct lockspace *ls)
{
struct save_msg *sm, *sm2;
struct dlm_header *hd;
+ int count = 0;
- if (list_empty(&ls->saved_messages))
- return;
+ log_plock(ls, "process_saved_plocks begin");
- log_plock(ls, "process_saved_plocks");
+ if (list_empty(&ls->saved_messages))
+ goto out;
list_for_each_entry_safe(sm, sm2, &ls->saved_messages, list) {
hd = (struct dlm_header *)sm->buf;
@@ -1591,7 +1592,10 @@ void process_saved_plocks(struct lockspace *ls)
list_del(&sm->list);
free(sm);
+ count++;
}
+ out:
+ log_plock(ls, "process_saved_plocks %d end", count);
}
/* locks still marked SYNCING should not go into the ckpt; the new node
13 years, 8 months
dlm: master - Revert "dlm_controld: fix save_plocks initialization"
by David Teigland
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=b5e48c2e...
Commit: b5e48c2ee2af3440bb9f348536042aff45660d3f
Parent: 9ad6aa0dadde3997e0fe8018af06db99fe13ba82
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:20:06 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:20:06 2010 -0500
Revert "dlm_controld: fix save_plocks initialization"
This bug description and fix were incorrect. dlm_controld
should only begin saving plocks after the point in time where
the ckpt_node writes the checkpoint. plock messages prior to
that will be reflected in the checkpointed state. dlm_controld
should ignore plock messages prior to the point in time where
the ckpt_node writes the checkpoint.
This reverts commit cad14d81f7f4a6adbdf762d7775c52f95807eae2.
---
group/dlm_controld/cpg.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 899d23e..2e5a1bb 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1137,9 +1137,9 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
return;
}
+ process_saved_plocks(ls);
ls->need_plocks = 0;
ls->save_plocks = 0;
- process_saved_plocks(ls);
}
static void send_info(struct lockspace *ls, struct change *cg, int type,
@@ -1284,10 +1284,6 @@ static void prepare_plocks(struct lockspace *ls)
}
ls->plock_ckpt_node = our_nodeid;
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
return;
}
@@ -1300,10 +1296,7 @@ static void prepare_plocks(struct lockspace *ls)
if (!ls->plock_ckpt_node) {
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
+ ls->save_plocks = 0;
return;
}
@@ -1311,8 +1304,10 @@ static void prepare_plocks(struct lockspace *ls)
existing plock state in the ckpt to the time that we read that state
from the ckpt. */
- if (ls->need_plocks)
+ if (ls->need_plocks) {
+ ls->save_plocks = 1;
return;
+ }
if (ls->plock_ckpt_node != our_nodeid)
return;
@@ -1794,7 +1789,6 @@ int dlm_join_lockspace(struct lockspace *ls)
ls->cpg_fd = fd;
ls->kernel_stopped = 1;
ls->need_plocks = 1;
- ls->save_plocks = 1;
ls->joining = 1;
memset(&name, 0, sizeof(name));
13 years, 8 months
cluster: STABLE3 - dlm_controld: ignore plocks until checkpoint time
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 53bd302eba05edd46de41b158fae8860137f453b
Parent: 0c4f1f6b3d8622932af804a86cfe5d72401c253f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:05:18 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:19:25 2010 -0500
dlm_controld: ignore plocks until checkpoint time
After our join confchg, we need to ignore plock messages
until the point in time where the ckpt_node saves plock
state (final start message received). At that time we need
to shift from ignoring plock messages to saving plock
messages that will be applied on top of the plock state that
is read from the checkpoint. The code was not ignoring
plock messages during the first stage of the process, which
led to incorrect plock state.
bz 623810
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 35 +++++++++++++++++++++++++++++++++++
group/dlm_controld/plock.c | 10 +++++++---
2 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 2e5a1bb..9b0d223 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1099,6 +1099,10 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
"need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
hd->msgdata2, ls->need_plocks);
+ log_plock(ls, "receive_plocks_stored %d:%u flags %x sig %x "
+ "need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
+ hd->msgdata2, ls->need_plocks);
+
ls->last_plock_sig = hd->msgdata2;
if (!ls->need_plocks)
@@ -1269,6 +1273,8 @@ static void prepare_plocks(struct lockspace *ls)
struct member *memb;
uint32_t sig;
+ log_plock(ls, "prepare_plocks");
+
if (!cfgd_enable_plock || ls->disable_plock)
return;
@@ -1569,6 +1575,12 @@ static void dlm_header_in(struct dlm_header *hd)
hd->msgdata2 = le32_to_cpu(hd->msgdata2);
}
+/* after our join confchg, we want to ignore plock messages (see need_plocks
+ checks below) until the point in time where the ckpt_node saves plock
+ state (final start message received); at this time we want to shift from
+ ignoring plock messages to saving plock messages to apply on top of the
+ plock state that we read. */
+
static void deliver_cb(cpg_handle_t handle,
const struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid,
@@ -1576,6 +1588,7 @@ static void deliver_cb(cpg_handle_t handle,
{
struct lockspace *ls;
struct dlm_header *hd;
+ int ignore_plock;
ls = find_ls_handle(handle);
if (!ls) {
@@ -1606,6 +1619,8 @@ static void deliver_cb(cpg_handle_t handle,
return;
}
+ ignore_plock = 0;
+
switch (hd->type) {
case DLM_MSG_START:
receive_start(ls, hd, len);
@@ -1614,6 +1629,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock)
receive_plock(ls, hd, len);
else
@@ -1624,6 +1643,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_OWN:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_own(ls, hd, len);
else
@@ -1635,6 +1658,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_DROP:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_drop(ls, hd, len);
else
@@ -1647,6 +1674,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_SYNC_WAITER:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_sync(ls, hd, len);
else
@@ -1701,6 +1732,10 @@ static void deliver_cb(cpg_handle_t handle,
log_error("unknown msg type %d", hd->type);
}
+ if (ignore_plock)
+ log_plock(ls, "msg %s nodeid %d need_plock ignore",
+ msg_name(hd->type), nodeid);
+
apply_changes(ls);
}
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index ca2d61a..f27001f 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1563,11 +1563,12 @@ void process_saved_plocks(struct lockspace *ls)
{
struct save_msg *sm, *sm2;
struct dlm_header *hd;
+ int count = 0;
- if (list_empty(&ls->saved_messages))
- return;
+ log_plock(ls, "process_saved_plocks begin");
- log_plock(ls, "process_saved_plocks");
+ if (list_empty(&ls->saved_messages))
+ goto out;
list_for_each_entry_safe(sm, sm2, &ls->saved_messages, list) {
hd = (struct dlm_header *)sm->buf;
@@ -1592,7 +1593,10 @@ void process_saved_plocks(struct lockspace *ls)
list_del(&sm->list);
free(sm);
+ count++;
}
+ out:
+ log_plock(ls, "process_saved_plocks %d end", count);
}
/* locks still marked SYNCING should not go into the ckpt; the new node
13 years, 8 months
cluster: STABLE3 - Revert "dlm_controld: fix save_plocks initialization"
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0c4f1f6b3d8622932af804a86cfe5d72401c253f
Parent: 9c9a67d281402ad0611233da958a68c6a9ec6e5c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:19:07 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:19:07 2010 -0500
Revert "dlm_controld: fix save_plocks initialization"
This bug description and fix were incorrect. dlm_controld
should only begin saving plocks after the point in time where
the ckpt_node writes the checkpoint. plock messages prior to
that will be reflected in the checkpointed state. dlm_controld
should ignore plock messages prior to the point in time where
the ckpt_node writes the checkpoint.
This reverts commit a85ea6fa4321504535ef8b6f60a914e094b5ede7.
---
group/dlm_controld/cpg.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 899d23e..2e5a1bb 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1137,9 +1137,9 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
return;
}
+ process_saved_plocks(ls);
ls->need_plocks = 0;
ls->save_plocks = 0;
- process_saved_plocks(ls);
}
static void send_info(struct lockspace *ls, struct change *cg, int type,
@@ -1284,10 +1284,6 @@ static void prepare_plocks(struct lockspace *ls)
}
ls->plock_ckpt_node = our_nodeid;
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
return;
}
@@ -1300,10 +1296,7 @@ static void prepare_plocks(struct lockspace *ls)
if (!ls->plock_ckpt_node) {
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
+ ls->save_plocks = 0;
return;
}
@@ -1311,8 +1304,10 @@ static void prepare_plocks(struct lockspace *ls)
existing plock state in the ckpt to the time that we read that state
from the ckpt. */
- if (ls->need_plocks)
+ if (ls->need_plocks) {
+ ls->save_plocks = 1;
return;
+ }
if (ls->plock_ckpt_node != our_nodeid)
return;
@@ -1794,7 +1789,6 @@ int dlm_join_lockspace(struct lockspace *ls)
ls->cpg_fd = fd;
ls->kernel_stopped = 1;
ls->need_plocks = 1;
- ls->save_plocks = 1;
ls->joining = 1;
memset(&name, 0, sizeof(name));
13 years, 8 months
cluster: RHEL6 - dlm_controld: ignore plocks until checkpoint time
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4de775010f746bf2369e6d4904bc4439769ffb56
Parent: 9edfc44b223d8919467e02352600bfb874993b09
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 15:05:18 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:15:37 2010 -0500
dlm_controld: ignore plocks until checkpoint time
After our join confchg, we need to ignore plock messages
until the point in time where the ckpt_node saves plock
state (final start message received). At that time we need
to shift from ignoring plock messages to saving plock
messages that will be applied on top of the plock state that
is read from the checkpoint. The code was not ignoring
plock messages during the first stage of the process, which
led to incorrect plock state.
bz 623810
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 35 +++++++++++++++++++++++++++++++++++
group/dlm_controld/plock.c | 10 +++++++---
2 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 2e5a1bb..9b0d223 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1099,6 +1099,10 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
"need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
hd->msgdata2, ls->need_plocks);
+ log_plock(ls, "receive_plocks_stored %d:%u flags %x sig %x "
+ "need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
+ hd->msgdata2, ls->need_plocks);
+
ls->last_plock_sig = hd->msgdata2;
if (!ls->need_plocks)
@@ -1269,6 +1273,8 @@ static void prepare_plocks(struct lockspace *ls)
struct member *memb;
uint32_t sig;
+ log_plock(ls, "prepare_plocks");
+
if (!cfgd_enable_plock || ls->disable_plock)
return;
@@ -1569,6 +1575,12 @@ static void dlm_header_in(struct dlm_header *hd)
hd->msgdata2 = le32_to_cpu(hd->msgdata2);
}
+/* after our join confchg, we want to ignore plock messages (see need_plocks
+ checks below) until the point in time where the ckpt_node saves plock
+ state (final start message received); at this time we want to shift from
+ ignoring plock messages to saving plock messages to apply on top of the
+ plock state that we read. */
+
static void deliver_cb(cpg_handle_t handle,
const struct cpg_name *group_name,
uint32_t nodeid, uint32_t pid,
@@ -1576,6 +1588,7 @@ static void deliver_cb(cpg_handle_t handle,
{
struct lockspace *ls;
struct dlm_header *hd;
+ int ignore_plock;
ls = find_ls_handle(handle);
if (!ls) {
@@ -1606,6 +1619,8 @@ static void deliver_cb(cpg_handle_t handle,
return;
}
+ ignore_plock = 0;
+
switch (hd->type) {
case DLM_MSG_START:
receive_start(ls, hd, len);
@@ -1614,6 +1629,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock)
receive_plock(ls, hd, len);
else
@@ -1624,6 +1643,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_OWN:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_own(ls, hd, len);
else
@@ -1635,6 +1658,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_DROP:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_drop(ls, hd, len);
else
@@ -1647,6 +1674,10 @@ static void deliver_cb(cpg_handle_t handle,
case DLM_MSG_PLOCK_SYNC_WAITER:
if (ls->disable_plock)
break;
+ if (ls->need_plocks && !ls->save_plocks) {
+ ignore_plock = 1;
+ break;
+ }
if (cfgd_enable_plock && cfgd_plock_ownership)
receive_sync(ls, hd, len);
else
@@ -1701,6 +1732,10 @@ static void deliver_cb(cpg_handle_t handle,
log_error("unknown msg type %d", hd->type);
}
+ if (ignore_plock)
+ log_plock(ls, "msg %s nodeid %d need_plock ignore",
+ msg_name(hd->type), nodeid);
+
apply_changes(ls);
}
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index ca2d61a..f27001f 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1563,11 +1563,12 @@ void process_saved_plocks(struct lockspace *ls)
{
struct save_msg *sm, *sm2;
struct dlm_header *hd;
+ int count = 0;
- if (list_empty(&ls->saved_messages))
- return;
+ log_plock(ls, "process_saved_plocks begin");
- log_plock(ls, "process_saved_plocks");
+ if (list_empty(&ls->saved_messages))
+ goto out;
list_for_each_entry_safe(sm, sm2, &ls->saved_messages, list) {
hd = (struct dlm_header *)sm->buf;
@@ -1592,7 +1593,10 @@ void process_saved_plocks(struct lockspace *ls)
list_del(&sm->list);
free(sm);
+ count++;
}
+ out:
+ log_plock(ls, "process_saved_plocks %d end", count);
}
/* locks still marked SYNCING should not go into the ckpt; the new node
13 years, 8 months
cluster: RHEL6 - Revert "dlm_controld: fix save_plocks initialization"
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9edfc44b223d8919467e02352600bfb874993b09
Parent: 85eb67286e00b4fd6e58d2c5f86ff67c5d58c0c5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 13 12:17:56 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 13 15:15:37 2010 -0500
Revert "dlm_controld: fix save_plocks initialization"
This bug description and fix were incorrect. dlm_controld
should only begin saving plocks after the point in time where
the ckpt_node writes the checkpoint. plock messages prior to
that will be reflected in the checkpointed state. dlm_controld
should ignore plock messages prior to the point in time where
the ckpt_node writes the checkpoint.
This reverts commit f63677d0128c4a30d36ccf91adf37840ce08e629.
---
group/dlm_controld/cpg.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 899d23e..2e5a1bb 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1137,9 +1137,9 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
return;
}
+ process_saved_plocks(ls);
ls->need_plocks = 0;
ls->save_plocks = 0;
- process_saved_plocks(ls);
}
static void send_info(struct lockspace *ls, struct change *cg, int type,
@@ -1284,10 +1284,6 @@ static void prepare_plocks(struct lockspace *ls)
}
ls->plock_ckpt_node = our_nodeid;
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
return;
}
@@ -1300,10 +1296,7 @@ static void prepare_plocks(struct lockspace *ls)
if (!ls->plock_ckpt_node) {
ls->need_plocks = 0;
- if (ls->save_plocks) {
- ls->save_plocks = 0;
- process_saved_plocks(ls);
- }
+ ls->save_plocks = 0;
return;
}
@@ -1311,8 +1304,10 @@ static void prepare_plocks(struct lockspace *ls)
existing plock state in the ckpt to the time that we read that state
from the ckpt. */
- if (ls->need_plocks)
+ if (ls->need_plocks) {
+ ls->save_plocks = 1;
return;
+ }
if (ls->plock_ckpt_node != our_nodeid)
return;
@@ -1794,7 +1789,6 @@ int dlm_join_lockspace(struct lockspace *ls)
ls->cpg_fd = fd;
ls->kernel_stopped = 1;
ls->need_plocks = 1;
- ls->save_plocks = 1;
ls->joining = 1;
memset(&name, 0, sizeof(name));
13 years, 8 months
cluster: RHEL4 - rgmanager: halvm: Check ownership before stripping tags
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f8dd196ce653f532bca859f1729bb332346dd5af
Parent: 517421acde2cb0d56368cfa508a95317d34f5ce7
Author: Jonathan E. Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Jan 25 17:56:41 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Aug 13 14:41:56 2010 -0400
rgmanager: halvm: Check ownership before stripping tags
Resolves: rhbz#559582
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/lvm_by_lv.sh | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
index 6691181..1937b9f 100644
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ b/rgmanager/src/resources/lvm_by_lv.sh
@@ -218,6 +218,15 @@ lv_activate_and_tag()
ocf_log err "Unable to delete tag from $lv_path"
return $OCF_ERR_GENERIC
fi
+
+ if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then
+ ocf_log notice "Removing ownership tag ($tag) from $lv_path"
+ lvchange --deltag $tag $lv_path
+ if [ $? -ne 0 ]; then
+ ocf_log err "Unable to delete tag from $lv_path"
+ return $OCF_ERR_GENERIC
+ fi
+ fi
fi
return $OCF_SUCCESS
13 years, 8 months