From: Nir Soffer <nsoffer(a)redhat.com>
Without specifying block size or alignment (default behaviour in vdsm),
sanlock try to perform read based on 4k/8M in case a disk is 4k disk,
and fail in internal validation:
SanlockException: (90, 'Unable to read resource owners', 'Message too
long')
Here is a failure log:
2019-03-21 03:22:03 623007 [22553]: cmd_write_resource 2,14
ls_name:res_name:/var/tmp/sanlock/test_read_resource_owners0/resources:0 0x110
2019-03-21 03:22:03 623007 [22554]: cmd_read_resource_owners 2,14
/var/tmp/sanlock/test_read_resource_owners0/resources:0
2019-03-21 03:22:03 623007 [22554]: worker1 aio collect RD
0x7f4b14000b20:0x7f4b14000b30:0x7f4b137ff000 result 1052672:0 match len 8388608
2019-03-21 03:22:03 623007 [22554]: read_resource_owners read_buf rv -90
2019-03-21 03:22:03 623007 [22554]: cmd_read_resource_owners 2,14 count 0 done -90
2019-03-21 03:22:03 623007 [22550]: ci 2 fd 14 pid -1 recv errno 104
The same issue can be seen with 3.7.0 with current oVirt release.
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/python_test.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tests/python_test.py b/tests/python_test.py
index ea12b85..e01e550 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -3,10 +3,12 @@ Test sanlock python binding with sanlock daemon.
"""
import io
import struct
+import pytest
+
import sanlock
from . import constants
from . import util
@@ -39,5 +41,17 @@ def test_init_resource(tmpdir, sanlock_daemon):
assert magic == constants.PAXOS_DISK_MAGIC
# TODO: check more stuff here...
util.check_guard(str(path), size)
+
+
+(a)pytest.mark.xfail(reason="broken without specifying block size / alignment")
+def test_read_resource_owners(tmpdir, sanlock_daemon):
+ path = tmpdir.join("resources")
+ size = 1024**2
+ util.create_file(str(path), size)
+ disks = [(str(path), 0)]
+ sanlock.write_resource("ls_name", "res_name", disks)
+
+ res = sanlock.read_resource_owners("ls_name", "res_name", disks)
+ assert res == []
--
2.17.2