* refs/remotes/upstream/pull/17679/head:
qa: get asok path from ceph.conf
qa: use config_path property instead of literal
Reviewed-by: John Spray <john.spray@redhat.com>
Avoids an unnecessary "max" size of the LRU which was used to calculate the
midpoint. Instead, just dynamically move the LRUObjects between top and bottom
on-the-fly.
This change is necessary for a cache which which does not limit by the number
of objects but by some other metric. (In this case, memory.)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This prevents accidental allocation of the map.
Also, privatize the variable to protect from this in child classes.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Zheng observed that an alloc_ptr doesn't really work in this case since any
call to get_replicas() will cause the map to be allocated, nullifying the
benefit. Use a compact_map until a better solution can be written. (This means
that the map will be allocated outside the mempool.)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
The purpose of this is to allow us to track memory usage by cached objects so
we can limit cache size based on memory available/allocated to the MDS.
This commit is a first step: it adds CInode, CDir, and CDentry to the mempool
but not all of the containers in these classes (e.g. std::map). However,
MDSCacheObject has been changed to allocate its containers through the mempool
by converting compact_* containers to the std versions offered through mempool
via the new alloc_ptr.
(A compact_* class simply wraps a pointer to the std:: version to reduce memory
usage of an object when the container is only occasionally used. The alloc_ptr
allows us to achieve the same thing explicitly with only a little handholding:
when all entries in the wrapped container are deleted, the caller must call
alloc_ptr.release().)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
The gymnastics protecting the map failed as the code evolved. Just expose it
normally with a getter.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This ptr is like a unique_ptr except it allocates the underlying object on
access. The idea being that we can save memory if the object is only needed
sometimes.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Stats collectors that want this kind of information should
be looking at the cluster maps to get it.
Reasoning:
- It's confusing to have two places to get at this sort of status
- In the CephFS case, these counters were not that useful as they
globbed all filesystems together.
- It's awkward to have these stats output as perf counters of
ceph-mon daemons, where a naive TSDB collector will not understand
that they are really cluster-wide things.
Inspired by: http://tracker.ceph.com/issues/21311
Signed-off-by: John Spray <john.spray@redhat.com>
Fixes the coverity issues:
** 717282 Uninitialized scalar field
CID 717282 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member seq is not initialized
in this constructor nor in any functions that it calls.
** 717287 Uninitialized scalar field
CID 717287 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member tid is not initialized
in this constructor nor in any functions that it calls.
** 717288 Uninitialized scalar field
CID 717288 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member bits is not initialized
in this constructor nor in any functions that it calls.
** 717290 Uninitialized scalar field
CID 717290 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member epoch is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Fixes the coverity issues:
** 717279 Uninitialized scalar field
CID 717279 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member caps is not initialized
in this constructor nor in any functions that it calls.
** 717280 Uninitialized scalar field
2. uninit_member: Non-static class member action is not initialized
in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member asker is not initialized
in this constructor nor in any functions that it calls.
CID 717280 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
6. uninit_member: Non-static class member lock_type is not initialized
in this constructor nor in any functions that it calls.
** 717281 Uninitialized scalar field
CID 717281 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member last is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
test_misc verifies that ceph fs new will not create a filesystem
on a pool that already contains objects. As part of the test, it
inserts a dummy object into a pool and then attempts to use it for
CephFS. This triggers POOL_APP_NOT_ENABLED. Setting the application
metadata for the pool (and having ceph fs new fail because of the
existing metadata) would then exercise a different failure case.
Signed-off-by: Douglas Fuller <dfuller@redhat.com>
Currently ceph-objectstore-tool can only split dirs that already
meet the usual object number criteria. It won't reduce the cost of
online split for those dirs that would meet the criteria online.
This change uses 'arg1' option for apply-layout-settings to specify
the target hash level wants to split to. Then dirs will be split
offline no matters how many objects they have. This also helps
those pools that forgot to do pre-splitting at their creation time.
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
Current cephfs can support seekdir efficiently. The diverge was
fixed by https://github.com/ceph/ceph/pull/14317
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
When there is large I/O, we need to split it into multiple
tasks. With this patch, we can avoid no buffer allocation
issue for the single write task.
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Signed-off-by: Pan Liu <wanjun.lp@alibaba-inc.com>
Resolves gcc warning:
/home/pdonnell/ceph/src/client/Client.cc: In member function ‘void Client::trim_caps(MetaSession*, int)’:
/home/pdonnell/ceph/src/client/Client.cc:4120:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (s->caps.size() > max)
^
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Fixes the coverity issue:
** 717278 Uninitialized scalar field
CID 717278 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member beat is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Amit Kumar <amitkuma@redhat.com>
When the osd ID existed in the UUID in the same format (e.g. '1-') the
parsing would break returning a bogus UUID that is impossible to find
Signed-off-by: Alfredo Deza <adeza@redhat.com>