Bug 1134294
Summary: | libvirt can't acquire state change lock after do blockjob --pivot before block copy job is finished | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Shanzhi Yu <shyu> |
Component: | libvirt | Assignee: | Eric Blake <eblake> |
Status: | CLOSED DUPLICATE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | agedosier, dyuan, eblake, jmiao, mzhan, rbalakri, xuzhang, yanyang, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-01-14 04:59:16 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Shanzhi Yu
2014-08-27 09:03:32 UTC
Hi, Shanzhi The bug is not always reproduceable, am I right? I got the similar problem (2 times) when long running our test cases in 2 days. The command I used is: # virsh blockcopy $domain $head_disk $snapshot_img --shallow --reuse-external --wait --pivot When the problem occurred, all the blockjob command fails with "can't acquire lock", since the lock is held forever. There is no way to recover except restarting libvirtd. Regards, Osier Forgot to mention, I used libvirt-1.2.7 too. And when the hanging problem happened, the mirroring phase of "blockcopy" was actually finished. (In reply to Osier Yang from comment #1) > Hi, Shanzhi > > The bug is not always reproduceable, am I right? I got the similar problem > (2 times) when long running our test cases in 2 days. > > The command I used is: > > # virsh blockcopy $domain $head_disk $snapshot_img --shallow > --reuse-external --wait --pivot > > When the problem occurred, all the blockjob command fails with "can't > acquire lock", since the lock is held forever. There is no way to recover > except restarting libvirtd. > > Regards, > Osier Hi Osier, Thanks for your info. Actually I can reproduce it 100 percents. There is a little difference between my steps and yours. My steps is for negative test. Do pivot before copy is ready. I will try to reproduce it by your steps. To comment 2, When the hanging problem happened, I found the copy job(first phase of 'blockcopy') still be running in backgrand. Thanks again. I met another error after try many times. QEMU command 'block-job-complete' can not be completed. 1. Set log_level=1,log_outputs="1:file:/tmp/libvirtd.log" in libvirtd.conf # grep -v "^#" /etc/libvirt/libvirtd.conf log_level=1 log_outputs="1:file:/tmp/libvirtd.log" 2. Do blockcopy in one terminal # for i in `seq 1 100`;do virsh blockcopy rh7 vda /var/lib/libvirt/images/copy-$i.img --verbose --wait --pivot --shallow ;done Block Copy: [100 %] Successfully pivoted Block Copy: [100 %] Successfully pivoted Block Copy: [100 %] Successfully pivoted Block Copy: [100 %] Successfully pivoted Block Copy: [100 %] 3. Check error in another terminal # tailf /tmp/libvirtd.log |grep error 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorIOProcess:399 : QEMU_MONITOR_IO_PROCESS: mon=0x7f1d0000bbc0 buf={"id": "libvirt-228", "error": {"class": "GenericError", "desc": "The active block job for device 'drive-virtio-disk0' cannot be completed"}} 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorJSONIOProcessLine:179 : Line [{"id": "libvirt-228", "error": {"class": "GenericError", "desc": "The active block job for device 'drive-virtio-disk0' cannot be completed"}}] 2014-09-15 03:04:39.677+0000: 2115: debug : virJSONValueFromString:1136 : string={"id": "libvirt-228", "error": {"class": "GenericError", "desc": "The active block job for device 'drive-virtio-disk0' cannot be completed"}} 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorJSONIOProcessLine:199 : QEMU_MONITOR_RECV_REPLY: mon=0x7f1d0000bbc0 reply={"id": "libvirt-228", "error": {"class": "GenericError", "desc": "The active block job for device 'drive-virtio-disk0' cannot be completed"}} 2014-09-15 03:04:39.678+0000: 2120: debug : virJSONValueToString:1303 : result={"id":"libvirt-228","error":{"class":"GenericError","desc":"The active block job for device 'drive-virtio-disk0' cannot be completed"}} 2014-09-15 03:04:39.678+0000: 2120: debug : qemuMonitorJSONCheckError:366 : unable to execute QEMU command {"execute":"block-job-complete","arguments":{"device":"drive-virtio-disk0"},"id":"libvirt-228"}: {"id":"libvirt-228","error":{"class":"GenericError","desc":"The active block job for device 'drive-virtio-disk0' cannot be completed"}} 2014-09-15 03:04:39.678+0000: 2120: error : qemuMonitorJSONCheckError:377 : internal error: unable to execute QEMU command 'block-job-complete': The active block job for device 'drive-virtio-disk0' cannot be completed 4. Check guest xml # virsh dumpxml rh7 <disk type='file' device='disk'> <driver type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/copy-4.img'/> <backingStore type='block' index='1'> <format type='raw'/> <source dev='/dev/sda7'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> 5. When try to get blockjob information, will met can't acquire state change lock # virsh blockjob rh7 vda error: Timed out during operation: cannot acquire state change lock More like another bug ? Eirc, Can you help confirm this? Thanks (In reply to Shanzhi Yu from comment #4) > I met another error after try many times. QEMU command 'block-job-complete' > can not be completed. > > > 1. Set log_level=1,log_outputs="1:file:/tmp/libvirtd.log" in libvirtd.conf > # grep -v "^#" /etc/libvirt/libvirtd.conf > log_level=1 > log_outputs="1:file:/tmp/libvirtd.log" > > 2. Do blockcopy in one terminal > > # for i in `seq 1 100`;do virsh blockcopy rh7 vda > /var/lib/libvirt/images/copy-$i.img --verbose --wait --pivot --shallow ;done > Block Copy: [100 %] > Successfully pivoted > Block Copy: [100 %] > Successfully pivoted > Block Copy: [100 %] > Successfully pivoted > Block Copy: [100 %] > Successfully pivoted > Block Copy: [100 %] > > > 3. Check error in another terminal > > # tailf /tmp/libvirtd.log |grep error > 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorIOProcess:399 : > QEMU_MONITOR_IO_PROCESS: mon=0x7f1d0000bbc0 buf={"id": "libvirt-228", > "error": {"class": "GenericError", "desc": "The active block job for device > 'drive-virtio-disk0' cannot be completed"}} > 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorJSONIOProcessLine:179 > : Line [{"id": "libvirt-228", "error": {"class": "GenericError", "desc": > "The active block job for device 'drive-virtio-disk0' cannot be completed"}}] > 2014-09-15 03:04:39.677+0000: 2115: debug : virJSONValueFromString:1136 : > string={"id": "libvirt-228", "error": {"class": "GenericError", "desc": "The > active block job for device 'drive-virtio-disk0' cannot be completed"}} > 2014-09-15 03:04:39.677+0000: 2115: debug : qemuMonitorJSONIOProcessLine:199 > : QEMU_MONITOR_RECV_REPLY: mon=0x7f1d0000bbc0 reply={"id": "libvirt-228", > "error": {"class": "GenericError", "desc": "The active block job for device > 'drive-virtio-disk0' cannot be completed"}} > 2014-09-15 03:04:39.678+0000: 2120: debug : virJSONValueToString:1303 : > result={"id":"libvirt-228","error":{"class":"GenericError","desc":"The > active block job for device 'drive-virtio-disk0' cannot be completed"}} > 2014-09-15 03:04:39.678+0000: 2120: debug : qemuMonitorJSONCheckError:366 : > unable to execute QEMU command > {"execute":"block-job-complete","arguments":{"device":"drive-virtio-disk0"}, > "id":"libvirt-228"}: > {"id":"libvirt-228","error":{"class":"GenericError","desc":"The active block > job for device 'drive-virtio-disk0' cannot be completed"}} > 2014-09-15 03:04:39.678+0000: 2120: error : qemuMonitorJSONCheckError:377 : > internal error: unable to execute QEMU command 'block-job-complete': The > active block job for device 'drive-virtio-disk0' cannot be completed > Thanks for the testing, Shanzhi. These errors tells the bug is in QEMU. There is a qemu-kvm-rhev bug 1130489 should cause problem in comment 4 Upstream is reporting the same symptoms: https://www.redhat.com/archives/libvir-list/2015-January/msg00454.html After more investigation, it looks like this problem was solved by the same patch as for bug 1139567 *** This bug has been marked as a duplicate of bug 1139567 *** After bug 1139567 be fixed then retest this bug, it work fine. Do pivot before copy is not finish will met error like below: # virsh blockjob test vda --pivot error: block copy still active: disk 'vda' not ready for pivot yet # virsh blockjob test vda Block Copy: [ 40 %] |