let's discuss defeaturing non-thinp snaps
by Andy Grover
Tony has done the heavy lifting to get support for thin-provisioned LVM
snapshots into the latest version of LVM.
Yay!
My question now is, can we remove support for snapshots of *non*-thinp
volumes? It's currently done via a dumb copy, and now that we had to go
back to a single-threaded server, this could block other targetd
requests for a long time, and generally is a poor experience.
Additionally, copy() is the only call that supports ASYNC mode (because
it's slow.) If we only enable thinp snaps, we can remove the ASYNC
special-case from the targetd API specification.
Thoughts?
If that's acceptable, well...
...can we got further out on a limb and talk about removing non-thinp LV
support altogether? This would further allow us to streamline our
documentation and test matrix.
Regards -- Andy
10 years, 8 months
[PATCH 0/2] Reclaim memory & serialize access
by Tony Asleson
Changes to prevent memory from leaking and allow multiple
clients to operate, although their access is serialized.
These are updated changes from suggestions from Andy.
Tony Asleson (2):
Re-claim memory in C library periodically
Serialize service processing.
targetd/block.py | 11 +++++++++++
targetd/main.py | 10 +++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
--
1.8.2.1
10 years, 9 months
[PATCH 1/2] Re-claim memory in C library periodically.
by Tony Asleson
The lvm C library requires that you close/re-open for long
running processes to reclaim memory.
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
targetd/block.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/targetd/block.py b/targetd/block.py
index da78872..c77b021 100644
--- a/targetd/block.py
+++ b/targetd/block.py
@@ -26,6 +26,22 @@ from main import TargetdError
from utils import ignored
+def lib_housekeeping(method):
+ def c_wrapper(*args, **kwargs):
+ global c_library_calls
+ c_library_calls += 1
+ if c_library_calls > 50:
+ try:
+ #May not be present
+ lvm.gc()
+ except AttributeError:
+ pass
+ c_library_calls = 0
+
+ return method(*args, **kwargs)
+ return c_wrapper
+
+
def get_vg_lv(pool_name):
"""
Checks for the existence of a '/' in the pool name. We are using this
@@ -61,6 +77,7 @@ def vgopen(pool_name):
pools = []
target_name = None
+c_library_calls = 0
#
@@ -91,6 +108,7 @@ def initialize(config_dict):
)
+@lib_housekeeping
def volumes(req, pool):
output = []
vg_name, lv_pool = get_vg_lv(pool)
@@ -102,6 +120,7 @@ def volumes(req, pool):
return output
+@lib_housekeeping
def create(req, pool, name, size):
vg_name, lv_pool = get_vg_lv(pool)
with vgopen(vg_name) as vg:
@@ -115,6 +134,7 @@ def create(req, pool, name, size):
vg.createLvLinear(name, int(size))
+@lib_housekeeping
def destroy(req, pool, name):
with ignored(RTSLibNotInCFS):
fm = FabricModule('iscsi')
@@ -130,6 +150,7 @@ def destroy(req, pool, name):
vg.lvFromName(name).remove()
+@lib_housekeeping
def copy(req, pool, vol_orig, vol_new, timeout=10):
"""
Create a new volume that is a copy of an existing one.
@@ -181,6 +202,7 @@ def copy(req, pool, vol_orig, vol_new, timeout=10):
raise TargetdError(-303, "Unexpected exception: %s" % (str(e)))
+@lib_housekeeping
def export_list(req):
try:
fm = FabricModule('iscsi')
@@ -211,6 +233,7 @@ def _exports_save_config():
root.ui_command_saveconfig()
+@lib_housekeeping
def export_create(req, pool, vol, initiator_wwn, lun):
# get wwn of volume so LIO can export as vpd83 info
vg_name, thin_pool = get_vg_lv(pool)
@@ -258,6 +281,7 @@ def export_create(req, pool, vol, initiator_wwn, lun):
_exports_save_config()
+@lib_housekeeping
def export_destroy(req, pool, vol, initiator_wwn):
pool_check(pool)
fm = FabricModule('iscsi')
@@ -296,6 +320,7 @@ def export_destroy(req, pool, vol, initiator_wwn):
_exports_save_config()
+@lib_housekeeping
def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user,
out_pass):
fm = FabricModule('iscsi')
@@ -319,6 +344,7 @@ def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user,
_exports_save_config()
+@lib_housekeeping
def block_pools(req):
results = []
--
1.8.2.1
10 years, 9 months
[PATCH 1/3] White space fixes
by Tony Asleson
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
targetd/block.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/targetd/block.py b/targetd/block.py
index ca2959e..d8fba3a 100644
--- a/targetd/block.py
+++ b/targetd/block.py
@@ -60,6 +60,7 @@ def vgopen(pool_name):
pools = []
target_name = None
+
#
# config_dict must include block_pools and target_name or we blow up
#
@@ -281,7 +282,8 @@ def export_destroy(req, pool, vol, initiator_wwn):
_exports_save_config()
-def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user, out_pass):
+def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user,
+ out_pass):
fm = FabricModule('iscsi')
t = Target(fm, target_name)
tpg = TPG(t, 1)
--
1.8.2.1
10 years, 9 months
[PATCH 1/4] White space fixes
by Tony Asleson
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
targetd/block.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/targetd/block.py b/targetd/block.py
index ca2959e..d8fba3a 100644
--- a/targetd/block.py
+++ b/targetd/block.py
@@ -60,6 +60,7 @@ def vgopen(pool_name):
pools = []
target_name = None
+
#
# config_dict must include block_pools and target_name or we blow up
#
@@ -281,7 +282,8 @@ def export_destroy(req, pool, vol, initiator_wwn):
_exports_save_config()
-def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user, out_pass):
+def initiator_set_auth(req, initiator_wwn, in_user, in_pass, out_user,
+ out_pass):
fm = FabricModule('iscsi')
t = Target(fm, target_name)
tpg = TPG(t, 1)
--
1.8.2.1
10 years, 9 months