I tried using these settings in tests without success. The correct config names
are prefixed with "mds".
Fixes: http://tracker.ceph.com/issues/16664
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
the mock_open() does not support "for i in open()", and readline() and
readlines() support was added in py3.3 and py3.4 so for better backwards
compatibility, we should change the code being tested to use the plain
read() call.
and also use open(path) instead of open(path, 'rb') for simplicity,
otherwise we need to use bytestring for comparison and pass the same
parameters to mock.
Signed-off-by: Kefu Chai <kchai@redhat.com>
this fixes the pep8 failure:
```
pep8 runtests: commands[0] | flake8 ceph_detect_init tests
tests/test_all.py:121:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:125:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:129:17: E128 continuation line under-indented for
visual indent
tests/test_all.py:133:17: E128 continuation line under-indented for
visual indent
```
Signed-off-by: Kefu Chai <kchai@redhat.com>
1. A -> B
2. goto standby
3. B mark down
4. A reconnect to B
5. got reset session and dispatch remote reset
6. because remote reset is executed in DispatchQueue, it will be delayed
7. A -> B successfully and begin to send message
8. assert because we found the first message is missing but it's reasonble
if policy.resetcheck is true
Signed-off-by: Haomai Wang <haomai@xsky.com>
because we want to get the right log sequence which mixes ceph logginer and
cerr. Otherwise, cerr output make the logs a little disordered.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Otherwise if message in queue, we will continue to reconnect right now,
it won't meet our expectation that we want our connect request delay
Signed-off-by: Haomai Wang <haomai@xsky.com>
When replacing and someone called mark_down, it will delete_time_event which
isn't allowed. Because we're exchaning EventCenter now!
Signed-off-by: Haomai Wang <haomai@xsky.com>
When we create event thread, it need a little time to enter event loop(like
calling set_owner), if caller is going to call create_file_event before event
thread enter event loop, it will trigger assert.
Signed-off-by: Haomai Wang <haomai@xsky.com>
EventCenter::init is called by other thread instead of event thread, so we
need to move create_file_event to set_owner which is called by event thread.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Previously we only exchange fd when replacing, now we will introduce dpdk
plugin in the near future. It needs all fd used locally which not like
kernel socket shared by all cores.
So we need to add EventCenter swapping to let each socket is associated to
EventCenter.
Signed-off-by: Haomai Wang <haomai@xsky.com>
We are make each AsyncConnection/AsyncMessenger only modify its file event
in event thread. So make sure create/delete_file_event aren't directly called.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Since we are going to close all epoll and cleanup resources, no need to delete
notify fd resource. And another reason is "delete_file_event" doesn't expect
other threads to call
Signed-off-by: Haomai Wang <haomai@xsky.com>
We don't want net_handler rely on config value, caller may expect to pass
different value to set_socket_options according to different socket type
like heartbeat, client socket or server socket.
Signed-off-by: Haomai Wang <haomai@xsky.com>
Various issues can lead to an oversized cache, which
is a precursor to an OOM condition: let's give users
a clearer message with some useful counts that might
hint at what is wrong.
Fixes: http://tracker.ceph.com/issues/16570
Signed-off-by: John Spray <john.spray@redhat.com>
this fixes the warning of
```
running egg_info
creating
/srv/autobuild-ceph/gitbuilder.git/build/build/src/pybind/rados/rados.egg-info
writing
/srv/autobuild-ceph/gitbuilder.git/build/build/src/pybind/rados/rados.egg-info/PKG-INFO
writing top-level names to
/srv/autobuild-ceph/gitbuilder.git/build/build/src/pybind/rados/rados.egg-info/top_level.txt
writing dependency_links to
/srv/autobuild-ceph/gitbuilder.git/build/build/src/pybind/rados/rados.egg-info/dependency_links.txt
writing manifest file
'/srv/autobuild-ceph/gitbuilder.git/build/build/src/pybind/rados/rados.egg-info/SOURCES.txt'
warning: no files found matching 'rados.c'
```
in the out-of-source tree build, rados.c is not located in the same
directory of setup.py, rados.pyx, and rados.pyd. it is in the build_dir,
for example, it could be:
ceph/build/src/pybind/rados/pyrex/rados.c
where ceph/build is the build directory of cmake.
and sdist will include it when running egg_info, because cython's
build_ext module lists `rados.c` as one of the "source_files".
Signed-off-by: Kefu Chai <kchai@redhat.com>
it was put into the directory where .pyx is located. it's not expected
in an out-of-tree build.
* {rados,rbd,cephfs}/setup.py: use build_ext from cython if possible, fallback to
the one from setuptools or distutils
* Distutils.cmake: pass --cython-c-in-temp --build-temp and
--cython-include-dirs to "build_ext" command
Signed-off-by: Kefu Chai <kchai@redhat.com>