[sanlock] branch master updated: sanlock: don't ignore wrong size
in read_resource_owners
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 50a1591 sanlock: don't ignore wrong size in read_resource_owners
50a1591 is described below
commit 50a1591165c572b9848b0534956427614b6cabbd
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Mar 21 13:05:06 2019 -0500
sanlock: don't ignore wrong size in read_resource_owners
If the user specifies the wrong lease size and it
triggers an error, then return the error instead of
correcting it internally. There is a possibility
that we might want a short read to fail in other cases also.
---
src/resource.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/resource.c b/src/resource.c
index 66a5f37..a783106 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -188,12 +188,7 @@ int read_resource_owners(struct task *task, struct token *token,
/* we could in-line paxos_read_buf here like we do in read_mode_block */
retry:
rv = paxos_read_buf(task, token, &lease_buf);
- if (rv == -EMSGSIZE) {
- /* if an 8M lease was specified, but it's only a 1M lease at
- the end of the device, then we'll get an error from a short
- read */
- log_token(token, "read_resource_owners read_buf EMSGSIZE");
- } else if (rv < 0) {
+ if (rv < 0) {
log_errot(token, "read_resource_owners read_buf rv %d", rv);
if (lease_buf && (rv != SANLK_AIO_TIMEOUT))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 12 months
[sanlock] branch master updated: Remove xfail mark from
test_read_resource_owners()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 017fd34 Remove xfail mark from test_read_resource_owners()
017fd34 is described below
commit 017fd3492e7edaa57a28474e6fb21d5f560dc4d4
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Thu Mar 21 19:35:13 2019 +0200
Remove xfail mark from test_read_resource_owners()
The test pass since commit 414abfeab771 (sanlock: fix
read_resource_owners read error).
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
tests/python_test.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tests/python_test.py b/tests/python_test.py
index e01e550..9cd6355 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -5,8 +5,6 @@ Test sanlock python binding with sanlock daemon.
import io
import struct
-import pytest
-
import sanlock
from . import constants
@@ -45,7 +43,6 @@ def test_init_resource(tmpdir, sanlock_daemon):
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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 12 months
[sanlock] branch master updated: Add failing test for
read_resource_owners
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 7e7e18d Add failing test for read_resource_owners
7e7e18d is described below
commit 7e7e18d860a837351a3b2ad50e5477cf637a5742
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Thu Mar 21 03:37:26 2019 +0200
Add failing test for read_resource_owners
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
@@ -5,6 +5,8 @@ Test sanlock python binding with sanlock daemon.
import io
import struct
+import pytest
+
import sanlock
from . import constants
@@ -41,3 +43,15 @@ def test_init_resource(tmpdir, sanlock_daemon):
# 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 == []
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 12 months
[sanlock] branch master updated: sanlock: fix read_resource_owners
read error
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 414abfe sanlock: fix read_resource_owners read error
414abfe is described below
commit 414abfeab771f6bbb287bbb1f694310f744aa132
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Mar 21 10:04:57 2019 -0500
sanlock: fix read_resource_owners read error
It would try to read an 8MB lease, but if the lease
was 1MB at the end of the file/device, then the read
would return an error because of the short read.
We can ignore this error.
Also, when we have to guess at the lease size to start
with, guess 1M instead of 8M. If either guess is wrong
the read will be retried with the correct size.
---
src/resource.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/resource.c b/src/resource.c
index 4749c91..66a5f37 100644
--- a/src/resource.c
+++ b/src/resource.c
@@ -177,18 +177,23 @@ int read_resource_owners(struct task *task, struct token *token,
/*
* We don't know the sector_size of the resource until the leader
- * record has been read, so go with the larger size.
+ * record has been read, start with the smaller size.
*/
if (!token->sector_size) {
- token->sector_size = 4096;
- token->align_size = sector_size_to_align_size_old(4096);
+ token->sector_size = 512;
+ token->align_size = sector_size_to_align_size_old(512);
}
/* we could in-line paxos_read_buf here like we do in read_mode_block */
retry:
rv = paxos_read_buf(task, token, &lease_buf);
- if (rv < 0) {
+ if (rv == -EMSGSIZE) {
+ /* if an 8M lease was specified, but it's only a 1M lease at
+ the end of the device, then we'll get an error from a short
+ read */
+ log_token(token, "read_resource_owners read_buf EMSGSIZE");
+ } else if (rv < 0) {
log_errot(token, "read_resource_owners read_buf rv %d", rv);
if (lease_buf && (rv != SANLK_AIO_TIMEOUT))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 12 months
[PATCH] Add failing test for read_resource_owners
by Nir Soffer
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
5 years
[sanlock] branch master updated: release 3.7.0
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new c562837 release 3.7.0
c562837 is described below
commit c562837b906f76c94041f477370cd97a1773b03f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 19 10:51:09 2019 -0500
release 3.7.0
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index 40c341b..7c69a55 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.6.0
+3.7.0
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
5 years