Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=18d101d178dc8b9d…
Commit: 18d101d178dc8b9d3f19b1ddb1b5ab5ee95f63e4
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-11-05 01:03 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-11-05 01:03 +0000
annotated tag: v2_02_167 has been created
at 18d101d178dc8b9d3f19b1ddb1b5ab5ee95f63e4 (tag)
tagging eed708dbd985f06ff73494cf688ab7ee54e2d1e7 (commit)
replaces v2_02_166
Release 2.02.167
Final bug fix release before more enhancements and refactoring.
67 files changed, 1659 insertions(+), 766 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlgdMEYACgkQIoGRwVZ+LBd52wCdGW+8BBY0yk6xp2OnkZUyAMY8
K/EAn1qQ08ycECL49wTojax6cxYzRQWV
=AS29
-----END PGP SIGNATURE-----
Alasdair G Kergon (6):
post-release
lvconvert: Disable thin pool raid conversion while active.
Revert "cleanup: simplier assign of cmd vars"
dmsetup: Produce partial output if dev disappears.
tests: Disable 3-leg raid1 pre-sync repair attempt
pre-release
Bryn M. Reeves (5):
libdm: fix stats walk compatibility with older dmsetup
libdm: fix dm_stats_delete_region() backwards compat
libdm: convert FIEMAP buffer allocation from stack to dm_zalloc
dmsetup: obey --programid when deleting regions
dmsetup: remove stray '
' in delete log message
David Teigland (4):
lvmlockd: fix segfault in error path
toollib: clean up coverity issue
pvscan: fix autoactivation of exported VG
tests: check that pvscan cannot activate exported VG
Heinz Mauelshagen (11):
lvconvert: certain repair of cache raid volumes fails "Cannot convert internal LV"
lvconvert: fix RAID SubLV --splitmirror regression
lvconvert: position dedicated parity device in raid4 conversions porperly
raid_manip: fix typo
lvconvert: revert to only letting raid4 through to lv_raid_convert()
lvchange/vgchange/lvconvert: prevent raid4 creation/activation/conversion on non-supporting raid targets
lvconvert-raid-takeover.sh: fix test
lvconvert: check for supported raid0/raid4 segtypes
lvconvert: prevent non-synced raid1 primary leg repair
lvconvert: fix raid repair regression
test: add raid4 checks to respective tests
Peter Rajnoha (3):
systemd: disable service start rate limiting for lvm2-pvscan@.service
spec: move dmeventd -R from post to posttrans script for device-mapper-event package
blkdeactivate: deactivate dev stack if dev on top already unmounted
Tony Asleson (30):
lvmdbustest.py: Make env variable work
lvmdbusd: Clean up objectmanager.get_object_path_by_uuid_lvm_id
lvmdbusd: Allow PV device names to be '[unknown]'
lvmdbustest.py: Make sure to test for hidden lookups
lvmdbusd: Add diagnostic validate for look ups
lvmdbusd: Remove extraneous parameter
lvmdbusd: Use 'pv_missing' column instead of '[unknown]'
lvmdbusd: Add properties to LvCommon
lvmdbusd: Add LvCommon.MovePv
lvmdbusd: Add LvCommon.DataPercent
lvmdbusd: Ensure lvm shell still exists
lvmdbusd: Ensure tmp dir gets cleaned up
lvmdbustest.py: Ensure we exit non-zero on fail
lvmdbustest.py: Print to stderr
lvmdbustest.py: Denote failure if set_execution fails
lvmdbustest.py: Skip test_job_handling_timer on loopback
lvmdbustest.py: Add profile and path for lvm binary
lvmdbusd: Disable lvm abort on too much log output
lvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes
lvmdbustest.py: Use more compatible syntax
lvmdbustest.py: Add $PREFIX support
lvmdbustest.py: ws fixes
lvmdbusd: Use timer instead of thread
lvmdbusd: Return results in main thread
lvmdbusd: Execute load in main thread
lvmdbusd: Don't use dbus lib in worker thread
lvmdbusd: main.py: change debug msg text
lvmdbusd: Stop using threads for job wait
lvmdbusd: Take out background thread
lvmdbusd: Remove the periodic timer task
Zdenek Kabelac (30):
raid: dmeventd plugin use 64bit arithmetic
libdm: check for mem when _canonicalize_field_ids
dmeventd: pthread_sigmask in single function
cleanup: simplier assign of cmd vars
cleanup: drop assign before use
cleanup: drop test for NULL
cleanup :drop unneeded header file
tests: proper wait usage
lvconvert: fix error value
lvconvert: use _read_conversion_type
cleanup: reorder code
cleanup: use already set values
cleanup: lvconvert drop unused variable
cleanup: indent
tests: notify dbus only for dbus test
lvconvert: still use strcmp for now
logging: add more log macros
libdm: report logging with errno as changed default
dmeventd: abort on internal error
dmeventd: debug only subsystemd with # sign
dmeventd: separate dm and dmeventd logging
cleanup: drop unused attribute
cleanup: add 'static' for local struct
libdm: use dm_log_with_errno always
cleanup: log_info to log_error
log_info to log_warn
log_info to log_very_verbose
cleanup: remove goto
cleanup: use WARNING prefix for log_warn
dmeventd: provide message context
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eed708dbd985f06f…
Commit: eed708dbd985f06ff73494cf688ab7ee54e2d1e7
Parent: 6dce0e948935678e647dddeeea816cb4937f078a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Nov 5 01:03:32 2016 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Nov 5 01:03:32 2016 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index b2fc25f..aceedeb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.167(2)-git (2016-09-26)
+2.02.167(2)-git (2016-11-05)
diff --git a/VERSION_DM b/VERSION_DM
index 087153f..efc7dd5 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.136-git (2016-09-26)
+1.02.136-git (2016-11-05)
diff --git a/WHATS_NEW b/WHATS_NEW
index a5e6d45..379bd3b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.167 -
-======================================
+Version 2.02.167 - 5th November 2016
+====================================
Use log_error in regex and sysfs filter to describe reason of failure.
Fix blkdeactivate to deactivate dev stack if dev on top already unmounted.
Prevent non-synced raid1 repair unless --force
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 17c370c..bf16842 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,8 +1,8 @@
-Version 1.02.136 -
-======================================
+Version 1.02.136 - 5th November 2016
+====================================
Log failure of raid device with log_error level.
Use dm_log_with_errno and translate runtime to dm_log only when needed.
- Make log messages from dm and lvm library differnt from dmeventd.
+ Make log messages from dm and lvm library different from dmeventd.
Notice and Info messages are again logged from dmeventd and its plugins.
Dmeventd now also respects DM_ABORT_ON_INTERNAL_ERRORS as libdm based tool.
Report as non default dm logging also when logging with errno was changed.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=461d340bd75556ef…
Commit: 461d340bd75556ef1f9fcda7ec29ebd5f044d861
Parent: ee0c9e7b2306cada41defedd0e5006b0ee2f3a21
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Thu Nov 3 18:27:22 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Thu Nov 3 18:38:10 2016 -0500
lvmdbusd: Remove the periodic timer task
This code is no longer needed because the back ground task has been
removed. Will add back if we change the design and end up utilizing
multiple worker threads.
---
daemons/lvmdbusd/background.py | 18 ------------------
daemons/lvmdbusd/main.py | 8 +++-----
2 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/daemons/lvmdbusd/background.py b/daemons/lvmdbusd/background.py
index fc92b0c..f4cb539 100644
--- a/daemons/lvmdbusd/background.py
+++ b/daemons/lvmdbusd/background.py
@@ -7,7 +7,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import threading
import subprocess
from . import cfg
from .cmdhandler import options_to_cli_args
@@ -15,9 +14,6 @@ import dbus
from .utils import pv_range_append, pv_dest_ranges, log_error, log_debug
import os
-_rlock = threading.RLock()
-_thread_list = list()
-
def pv_move_lv_cmd(move_options, lv_full_name,
pv_source, pv_source_range, pv_dest_range_list):
@@ -130,17 +126,3 @@ def merge(interface_name, lv_uuid, lv_name, merge_options, job_state):
raise dbus.exceptions.DBusException(
interface_name,
'LV with uuid %s and name %s not present!' % (lv_uuid, lv_name))
-
-
-def background_reaper():
- with _rlock:
- num_threads = len(_thread_list) - 1
- if num_threads >= 0:
- for i in range(num_threads, -1, -1):
- _thread_list[i].join(0)
- if not _thread_list[i].is_alive():
- log_debug("Reaping thread: %s" % _thread_list[i].name)
- _thread_list.pop(i)
- return True
-
-
diff --git a/daemons/lvmdbusd/main.py b/daemons/lvmdbusd/main.py
index 5fe1018..7d10bc3 100644
--- a/daemons/lvmdbusd/main.py
+++ b/daemons/lvmdbusd/main.py
@@ -22,7 +22,6 @@ from . import lvmdb
from gi.repository import GLib
from .fetch import load
from .manager import Manager
-from .background import background_reaper
import traceback
import queue
from . import udevwatch
@@ -64,6 +63,7 @@ def _discard_pending_refreshes():
def process_request():
while cfg.run.value != 0:
+ # noinspection PyBroadException
try:
req = cfg.worker_q.get(True, 5)
@@ -156,10 +156,8 @@ def main():
cfg.db = lvmdb.DataStore(cfg.args.use_json)
- # Periodically call function to reap threads that are created
- GLib.timeout_add(5000, background_reaper)
-
- # Using a thread to process requests.
+ # Using a thread to process requests, we cannot hang the dbus library
+ # thread that is handling the dbus interface
thread_list.append(threading.Thread(target=process_request))
cfg.load(refresh=False, emit_signal=False, need_main_thread=False)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ee0c9e7b2306cada…
Commit: ee0c9e7b2306cada41defedd0e5006b0ee2f3a21
Parent: a9ee86ccf2425cbe3f038039c8038db1e1784086
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Thu Nov 3 18:25:12 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Thu Nov 3 18:29:06 2016 -0500
lvmdbusd: Take out background thread
There is no reason to create another background task when the task that
created it is going to block waiting for it to finish. Instead we will
just execute the logic in the worker thread that is servicing the worker
queue.
---
daemons/lvmdbusd/background.py | 103 ++++++++++++---------------------------
daemons/lvmdbusd/job.py | 29 +-----------
2 files changed, 33 insertions(+), 99 deletions(-)
diff --git a/daemons/lvmdbusd/background.py b/daemons/lvmdbusd/background.py
index 0220b97..fc92b0c 100644
--- a/daemons/lvmdbusd/background.py
+++ b/daemons/lvmdbusd/background.py
@@ -13,7 +13,6 @@ from . import cfg
from .cmdhandler import options_to_cli_args
import dbus
from .utils import pv_range_append, pv_dest_ranges, log_error, log_debug
-import traceback
import os
_rlock = threading.RLock()
@@ -41,15 +40,40 @@ def lv_merge_cmd(merge_options, lv_full_name):
return cmd
-def _move_merge(interface_name, cmd, job_state):
- add(cmd, job_state)
-
- done = job_state.Wait(-1)
- if not done:
- ec, err_msg = job_state.GetError
+def _move_merge(interface_name, command, job_state):
+ # We need to execute these command stand alone by forking & exec'ing
+ # the command always as we will be getting periodic output from them on
+ # the status of the long running operation.
+ command.insert(0, cfg.LVM_CMD)
+ process = subprocess.Popen(command, stdout=subprocess.PIPE,
+ env=os.environ,
+ stderr=subprocess.PIPE, close_fds=True)
+
+ log_debug("Background process for %s is %d" %
+ (str(command), process.pid))
+
+ lines_iterator = iter(process.stdout.readline, b"")
+ for line in lines_iterator:
+ line_str = line.decode("utf-8")
+
+ # Check to see if the line has the correct number of separators
+ try:
+ if line_str.count(':') == 2:
+ (device, ignore, percentage) = line_str.split(':')
+ job_state.Percent = round(
+ float(percentage.strip()[:-1]), 1)
+ except ValueError:
+ log_error("Trying to parse percentage which failed for %s" %
+ line_str)
+
+ out = process.communicate()
+
+ if process.returncode == 0:
+ job_state.Percent = 100
+ else:
raise dbus.exceptions.DBusException(
interface_name,
- 'Exit code %s, stderr = %s' % (str(ec), err_msg))
+ 'Exit code %s, stderr = %s' % (str(process.returncode), out[1]))
cfg.load()
return '/'
@@ -84,8 +108,6 @@ def move(interface_name, lv_name, pv_src_obj, pv_source_range,
pv_dests.append((pv_dbus_obj.lvm_id, pr[1], pr[2]))
- # Generate the command line for this command, but don't
- # execute it.
cmd = pv_move_lv_cmd(move_options,
lv_name,
pv_src.lvm_id,
@@ -122,64 +144,3 @@ def background_reaper():
return True
-def background_execute(command, background_job):
-
- # Wrap this whole operation in an exception handler, otherwise if we
- # hit a code bug we will silently exit this thread without anyone being
- # the wiser.
- try:
- # We need to execute these command stand alone by forking & exec'ing
- # the command always!
- command.insert(0, cfg.LVM_CMD)
- process = subprocess.Popen(command, stdout=subprocess.PIPE,
- env=os.environ,
- stderr=subprocess.PIPE, close_fds=True)
-
- log_debug("Background process for %s is %d" %
- (str(command), process.pid))
-
- lines_iterator = iter(process.stdout.readline, b"")
- for line in lines_iterator:
- line_str = line.decode("utf-8")
-
- # Check to see if the line has the correct number of separators
- try:
- if line_str.count(':') == 2:
- (device, ignore, percentage) = line_str.split(':')
- background_job.Percent = round(
- float(percentage.strip()[:-1]), 1)
- except ValueError:
- log_error("Trying to parse percentage which failed for %s" %
- line_str)
-
- out = process.communicate()
-
- if process.returncode == 0:
- background_job.Percent = 100
- else:
- log_error("Failed to execute background job %s, STDERR= %s"
- % (str(command), out[1]))
-
- background_job.set_result(process.returncode, out[1])
- log_debug("Background process %d complete!" % process.pid)
-
- except Exception:
- # In the unlikely event that we blow up, we need to unblock caller which
- # is waiting on an answer.
- st = traceback.format_exc()
- error = "Exception in background thread: \n%s" % st
- log_error(error)
- background_job.set_result(1, error)
-
-
-def add(command, reporting_job):
- # Create the thread, get it running and then add it to the list
- t = threading.Thread(
- target=background_execute,
- name="thread: " + ' '.join(command),
- args=(command, reporting_job))
- t.start()
-
- with _rlock:
- _thread_list.append(t)
-
diff --git a/daemons/lvmdbusd/job.py b/daemons/lvmdbusd/job.py
index 81048a6..3c3bba0 100644
--- a/daemons/lvmdbusd/job.py
+++ b/daemons/lvmdbusd/job.py
@@ -66,7 +66,6 @@ class JobState(object):
self._percent = 0
self._complete = False
self._request = request
- self._cond = threading.Condition(self.rlock)
self._ec = 0
self._stderr = ''
self._waiting_clients = []
@@ -100,7 +99,6 @@ class JobState(object):
with self.rlock:
self._complete = value
self._percent = 100
- self._cond.notify_all()
self.notify_waiting_clients()
@property
@@ -115,29 +113,10 @@ class JobState(object):
else:
return (-1, 'Job is not complete!')
- def set_result(self, ec, msg):
- with self.rlock:
- self.Complete = True
- self._ec = ec
- self._stderr = msg
-
def dtor(self):
with self.rlock:
self._request = None
- def Wait(self, timeout):
- try:
- with self._cond:
- # Check to see if we are done, before we wait
- if not self.Complete:
- if timeout != -1:
- self._cond.wait(timeout)
- else:
- self._cond.wait()
- return self.Complete
- except RuntimeError:
- return False
-
@property
def Result(self):
with self.rlock:
@@ -175,6 +154,7 @@ class JobState(object):
self._waiting_clients = []
+
# noinspection PyPep8Naming
class Job(AutomatedProperties):
_Percent_meta = ('d', JOB_INTERFACE)
@@ -195,10 +175,6 @@ class Job(AutomatedProperties):
def Percent(self):
return dbus.Double(float(self.state.Percent))
- @Percent.setter
- def Percent(self, value):
- self.state.Percent = value
-
@property
def Complete(self):
return dbus.Boolean(self.state.Complete)
@@ -211,9 +187,6 @@ class Job(AutomatedProperties):
def GetError(self):
return dbus.Struct(self.state.GetError, signature="(is)")
- def set_result(self, ec, msg):
- self.state.set_result(ec, msg)
-
@dbus.service.method(dbus_interface=JOB_INTERFACE)
def Remove(self):
if self.state.Complete: