With 2.03.12 the Merge action never finishes when using the DBus API: # busctl call com.redhat.lvmdbus1 /com/redhat/lvmdbus1/Lv/5 com.redhat.lvmdbus1.Snapshot Merge "ia{sv}" 1 0 o "/com/redhat/lvmdbus1/Job/1" The produced job is stuck at 0 % and not completed # busctl introspect com.redhat.lvmdbus1 /com/redhat/lvmdbus1/Job/1 com.redhat.lvmdbus1.Job NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Remove method - - - .Wait method i b - .Complete property b false emits-change writable .GetError property (is) -1 "Job is not complete!" emits-change .Percent property d 0 emits-change .Result property o "/" emits-change Backtrace for the lvconvert command spawned by the DBus daemon (/usr/sbin/lvm lvconvert --merge -i 1 testVG/testLV_bak --config global/notify_dbus=0): (gdb) bt #0 0x00007fada65cb4f7 in write () from /lib64/libc.so.6 #1 0x00007fada655b76d in _IO_file_write () from /lib64/libc.so.6 #2 0x00007fada655aae6 in new_do_write () from /lib64/libc.so.6 #3 0x00007fada655be3e in _IO_file_xsputn () from /lib64/libc.so.6 #4 0x00007fada654840f in buffered_vfprintf () from /lib64/libc.so.6 #5 0x000056024ebca6de in _vprint_log () #6 0x000056024ebca979 in print_log () #7 0x000056024eba454a in device_ids_match () #8 0x000056024eba5481 in setup_devices () #9 0x000056024ebcd954 in label_scan () #10 0x000056024eb8bd4b in lvmcache_label_scan () #11 0x000056024eb6e189 in process_each_lv () #12 0x000056024eb4584b in lvconvert_merge_cmd () #13 0x000056024eb4e767 in lvm_run_command () #14 0x000056024eb4ff96 in lvm2_main () #15 0x00007fada6501b75 in __libc_start_main () from /lib64/libc.so.6 #16 0x000056024eb2ae3e in _start () Same command works when run from shell so I assume the problem is somewhere in the daemon when polling the progress of the lvconvert.
I can't get lvmdbusd to run to try this myself. Could you set lvm.conf log/level=7 and log/file="/tmp/lvm.log" and rerun this so we can see what the commands run by the daemon are doing?
The lvconvert is run in a separate process and the daemon is reading stdout, parsing it and updating the state of the daemon in a loop. So while the merge is in progress another process is collecting the entire state of lvm at the same time. So we *may* have a locking issue where one process that is doing the merge is holding a lock that the other process needs to collect the state of lvm, thus causing a deadlock. Also when this error occurs, you can issue a dbus command to lvmdbusd and it will dump it's flight recorder to syslog, see: com.redhat.lvmdbus1.Manager.FlightRecorderDump https://sourceware.org/git/?p=lvm2.git;a=commit;h=470a1f1c5031590823f8a58e641873da76dc1f46
This is likely related to Mikulas's snapshot patch that needs to be reverted in kernel a fixed with newer version.
The problem is in lvmdbusd, the code which handles reading progress from stdout deadlocks when stderr output exceeds the pipe buffer. I'll prepare a patch for this.
Correction committed upstream: https://sourceware.org/git/?p=lvm2.git;a=commit;h=c474f174cc8b0e855f984bf211f5416b42c644a1