Commit Graph

24788 Commits

Author SHA1 Message Date
Danny Al-Gaaf
060d2d57db osdc/Filer.h: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:37 +01:00
Danny Al-Gaaf
844671ef14 osdc/Filer.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:37 +01:00
Danny Al-Gaaf
49c547061e osd/osd_types.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:37 +01:00
Danny Al-Gaaf
273517af14 osd/SnapMapper.cc: use empty() instead of size() == 0
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:37 +01:00
Danny Al-Gaaf
10b0839c2a osd/ReplicatedPG.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
293bb07204 osd/PG.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
cdfce02151 osd/OSDMap.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
812ca2136b osd/OSD.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
7647003fe9 os/LFNIndex.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
c089f5d55b mds/Migrator.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
d777e5a819 os/JournalingObjectStore.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
16fa6f11ad os/FlatIndex.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:36 +01:00
Danny Al-Gaaf
b374a3a1f8 os/FileStore.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:35 +01:00
Danny Al-Gaaf
9704dde121 msg/Pipe.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:35 +01:00
Danny Al-Gaaf
62f00f0ec3 msg/Pipe.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:35 +01:00
Danny Al-Gaaf
d7936e8b69 mon/OSDMonitor.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:35:35 +01:00
Danny Al-Gaaf
344feba0b9 mds/journal.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:30:51 +01:00
Danny Al-Gaaf
d2026a99bc mds/events/EMetaBlob.h: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:23:27 +01:00
Danny Al-Gaaf
18b4a17ba7 mds/SnapRealm.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:22:00 +01:00
Danny Al-Gaaf
206cd8d603 mds/Migrator.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Danny Al-Gaaf
2b902b3eeb mds/MDCache.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Danny Al-Gaaf
55e8bcc074 mds/CDir.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Danny Al-Gaaf
7a3e2ee646 librados/librados.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Danny Al-Gaaf
ebd959b328 kv_flat_btree_async.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Danny Al-Gaaf
566b60bffa common/Finisher.cc: prefer prefix ++operator for iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-18 12:20:43 +01:00
Sam Lang
ba5c935e78 mds: Add config option for log segment size
The mds log segment size is chosen from the
default layout object size (4MB).  Add a parameter
to the config to enable setting the log segment
size to an alternate value.

If the config option to set the journal log segment
size is specified, the log layout must be modified
both for the object size and the striping unit size.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
2678db532a qa/workunits/restart: Add test to check backtrace
This script uses the python bindings to libcephfs and rados
to create files and check the correctness of the backtrace
written to the 'parent' xattr on the first object (if its
a file) or inode (if its a dir).  The script includes test cases
that kill the mds at specific kill points and restart it through
teuthology using the teuthology restart task.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
85057e962b mds: Add kill points for backtrace testing
To test the mds journal and replay behavior, and the
functionality for storing backtraces on inodes, we
add kill points to the MDS in the openc, journal replay,
and journal expire paths.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
acae3d02b9 pybind/cephfs: Add initial py wrappers for cephfs.
Initial Support for python bindings to libcephfs for testing
MDS backtraces with a the python script test-backtraces.py.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
0c7447576a mds: Cleanup new segment conditionals
The second conditional for adding a new segment is always
true when the first conditional is true.  Clean this up
to simply create a new segment when we've reached the end of
the current segment.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
8b79886773 mds: Backtrace for create,rename,mkdir,setlayout
Design info:
http://www.spinics.net/lists/ceph-devel/msg11872.html

Adds a backtrace to the data pool for supporting lookup-by-ino,
storing the backtrace on the first object in the data pool
or the metadata pool for a directory, as the 'parent' xattr
on the object (named by inode) in that pool.  For create, rename,
mkdir, and setlayout operations, the backtrace is
queued (with the current log segment) after the journal is
committed and the safe reply is returned to the client, but the
the backtrace operation itself isn't started until the log segment is
expired.

For journal replay, we queue the backtrace so that it gets
written out on journal expire.  Inodes get added to the EMetaBlob
in the fullbits list, so we queue backtraces while iterating through
the fullbits during replay.

Using setlayout or setxattr('ceph.file.layout.pool'),
the data pool for a file can be changed after it is created
but before anything is written to the file.  A forwarding backtrace
is written to the old pool on a setlayout, to ensure we can always find
the latest backtrace.  We store a list of old pools with the backtrace
for cleaning up all forwarding pointers of an inode.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
4d0448f876 mds: New backtrace handling
Add unified backtrace handling for storing a backtrace on file objects
(the first data object) and dirs.  The backtrace store operation is
queued on the LogSegment (for performing the store on log segment
expire).  We encode the backtrace on queue to avoid keeping a reference
around to the CInode, which may get dropped from the cache by the time
the log segment is expired (and the backtrace is written out).
Fetching the backtrace is implemented on the CInode.

Also allow incrementing/decrementing the DIRTYPARENT pin ref as needed,
instead of using a state semaphore to keep track of whether itsset or
not.  This allows us to remove the STATE_DIRTYPARENT field on CInode.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
62d12d8ae9 message/mds: Fix client reconnect decode
Flip the conditional so that snap realms are
decoded, otherwise this results in an assertion
failure of the mds when a client attempts to
reconnect.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
fb07745c75 include/elist: Fix clear() to use pop_front()
elist<T>::clear() is calling remove(), which isn't a
method defined on elist<T> (it was never defined according
to git).  Because elist is templated and no references
to clear() are ever made, the compiler matches remove(T) to the
remove(const char *) system call defined in stdio.h.

Once clear is invoked on an instance of elist<T>, we get the
compile error shown below.

The fix here is to use pop_front() instead of remove().

Compile error is:
In file included from ../../src/mds/CInode.h:22:0,
                 from ../../src/mds/CInode.cc:19:
../../src/include/elist.h: In instantiation of ‘void elist<T>::clear() [with T = cinode_backtrace_info_t*]’:
../../src/mds/CInode.cc:1129:20:   required from here
../../src/include/elist.h:101:7: error: no matching function for call to ‘remove(cinode_backtrace_info_t*)’
../../src/include/elist.h:101:7: note: candidates are:
In file included from ../../src/mds/CInode.cc:17:0:
/usr/include/stdio.h:179:12: note: int remove(const char*)
/usr/include/stdio.h:179:12: note:   no known conversion for argument 1 from ‘cinode_backtrace_info_t*’ to ‘const char*’
In file included from /usr/include/c++/4.7/algorithm:63:0,
                 from /usr/include/c++/4.7/backward/hashtable.h:65,
                 from /usr/include/c++/4.7/ext/hash_map:65,
                 from ../../src/include/encoding.h:292,
                 from ../../src/common/entity_name.h:22,
                 from ../../src/common/config.h:26,
                 from ../../src/mds/CInode.h:20,
                 from ../../src/mds/CInode.cc:19:
/usr/include/c++/4.7/bits/stl_algo.h:1117:5: note: template<class _FIter, class _Tp> _FIter std::remove(_FIter, _FIter, const _Tp&)
/usr/include/c++/4.7/bits/stl_algo.h:1117:5: note:   template argument deduction/substitution failed:
In file included from ../../src/mds/CInode.h:22:0,
                 from ../../src/mds/CInode.cc:19:
../../src/include/elist.h:101:7: note:   candidate expects 3 arguments, 1 provided

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
b8fb2ee0f7 dencoder: Add inode_backtrace_t to types
To test the backtrace attributes on objects, we need
to be able to decode the backtrace using ceph-dencoder.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
9e1388626c mds: Use map for CInode pinrefs
Implements pin refs on the inode as a map instead of
a multiset, allowing individual ref counts to act as
real references with values that can be >1.
The pin refs are only used for debugging, but allowing
them to be >1 avoids the need for a separate state field
for things like DIRTYPARENT.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Sam Lang
fc80c1dc6e client: Ensure inode/dentries are ref counted
The MetaRequest holds onto inodes and dentries
for retrying unsafe requests, but those objects
might be removed from the cache (unlink for example)
causing the inode/dentry to be freed.  Ensure that
the inode/dentry is never freed while the MetaRequest
holds onto it by putting/getting the refs using
set/get interfaces.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-16 11:45:36 -05:00
Samuel Just
f8d66e87a5 OSD: split temp collection as well
Otherwise, when we eventually remove the temp collection, there might be
objects in the temp collection which were independently pulled into the child
pg collection.  Thus, removing the old stale parent link from its temp
collection also blasts the omap entries and snap mappings for the real child
object.

Backport: bobtail
Fixes: #4452
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-15 17:05:54 -07:00
Samuel Just
5b022e8b15 hobject: fix snprintf args for 32 bit
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-15 17:05:54 -07:00
Samuel Just
9ea02b8410 ceph_features: fix CEPH_FEATURE_OSD_SNAPMAPPER definition
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-15 17:05:54 -07:00
Gary Lowell
ee178fba49 ceph.spec.in: Additional clean-up on package removal
When removing the last instance of ceph, also remove the files
created by ceph during operation.  These consist of the files
under /var/lib/ceph, /etc/ceph, and /var/log/ceph. Bug #4415.

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-03-15 16:25:39 -07:00
Sage Weil
65c31e1b97 ceph-fuse: invalidate cache by default
Closes: #2215
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-15 13:35:37 -07:00
Samuel Just
9edc87a54f Merge branch 'wip_4196'
Reviewed-by: Sage Weil <sage@inktank.com>
Fixes: #4196
2013-03-15 11:21:44 -07:00
Samuel Just
39a66b8637 Merge branch 'next' 2013-03-15 11:21:35 -07:00
Samuel Just
f3ad12eab3 test_filejournal: add tests for footer, header, payload corruption
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:07 -07:00
Samuel Just
a22cdc67b0 FileJournal: add testing methods to corrupt entries
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:07 -07:00
Samuel Just
3b767fa63f FileJournal,Journal: detect some corrupt journal scenarios
When the checksum or footer are invalid, we will now try to
look at the next entry.  If we find a valid entry, it is likely
that the journal is corrupt.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:07 -07:00
Samuel Just
cf00930021 FileJournal::wrap_read_bl: convert arguments to explicit in/out arguments
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:07 -07:00
Samuel Just
c3725e92ec FileJournal: add committed_up_to to header
header_t::committed_up_to provides a lower bound for safetly committed
journal entries.  If read_entry fails prior to committed_up_to, we
know we have a corrupt jorunal entry.  Furthermore, if
journal_write_header_frequency is not 0, we will write out the
journal header once every journal_write_header_frequency
journal writes.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:07 -07:00
Samuel Just
4aa0f8a274 FileStore: add more debugging for remove and split
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-03-15 11:21:01 -07:00