summaryrefslogtreecommitdiffstats
path: root/src/os/ObjectStore.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #57490 from rzarzynski/wip-osd-configurable-ideal_list_maxLaura Flores2024-07-301-3/+1
|\ | | | | osd: make the chunking in e.g. PG deletion controlable
| * osd: make the chunking in e.g. PG deletion controlableRadoslaw Zarzynski2024-05-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation behind this patch is to let users control the number of sweeps / number of objects per sweep during PG deletion which is currently restricited to `64` at max. ``` std::pair<ghobject_t, bool> PG::do_delete_work( ObjectStore::Transaction &t, ghobject_t _next) { // ... int max = std::min(osd->store->get_ideal_list_max(), (int)cct->_conf->osd_target_transaction_size); ``` Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* | os/bluestore: enable async manual compactionsIgor Fedotov2024-05-081-1/+1
| | | | | | | | Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
* | Merge pull request #56995 from athanatos/sjust/wip-65185-scrub-attr-errorYuri Weinstein2024-05-011-2/+3
|\ \ | |/ |/| | | | | | | osd: only call stat/getattrs once per object during deep-scrub Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
| * os/: modify getattrs to clear attrs out param before populatingSamuel Just2024-04-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing in a non-empty map would otherwise exhibit quite unexpected behavior. For the bufferptr overload, any preexisting entries would not be overwritten due to how std::map::emplace behaves. For the bufferlist overload, it would result in appending to any pre-existing entries. The prior commit cleans up one such inadvertent caller which resulted in the below bug. Fixes: https://tracker.ceph.com/issues/65185 Signed-off-by: Samuel Just <sjust@redhat.com>
* | tools/ceph-objectstore-tool: open object store's DB in read-only modeIgor Fedotov2024-02-141-0/+6
|/ | | | | | | for operations which permit that. This provides additional chances to access corrupted object store. Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
* os: introduce ObjectStore::refresh_perf_counters() method.Igor Fedotov2023-12-081-0/+7
| | | | | | This is a common method to refresh Object Store performance counters. Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
* os/bluestore: mark has_null_manager() constIgor Fedotov2022-10-031-1/+1
| | | | Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
* osd: Modify OSD Fast-Shutdown to work safelyGabriel BenHanokh2022-03-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | quiesce all activities and destage allocations to disk before killing the OSD 1) keep the old (unsafe) fast-shutdown when we are not using NCB (non null-manager()) 2) skip service.prepare_to_stop() which can take as much as 10 seconds 3) skip debug options in fast-shutdown 4) set_state(STATE_STOPPING) which will stop accepting new tasks to this OSD 5) clear op_shardedwq queues, this is safe since we didn't started processing them 6) stop timer 7) drain osd_op_tp (no new items will be added) 8) now we can safely call umount which will close_db/bluefs and will destage allocation to disk 9) skip _shutdown_cache() when we are in the middle of a fast-shutdown 10) increase debug level on fast-shutdown 11) add option for bluestore_qfsck_on_mount to force scan on mount for all tests 12) disable fsck-on-umount when running fast-shutdown 13) add an option to increase debug level at fast-shutdown umount() 14) set a time limit to fast-shutdown 15) Bug-Fix BlueStore::pool_statfs don't access db after it was removed 16) Fix error message for qfsck (error was caused by PR https://github.com/ceph/ceph/pull/44563) 17) make shutdown-timeout configurable Fixes: https://tracker.ceph.com/issues/53266 Signed-off-by: Gabriel Benhanokh <gbenhano@redhat.com>
* os: rework the factory of ObjectStore.Radoslaw Zarzynski2021-07-211-0/+6
| | | | | | | | | | | | | | The goals here are: 1. make deprecation of `FileStore` easier as creational dependencies are segmented into a variant of `create()` that could be cut off altogether with `FileStore`. 2. Allow crimson adapt `create()` without burdening it with `FileStore`'s dependencies. 3. Simplify the implementation as a bunch of preprocessor directives accumulated there over the time. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* os: use transparent comparator in ObjectStore::getattrs()Kefu Chai2021-06-291-3/+3
| | | | | | | | | | | | | | for two reasons: - better performance when looking on in the return map if the key is not a string, as we don't need to create a temporary string as the key - improve the performance of crimson::AlienStore, as the latter uses the transparent comparator. as, without this change, we'd have to perform a deep copy to fill up the returned map with its non-transparent-comparator version. Signed-off-by: Kefu Chai <kchai@redhat.com>
* os/ObjectStore: fix typo in commentswangyunqing2021-06-141-1/+1
| | | | Signed-off-by: wangyunqing <wangyunqing@inspur.com>
* os: let ObjectStore::create() return unique_ptr<>Kefu Chai2021-05-271-6/+8
| | | | | | | | | instead of returning a raw pointer of ObjectStore, let `ObjectStore::create()` return a `std::unique_ptr<ObjectStore>`. less error prune this way. Signed-off-by: Kefu Chai <kchai@redhat.com>
* os: add collection_list_legacyMykola Golub2020-08-201-0/+7
| | | | | | which provides the old collection_list behaviour on the bluestore. Signed-off-by: Mykola Golub <mgolub@suse.com>
* common: stub certain modules and functions on WindowsLucian Petrut2020-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to stub certain modules and functions for Windows builds. Some of them will be implemented in subsequent commits, some are platform specific and will be skipped. Modules: * module.c * subprocess.cc * blkdev.cc * dns_resolve.cc * numa.cc * syslog.h * statvfs.h * libblk * neorados Functions: x signal functions x fork x chown * socketpair_cloexec * dump_open_fds * run_cmd * is_symlink * CInode::d_type * nbd commands Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* mon: Build ceph-mon without using namespace declarations in headersAdam C. Emerson2020-03-221-2/+2
| | | | | | | This is part of a series of commits to clean up using namespace at top level in headers. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* os: Build target 'common' without using namespace in headersAdam C. Emerson2020-03-071-4/+6
| | | | | | | | Part of a changeset to allow building all of 'common' without relying on 'using namespace std' or 'using namespace ceph' at toplevel in headers. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* os/bluestore: add BlueStore::omap_get_values()Chunmei Liu2020-02-281-0/+9
| | | | | | | | | | used by crimson::alienstore. as crimson is not using `ObjectStore::get_omap_iterator()` for implementing CEPH_OSD_OP_OMAPGETVALS op. instead, it's using a paged variant of `ObjectStore::omap_get_values()`, which only exists in CyanStore before this change. Signed-off-by: Chunmei Liu <chunmei.liu@intel.com>
* crimson:common add TOPNSPC namespace for ceph and crimsonChunmei Liu2020-02-281-2/+1
| | | | | | | | | | some code coexist in crimson seastar environment and posix environment, so add namespace to avoid same function conflict, for example add namespace for CephContext, since the new namespace for classic ceph-osd, need modify all files declare use CephContext by including "common_fwd.h" which defined the namespace for each environment. Signed-off-by: Chunmei Liu <chunmei.liu@intel.com>
* common/RefCountedObj: cleanup con/desPatrick Donnelly2019-09-161-5/+5
| | | | | | | | | | | | | | | | | | Also, don't allow children to set nref (to 0). This is the more significant change as it required fixing various code to not do this: <reftype> ptr = new RefCountedObjectFoo(..., 0); as a way to create a starting reference with nref==1. This is a pretty bad code smell so I've converted all the code doing this to use the new factory method which produces the reference safely: auto ptr = ceph::make_ref<RefCountedObjectFoo>(...); libradosstriper was particularly egregious in its abuse of setting the starting nref. :( Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* os/bluestore: introduce shallow (quick-fix) mode for bluestore fsck/repair.Igor Fedotov2019-09-111-0/+3
| | | | Signed-off-by: Igor Fedotov <ifedotov@suse.com>
* Merge pull request #30061 from xiexingguo/wip-sparse-readXie Xingguo2019-09-071-0/+52
|\ | | | | | | | | os, osd: readv Reviewed-by: Sage Weil <sage@redhat.com>
| * os: implement readvxie xingguo2019-09-041-0/+52
| | | | | | | | | | | | | | | | Currently only works for bluestore. The default version still reads each extent separately synchronously, but I think that should not be a concern? Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
* | os/ObjectStore: fix typo in commentsKefu Chai2019-08-271-1/+1
|/ | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* osd: report per-pool omap support via store_statfs_tSage Weil2019-08-061-1/+2
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* objclass: add cls_get_osd_min_alloc_size helperMykola Golub2019-06-231-0/+5
| | | | Signed-off-by: Mykola Golub <mgolub@suse.com>
* os: break Transaction of of Objectstore, use in crimsonSamuel Just2019-05-101-1232/+3
| | | | | | Transaction is needed in crimson, but not ObjectStore. Signed-off-by: Samuel Just <rexludorum@gmail.com>
* tools/ceph-objectstore-tool: dump onode internal metadata.Igor Fedotov2019-04-291-0/+18
| | | | | | Supported for BlueStore only. Signed-off-by: Igor Fedotov <ifedotov@suse.com>
* os: Update ObjectStore.h to work without using namespaceAdam C. Emerson2019-03-291-136/+131
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* os:enable ObjectStore::statfs() api to return OS alert list.Igor Fedotov2019-01-261-1/+2
| | | | Signed-off-by: Igor Fedotov <ifedotov@suse.com>
* os/bluestore: report numa node info for storageSage Weil2019-01-041-0/+8
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* Revert "os/objectstore: add new op OP_CREATE for create a new object."Kefu Chai2018-12-311-15/+0
| | | | | | | This reverts commit 22f73ba62eb1fe337622ea2aefdcd829f8def851. Fixes: http://tracker.ceph.com/issues/37774 Signed-off-by: Kefu Chai <kchai@redhat.com>
* Merge pull request #22385 from majianpeng/touch-omit-kvdbKefu Chai2018-12-311-0/+15
|\ | | | | | | | | os/objectstore: add a new op OP_CREATE. Reviewed-by: Sage Weil <sage@redhat.com>
| * os/objectstore: add new op OP_CREATE for create a new object.Jianpeng Ma2018-11-191-0/+15
| | | | | | | | | | | | For OP_CREATE in bluestore mean node didn't exist, so skip search form kvdb. Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
* | os: extend ObjectStore interface with per-pool statistics access methodIgor Fedotov2018-12-061-0/+1
| | | | | | | | Signed-off-by: Igor Fedotov <ifedotov@suse.com>
* | os: Transaction::_update_op_bl doesn't copy bl::_buffers anymore.Radoslaw Zarzynski2018-12-011-8/+4
| | | | | | | | Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* | common: abstract the container type of bufferlist::_buffers.Radoslaw Zarzynski2018-12-011-2/+2
|/ | | | Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* os: Transaction uses append_hole() to minimize bl:_buffers inflation.Radoslaw Zarzynski2018-10-311-15/+10
| | | | | | | | | | | This could be useful as the used `::append(const ptr&)` variant does not provide any measures (like coalescing adjacent bptrs) to prevent inflation of the internal structures of a bufferlist. That is, each call was reflected in dynamic node allocation for the `_buffers` list. Secondary effect of this behavior is increased iteration cost driven by large number of elements likely scattered over memory. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* Merge PR #24473 into masterSage Weil2018-10-151-1/+1
|\ | | | | | | | | | | | | * refs/pull/24473/head: common: drop get_contiguous() from ceph::bufferlist. Reviewed-by: Sage Weil <sage@redhat.com>
| * common: drop get_contiguous() from ceph::bufferlist.Radoslaw Zarzynski2018-10-081-1/+1
| | | | | | | | Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
* | osd: offload dumping cache stats to the object storeMohamad Gebai2018-10-101-4/+3
| | | | | | | | Signed-off-by: Mohamad Gebai <mgebai@suse.com>
* | osd: pass a stream to flush_cache commands for more verbosityMohamad Gebai2018-10-101-1/+1
| | | | | | | | Signed-off-by: Mohamad Gebai <mgebai@suse.com>
* | osd: implement flush_cache() method for FilestoreMohamad Gebai2018-10-101-1/+1
| | | | | | | | Signed-off-by: Mohamad Gebai <mgebai@suse.com>
* | osd: add clear_cache and get_cache_object_count commandsMohamad Gebai2018-10-101-0/+3
| | | | | | | | | | | | Fixes: http://tracker.ceph.com/issues/24176 Signed-off-by: Mohamad Gebai <mgebai@suse.com>
* | common: fix typosKefu Chai2018-09-211-4/+4
| | | | | | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* | common/Finisher: only queue empty only wake up waiter.Jianpeng Ma2018-09-201-1/+8
|/ | | | Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
* os/ObjectStore: add merge_collection operation to TransactionSage Weil2018-09-071-0/+22
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* cleanup: Replace always-false assertions with abortAdam C. Emerson2018-08-271-1/+1
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* os: Use ceph_assert for assertsAdam C. Emerson2018-08-271-30/+30
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* os: Minor fixes in comments describing a transactionBryan Stillwell2018-05-311-2/+2
| | | | | | | Help make the comments clearer by correcting a few mistakes when describing a transaction. Signed-off-by: Bryan Stillwell <bstillwell@godaddy.com>