Commit Graph

101368 Commits

Author SHA1 Message Date
Casey Bodley
6b0f3ce4cb
Merge pull request #29778 from cbodley/wip-41212
vstart: move [client.rgw] config into [client]

Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
2019-08-23 10:24:41 -04:00
Lenz Grimmer
862876d900
mgr/dashboard: User Management E2E tests (#29641)
mgr/dashboard: User Management E2E tests 

Reviewed-by: Tiago Melo <tmelo@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
2019-08-23 14:00:16 +00:00
Jos Collin
f13f9f9fc1
qa/tasks: drop object inherit
Signed-off-by: Jos Collin <jcollin@redhat.com>
2019-08-23 15:29:27 +05:30
Lenz Grimmer
d373178c43
mgr/dashboard: run-backend-api-tests.sh CI improvements (#29504)
mgr/dashboard: run-backend-api-tests.sh CI improvements

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
2019-08-23 09:11:39 +00:00
Kefu Chai
e909031d3c
Merge pull request #29590 from Aran85/fix_proc_replica_log
osd: merge replica log on primary need according to replica log's crt

Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-08-23 14:59:02 +08:00
Changcheng Liu
940a5b5ae3 msg/async/Stack: rename variable to improve readability
1. rename var i to be worker_id when creating Worker
"i" is assigned to be Worker::id, it means worker's id

2. rename EventCenter::idx to EventCenter::center_id
"idx" is EventCenter's index in global_centers obj.
rename it to be center_id.

3. rename EventCenter::init API's parameter n to be nevent
"n" is actually assigned to EventCenter::nevent. rename it
to be "nevent".

4. rename EventCenter::init API's paramter t to be type
"t" is corresponding to Epoll Driver's implementation's type.

5. rename EpollDriver::size to be EpollDriver::nevent
"size" is actually epoll events number, rename it to be "nevent"

6. use event_id as index name to get event instead of "j"

7. rename "nw" to be "nowait"

8. Processor::start unify variable name with Processor::accept & Processor::stop
==> auto &l to be auto &listen_socket

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
fdd4053d12 msg/async/rdma: remove stack from RDMAWorker
There's no need to cache stack since RDMAWorker already has
Inifiniband obj ib & RDMADispatcher obj dispatcher.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
44a1820da8 msg/async/rdma: use shared_ptr to manage RDMADispatcher obj
1. Don't use bare pointer to manage RDMADispatcher obj.

2. access RDMADispatcher obj directly instead of accessing it
from RDMAStack. This could avoid caching RDMAStack obj in
RDMAWorker & RDMADispatcher.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
923b30f57e msg/async/rdma: remove stack from RDMADispatcher
There's no need to cache stack since RDMADispatcher already has
Inifiniband obj ib.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
297452c2c6 msg/async/rdma: use shared_ptr to manage Infiniband obj
1. Don't use bare pointer to manage Infiniband obj.

2. access Infiniband obj directly instead of accessing it from
RDMAStack. This could avoid caching RDMAStack obj in RDMAWorker
& RDMADispatcher.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
2754d60f66 msg/async/rdma: implement function to prefetch buffers
The original RDMAConnectedSocketImpl::read read date from buffers and
prefertch data into buffers for next round of reading. It makes the
logical a little complex and the code isn't smooth to be read.
In this patch:
1) RDMAConnectedSocketImpl::buffer_prefetch private API is added to
prefetch data into buffers at the head of read_buffers.
2) reduce one time of calling notify() to reduce context switches.
It's really not needed to notify upper layer to read data since current
read operation hasn't finished yet.
3) Simplify RDMAConnectedSocketImpl::read implementation.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
9b63845ad1 msg/async/rdma: remove redundant code
1. Below three bits are meaningless in pollfd::events field:
   POLLERR, POLLHUP, or POLLNVAL.
2. QueuePair::pd is initialized in the initialize list.
   There's no need to assign same value to it.
3. Remove the never used function Chunk::set_bound
4. Remove the never used function Chunk::set_offset
5. Remove the never used function QueuePair::is_error
6. Remove SimplePolicyMessenger used vars
7. remove socket_fd() interface since it's never used.
   All data write/read is based on ConnectedSocketImpl::fd.
   So, there's no need to expose socket_fd since it's never used.
8. Remove RDMAServerSocketImpl::get_fd which is not used.
   BTW, RDMAServerSocketImpl::fd has the same function as get_fd.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
c86e927888 msg/async/rdma: show port state with string
Show the port state with string is more easy to be read through
value.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:36:05 +08:00
Changcheng Liu
b61a48c197 msg/async/rdma: convert port_id from type uint8_t to int for output
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 14:35:52 +08:00
Kefu Chai
1116362118
Merge pull request #29747 from liewegas/wip-39546
osd/PeeringState: do not complain about past_intervals constrained by oldest epoch

Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-08-23 13:28:52 +08:00
Kefu Chai
25ed83e14a
Merge pull request #29624 from NancySu05/osdmonitor_markmedown
mon:C_AckMarkedDown has not handled the Callback Arguments

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-08-23 13:23:46 +08:00
Kefu Chai
5e5eca2834
Merge pull request #29738 from ifed01/wip-ifed-alloc-cleanup
os/bluestore: minor improvements/cleanup around allocator

Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
2019-08-23 13:22:52 +08:00
Kefu Chai
ed8a0fb3c6
Merge pull request #29614 from votdev/issue_41205
mgr/dashboard: Access control database does not restore disabled users correctly

Reviewed-by: Patrick Seidensal <pnawracay@suse.com>
2019-08-23 13:20:52 +08:00
Kefu Chai
4deb2b90b5
Merge pull request #29146 from badone/wip-tracker-40835-OSDCap.PoolClassRNS-abort
osd/OSDCap: Check for empty namespace

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-08-23 13:16:22 +08:00
Kefu Chai
263a78c3dd
Merge pull request #25697 from Aran85/fix-onode-trim
os/bluestore: more aggressive deferred submit when onode trim skipping

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
Reviewed-by: Igor Fedotov <ifedotov@suse.com>
2019-08-23 13:15:27 +08:00
Kefu Chai
b3c1c4c1cd
Merge pull request #28488 from liuchang0812/show-pool-id-in-pool-ls-cmd
mon: show pool id in pool ls command

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2019-08-23 13:13:32 +08:00
Kefu Chai
0bbaa185a5
Merge pull request #24636 from rzarzynski/wip-denc-container_base
denc: slightly optimize container_base::bound_encode

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-08-23 13:12:04 +08:00
Kefu Chai
bfce110511
Merge pull request #29756 from Aran85/fix-repair-object
osd: clear PG_STATE_CLEAN when repair object

Reviewed-by: David Zafman <dzafman@redhat.com>
2019-08-23 13:08:49 +08:00
Changcheng Liu
ae6759aa52 msg/async/rdma: rename variable to improve readability
Device::binding_port
1. port_id is more meaningful compared to i as variable name.
2. start port_id from 1 instead of 0.

PoolAllocator::malloc
1. make clear relationship among buffer/chunk/block/memory_region with new
variable name.
2. define the variable when it's first being used.

RDMAConnectedSocketImpl::submit
1. use "wait_copy_len" to replace "need_reserve_bytes" which stands for the memory
that is waiting to be copied into chunk.
2. use "copy_start" to replace "copy_it" which stands for the start iterator to be copied.
3. use "total_copied" to replace "total" which stands for the memory that has been copied.

allocate huge page
1. use "HUGE_PAGE_SIZE_2MB" to be used for 2MB page alignment.
2. use "ALIGN_TO_PAGE_2MB" to stands align request size to 2MB.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
a62ce898f3 msg/async/rdma: make clear to get mem_info address
The parameter "block" points to mem_info::chunks space. It's not quite
clear about the function of "reinterpret_cast<mem_info *>(block) - 1;".
Get the mem_info::chunks address and minus the member offset from struct
head to get mem_info address.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
32da5f1d03 msg/async/rdma: use different strategy to reset read/write chunk
When releasing read chunk to pool, the chunk::offset & chunk::bound
should be reset to zero. For write chunk, it's better to reset
chunk::offset to zero and chunk::bound to chunk length which means that
[offset, bound) is writable.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
60a87c9db9 msg/async/rdma: cosmetics initialize ibv_send_wr* var
API usage:
int ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr, struct ibv_send_wr **bad_wr)
Input Parameters:
   qp struct ibv_qp from ibv_create_qp
   wr first work request (WR)
Output Parameters:
   bad_wr pointer to first rejected WR
Return Value:
   0 on success, -1 on error.
   If the call fails, errno will be set to indicate the reason for the failure.
To avoid wrong checking return value, it's better to initialize the
value to be nullptr.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
7078506107 msg/async/rdma: cosmetics RDMAWorker listen & connect & get_reged_mem
1. There's no need to get stack & dispatcher from RDMAStack again
since RDMAWorker has stored the value.
2. cache the Infiniband object to be used in local scope.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
5e53dad5ad msg/async/rdma: cosmetics RDMAConnectedSocketImpl::read_buffers
After refactoring, there's no need to do below judgement
    -  if (c != buffers.end() && (*c)->over())
    -    ++c;

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:55 +08:00
Changcheng Liu
282499b77f msg/async/rdma: cosmetics post_chunks_to_rq implementation
1. It's not proper to allocate large space in stack. e.g. rx_queue_len is 4096.
The patch changes to allocate rx_work_request and isge in heap.

2. Set rx_work_request and isge array whole space into zero which could avoid
setting the space into zero one by one in the while loop.

3. Change parameter name "num" to be "rq_wr_num" to improve readiness
rq_wr_num i.e. receive-queue_work-request_number

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 11:35:26 +08:00
Changcheng Liu
6a0d3df90a msg/async/rdma: refine Chunk construction function
1. all values are initialized in construction function
   In this way, it's easy to construct Chunk object in
   PoolAllocator::malloc function.
2. For read chunk, member bound is initialized to be 0.
3. For send chunk, member bound is initialzied to be full space size.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:46:16 +08:00
Changcheng Liu
6823d2d8cd msg/async/rdma: avoid long lambda function for readability
Extract the long lambda function to improve readability.
There's no advantage since "this" pointer is also needed
in original lambad function.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:46:16 +08:00
Changcheng Liu
060c5c8e3a msg/async/rdma: define handle_rx_event to handle recv-comple-queue
1. define handle_rx_event to let dispatch handle
recvive-completion-queue
2. simplify RDMADispatcher::polling implementation

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
1c76c13207 msg/async/rdma: deal with all RDMA device async event
1. List all asynchronous event of the RDMA device
2. Output the fatal error events to check RDMA device status

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
0b31f416fa msg/async/Event: simplify EventCenter::process_events implementation
The original implementation makes it's hard to understand:
1) Whether timer event should be executed.
2) How long should epoll wait for timeout.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
c7f87c3ff0 msg/async/Event: simplfy logical implementation
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
5ec51a31dd msg/async/rdma: simplify RDMAConnectedSocketImpl::read implementation
After reading one chunk, the chunk could be pushed into buffer list if its
effecitve content size is not zero. In this case, it also means that the
caller has got the required read length. Then all the continuous chunk will
be pushed into buffer list since the effective content size is not zero.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
de471d003b msg/async/rdma: simplify Cluster::get_buffers implementation
Keep same logic:
1. If parameter block_size is zero, then allocate all the free chunks
to parameter std::vector<Chunk*> &chunks. i.e.
   chunk_buffer_number = free_chunks.size()
2. If paramter block_size is not zero, then allocate the requested or
all the free chunks to paramter std::vector<Chunk*> &chunks.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
c946349871 msg/async/rdma: simplify chunk::write implementation
Keep same logic to improve readability

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
947520c336 msg/async/rdma: simplify chunk::read implementation
1. offload chunk::read without managing bound.
2. reset chunk::offset & chunk::bound before releasing to pool.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
f1668da1ce msg/async/rdma: use Chunk::get_size to get chunk size
remove Chunk::over interface and add Chunk::get_size interface
1) It's not clear when reading "over" function name.
2) Some places need know the current chunk block effective content size.
3) "Chunk::over()" could be replaced by "Chunk::get_size() == 0"

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
2d4890580f msg/async/rdma: seperate Device construction if rdma_cm is used
If ms_async_rdma_cm is false, there's no need to call the api
rdma_get_device. If rdma_get_device is called, the devices remain
opened while librdmacm is loaded. This is not what we want when
ms_async_rdma_cm is false.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:22 +08:00
Changcheng Liu
0e3db04d04 msg/async/rdma: operate event fd with event_{read,write}
1. use wrapper function event_read & event_write to access
event file descriptor.
2. change event fd access value name to be event_val.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
49b8ef0746 msg/async/rdma: fix error argument to get right qp state
1. It's wrong to use "-1" as argument to query queue state.
In rdma library, ibv_query_qp will call ibv_cmd_query_qp to query
queue state. If "-1" is used as attr_mask, ibv_cmd_query_qp will
return error EOPNOTSUPP which means query failed.

2. In class QueuePair, is_error() could use member function get_state()
to get the queue pair state.

3. It's better to use qp_state as queue pair state according to
ibv_query_qp manual guide.
   struct ibv_qp_attr {
      enum ibv_qp_state       qp_state;            /* Current QP state */
      enum ibv_qp_state       cur_qp_state;        /* Current QP state - irrelevant for ibv_query_qp */
      ...

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
b2d3f5e097 msg/async/rdma: export RDMAV_HUGEPAGES_SAFE before ibv_fork_init
In rdma-core library, ibv_fork_init will check environment variable
RDMAV_HUGEPAGES_SAFE to decide whether huge page is usable in system.
It doesn't make sense to export RDMAV_HUGEPAGES_SAFE env after
calling ibv_fork_init.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
4810e40d44 msg/async/rdma: use ibv_port_attr object type in Port class
1. Avoid to do memory management without using pointer to operate
operate the allocated space. Or, it could have memory leak.
2. Since member type has been changed in class Device, it need
to use member domain operator "." to access to the sub-member in
object.
3. There's no need to consider experimental API of ibv_query_port.
So, merge ibv_query_port in the prolog.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
b4596011f5 msg/async/rdma: cosmetics by set member value in initialize list
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
cdfcc6b59c msg/async/rdma: define package sequence numbers macro
Refer to Doc: InfiniBandTM Architecture Specification Volume 1 Ver1.2.1
Section: 9.2 BASE TRANSPORT HEADER

bits  |31---------24 | 23-----------16 | 15----------8 | 7---------0 |
bytes |______________________________________________________________|
0 - 3 |____OpCode____|__|SE|M|Pad|Tver_|_________ Partition Key______|
4 - 7 |___Reserved___|______________Destination QP___________________|
8 -11 |A|Reserved 7__|________ PSN - Packet Sequence Number _________|

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
4f5a31ab9d msg/async/rdma: limit buffer size under rdma max memory region size
The allocated buf size should be under hardware's max_mr_size. Or it'll
trigger out-of-bound access problem when calling ibv_reg_mr.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00
Changcheng Liu
9c7ba67cc7 msg/async/rdma: check device_attr->max_srq is not zero
Some rdma devices don't support srq(shared receive queue).
Check hardware attribute if ceph is configured to use srq.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2019-08-23 10:45:05 +08:00