summaryrefslogtreecommitdiffstats
path: root/src/os/HashIndex.cc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libc++: use ceph:: namespaced data typesNoah Watkins2014-01-181-1/+1
| | | | | | | Switches the implemetnation of smart pointers and unordered map/set to use the ceph:: versions. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* common, os, osd, test, tools: FileStore must work with ghobjects rather than ↵David Zafman2013-09-261-44/+44
| | | | | | | | | | | | | | | | | | | hobjects Add ghobject_t to hboject.h header Add constants NO_SHARD/NO_GEN and change gen_t/shard_t Convert other headers from hobject_t to ghobject_t Mostly straight hobject_t to ghobject_t for src/os cc files Fix tools and tests and enable ceph-dencoder Add filename generation and parsing including unittest addition Get ceph-filestore-dump to build Add gen/shard to DBObjectMap::ghobject_key() and update test case Add CEPH_FS_FEATURE_INCOMPAT_SHARDS new FileStore feature Add CEPH_OSD_FEATURE_INCOMPAT_SHARDS new osd feature Fixes: #5862 Signed-off-by: David Zafman <david.zafman@inktank.com>
* HashIndex: reset attr upon split or merge completionSamuel Just2013-07-251-13/+2
| | | | | | | | | A replay of an in progress merge or split might make our counts unreliable. Fixes: #5723 Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* librados, os, osd, osdc, test: Add support for client specified namespacesDavid Zafman2013-07-091-1/+1
| | | | | | | | | | | | Add rados_ioctx_namespace_set_key() and librados::IoCtx::namespace_set_key() Add namespace to admin-daemon operations Support namespace in osd map command Add namespace to object_locator_t and hobject_t Add random namespaces to psim program Feature: #4982 (OSD: namespaces pt 1 (librados/osd, not caps)) Signed-off-by: David Zafman <david.zafman@inktank.com>
* Merge remote-tracking branch 'gh/last'Sage Weil2013-05-291-3/+12
|\
| * HashIndex: sync top directory during start_split,merge,col_splitSamuel Just2013-05-281-3/+12
| | | | | | | | | | | | | | | | | | | | | | Otherwise, the links might be ordered after the in progress operation tag write. We need the in progress operation tag to correctly recover from an interrupted merge, split, or col_split. Fixes: #5180 Backport: cuttlefish, bobtail Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | os/HashIndex.cc: reduce scope of a local variableDanny Al-Gaaf2013-05-161-2/+2
|/ | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* DBObjectMap, hobject: add helpers for pgid bit matchingSamuel Just2013-03-141-3/+3
| | | | | | | | Create helpers in hobject for generating prefixes for a pg as well as matching hobjects against a pgid/numpgs combo. Use these in HashIndex.cc. Signed-off-by: Samuel Just <sam.just@inktank.com>
* HashIndex: _collection_list_partial must tolerate NULL nextSamuel Just2013-03-141-0/+3
| | | | | | | Backport: bobtail Fixes: #4379 Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
* HashIndex.cc: use empty() instead of size() to check for emptinessDanny Al-Gaaf2013-02-131-1/+1
| | | | | | | | Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* Merge remote-tracking branch 'upstream/wip_split2' into nextSamuel Just2012-12-111-0/+225
|\ | | | | | | Reviewed-by: Greg Farnum <greg@inktank.com>
| * HashIndex: init exists in col_split_level and reset_attrSamuel Just2012-12-111-2/+2
| | | | | | | | Signed-off-by: Samuel Just <sam.just@inktank.com>
| * os/: Add CollectionIndex::prep_deleteSamuel Just2012-12-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an unlink is interupted between removing the file and updating the subdir attribute, the attribute will overestimate the number of files in the directory. This is by design, at worst we will merge the collection later than intended, but closing the gap would require a second subdir xattr update. However, this can in extreme cases result in a collection with subdirectories but no objects. FileStore::_destry_collection would therefore see an erroneous -ENOTEMPTY. prep_delete allows the CollectionIndex implementation to clean up state prior to removal. Signed-off-by: Samuel Just <sam.just@inktank.com>
| * os/: Add failure CollectionIndex failure injectionSamuel Just2012-12-051-1/+1
| | | | | | | | | | | | | | | | | | Several pieces of HashIndex involve multi-step operations which are sensitive to OSD crashes. This patch introduces failure injection to force retries from various points in the LFNIndex helper methods to be used with store_test.cc. Signed-off-by: Samuel Just <sam.just@inktank.com>
| * os/: add filestore collection_splitSamuel Just2012-12-051-0/+197
| | | | | | | | Signed-off-by: Samuel Just <sam.just@inktank.com>
* | HashIndex: fix list_by_hash handling of next->is_max()Samuel Just2012-12-071-1/+3
|/ | | | | | | | | | | | get_path_str() should not handle hobject_t::get_max(). get_path_str() now asserts that the passed object is not max and the callers now check for is_max(). This caused HashIndex.cc to incorrectly scan an entire collection before returning no objects rather than scanning the top level and returning no objects. It did not actually list_by_hash to return an incorrect answer, however. Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
* os/HashIndex: use set<pair<string, hobject_t>> rather than multimapSamuel Just2012-07-201-4/+5
| | | | | | | | | | | Multimap does not make any guarantees about ordering of different values with the same key. list_by_hash, however, assumes that the iterator order matches hobject_t order. Thus, we use set<pair<string, hobject_t> > to get the proper ordering. Backport: stable Signed-off-by: Samuel Just <sam.just@inktank.com>
* src/: Add namespace and pool fields to hobject_tSamuel Just2012-06-061-1/+1
| | | | | | | | | From this point, hobjects in the ObjectStore will be globally unique. This will allow us to avoid including the collection in the ObjectMap key encoding and thereby enable efficient collection renames and, eventually, collection splits. Signed-off-by: Samuel Just <sam.just@inktank.com>
* log: new logging infrastructureSage Weil2012-03-271-1/+1
| | | | | | | | | - explicitly defined subsystems, and ceph_subsys_FOO enums to go with them - modular log system with Entry object - separate gather level and log level - drop lots of DoutStreambuf hackery Signed-off-by: Sage Weil <sage@newdream.net>
* ObjectMap: use Index object for locking rather than path objectSamuel Just2012-03-161-0/+1
| | | | Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
* ReplicatedPG: init backfill infos to last_backfillSamuel Just2011-12-221-3/+3
| | | | | | | | | | We can scan starting from last_backfill to avoid rescanning portions of the collection recovered by normal recovery. collection_list_partial now includes begin if present. next will be <= the next object in the collection. This way we can scan starting at last_backfill without skipping last_backfill. Signed-off-by: Samuel Just <rexludorum@gmail.com>
* objectstore: make list by hash *next > instead of >=Sage Weil2011-12-141-2/+2
| | | | | | | | | | | | This means we should set it to a hash boundary or the last item of our result set (not the next item we didn't include). It means that during backfill we can set our last_backfill to the last object we did recover and be sure that any new files locally will be included in the next result set, and we can bound that result set by that last object recovered and not include it in the resulting range. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
* ObjectStore,ReplicatedPG: remove old collection_list_partialSamuel Just2011-12-071-99/+20
| | | | | | | No need for the old collection_list_partial instance: it's cleaner to just use an hobject_t as the collection list handle. Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
* hobject_t: make filestore_hobject_key_t 64 bitsSage Weil2011-12-071-1/+1
| | | | | | So we can return 0x100000000 when max=true. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
* os/HashIndex: some minimal debug outputSage Weil2011-12-071-0/+5
| | | | Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
* ObjectStore: Add collection_list_partial for hash orderSage Weil2011-12-071-21/+121
| | | | Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
* os: rename and make use of the split_threshold parameter.Greg Farnum2011-11-091-1/+1
| | | | | | | | | | | This was accidentally left out of the must_split calculation. Put it in, and rename it to split_multiplier (as that is a much better name for how it's used). In the default case this won't actually change behavior, but it makes the behavior configurable as it's supposed to be. Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
* os/hashindex: fix #includeSage Weil2011-08-301-0/+1
| | | | Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
* osd/,os/,osdc/: Convert collection_list_handle_t to a structSamuel Just2011-08-301-4/+6
| | | | | | | | Previously, we stored the collection_list handle as an opaque uint64_t. Now, collection_list_handle_t is a struct defined in types.h. Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
* FileStore: CollectionIndex, HashIndex, IndexManagerSamuel Just2011-08-301-0/+473
Adds ColletionIndex, an interface for collection indexing systems, and HashIndex, a mechanism for organising a prehashed collection. Signed-off-by: Samuel Just <samuel.just@dreamhost.com>