]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agomds/CInode.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:25:29 +0000 (14:25 +0100)]
mds/CInode.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoclient/Client.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 13:24:27 +0000 (14:24 +0100)]
client/Client.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoauth/AuthMethodList.cc: fix remove_supported_auth()
Danny Al-Gaaf [Mon, 18 Mar 2013 13:08:22 +0000 (14:08 +0100)]
auth/AuthMethodList.cc: fix remove_supported_auth()

Make sure the iterator isn't incremented twice if a element gets erased.
Move increment out of the for-loop header and add it to a new else block.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/mdstypes.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Mon, 18 Mar 2013 12:03:30 +0000 (13:03 +0100)]
mds/mdstypes.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds: Add config option for log segment size
Sam Lang [Wed, 6 Mar 2013 17:40:49 +0000 (11:40 -0600)]
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>
12 years agoqa/workunits/restart: Add test to check backtrace
Sam Lang [Thu, 21 Feb 2013 13:39:12 +0000 (07:39 -0600)]
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>
12 years agomds: Add kill points for backtrace testing
Sam Lang [Thu, 21 Feb 2013 14:07:35 +0000 (08:07 -0600)]
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>
12 years agopybind/cephfs: Add initial py wrappers for cephfs.
Sam Lang [Thu, 21 Feb 2013 13:38:14 +0000 (07:38 -0600)]
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>
12 years agomds: Cleanup new segment conditionals
Sam Lang [Thu, 21 Feb 2013 13:35:14 +0000 (07:35 -0600)]
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>
12 years agomds: Backtrace for create,rename,mkdir,setlayout
Sam Lang [Tue, 5 Mar 2013 15:18:35 +0000 (09:18 -0600)]
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>
12 years agomds: New backtrace handling
Sam Lang [Tue, 5 Mar 2013 14:48:29 +0000 (08:48 -0600)]
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>
12 years agomessage/mds: Fix client reconnect decode
Sam Lang [Tue, 26 Feb 2013 14:48:40 +0000 (08:48 -0600)]
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>
12 years agoinclude/elist: Fix clear() to use pop_front()
Sam Lang [Tue, 26 Feb 2013 18:22:47 +0000 (12:22 -0600)]
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>
12 years agodencoder: Add inode_backtrace_t to types
Sam Lang [Tue, 19 Feb 2013 16:48:46 +0000 (10:48 -0600)]
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>
12 years agomds: Use map for CInode pinrefs
Sam Lang [Tue, 5 Mar 2013 14:28:47 +0000 (08:28 -0600)]
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>
12 years agoclient: Ensure inode/dentries are ref counted
Sam Lang [Tue, 26 Feb 2013 00:51:19 +0000 (18:51 -0600)]
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>
12 years agoOSD: split temp collection as well
Samuel Just [Fri, 15 Mar 2013 22:13:46 +0000 (15:13 -0700)]
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>
12 years agohobject: fix snprintf args for 32 bit
Samuel Just [Fri, 15 Mar 2013 21:59:39 +0000 (14:59 -0700)]
hobject: fix snprintf args for 32 bit

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoceph_features: fix CEPH_FEATURE_OSD_SNAPMAPPER definition
Samuel Just [Fri, 15 Mar 2013 19:49:42 +0000 (12:49 -0700)]
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>
12 years agoceph.spec.in: Additional clean-up on package removal
Gary Lowell [Fri, 15 Mar 2013 05:54:05 +0000 (22:54 -0700)]
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>
12 years agoceph-fuse: invalidate cache by default
Sage Weil [Fri, 15 Mar 2013 20:35:13 +0000 (13:35 -0700)]
ceph-fuse: invalidate cache by default

Closes: #2215
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip_4196'
Samuel Just [Fri, 15 Mar 2013 18:21:42 +0000 (11:21 -0700)]
Merge branch 'wip_4196'

Reviewed-by: Sage Weil <sage@inktank.com>
Fixes: #4196
12 years agoMerge branch 'next'
Samuel Just [Fri, 15 Mar 2013 18:21:35 +0000 (11:21 -0700)]
Merge branch 'next'

12 years agotest_filejournal: add tests for footer, header, payload corruption
Samuel Just [Tue, 12 Mar 2013 02:32:32 +0000 (19:32 -0700)]
test_filejournal: add tests for footer, header, payload corruption

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: add testing methods to corrupt entries
Samuel Just [Tue, 12 Mar 2013 02:32:15 +0000 (19:32 -0700)]
FileJournal: add testing methods to corrupt entries

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal,Journal: detect some corrupt journal scenarios
Samuel Just [Fri, 15 Mar 2013 17:59:38 +0000 (10:59 -0700)]
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>
12 years agoFileJournal::wrap_read_bl: convert arguments to explicit in/out arguments
Samuel Just [Mon, 11 Mar 2013 22:15:03 +0000 (15:15 -0700)]
FileJournal::wrap_read_bl: convert arguments to explicit in/out arguments

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: add committed_up_to to header
Samuel Just [Tue, 26 Feb 2013 01:31:12 +0000 (17:31 -0800)]
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>
12 years agoFileStore: add more debugging for remove and split
Samuel Just [Thu, 14 Mar 2013 23:01:57 +0000 (16:01 -0700)]
FileStore: add more debugging for remove and split

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: queue_pos \in [get_top(), header.max_size)
Samuel Just [Wed, 13 Mar 2013 23:04:23 +0000 (16:04 -0700)]
FileJournal: queue_pos \in [get_top(), header.max_size)

If queue_pos == header.max_size when we create the entry
header magic, the entry will be rejected at get_top() on
replay.

Fixes: #4436
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoOSD: expand_pg_num after pg removes
Samuel Just [Fri, 15 Mar 2013 01:52:02 +0000 (18:52 -0700)]
OSD: expand_pg_num after pg removes

Otherwise:
1) expand_pg_num removes a splitting pg entry
2) peering thread grabs pg lock and starts split
3) OSD::consume_map grabs pg lock and starts removal

At step 2), we run afoul of the assert(is_splitting)
check in split_pgs.  This way, the would be splitting
pg is marked as removed prior to the splitting state
being updated.

Backport: bobtail
Fixes: #4449
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPG: ignore non MISSING pg query in ReplicaActive
Samuel Just [Fri, 15 Mar 2013 02:59:36 +0000 (19:59 -0700)]
PG: ignore non MISSING pg query in ReplicaActive

1) Replica sends notify
2) Prior to processing notify, primary queues query to replica
3) Primary processes notify and activates sending MOSDPGLog
to replica.
4) Primary does do_notifies at end of process_peering_events
and sends to Query.
5) Replica sees MOSDPGLog and activates
6) Replica sees Query and asserts.

In the above case, the Replica should simply ignore the old
Query.

Fixes: #4050
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Fri, 15 Mar 2013 04:11:35 +0000 (21:11 -0700)]
Merge branch 'next'

Conflicts:
src/mon/AuthMonitor.cc

12 years agomon: only try to bump max if leader
Sage Weil [Fri, 15 Mar 2013 04:10:09 +0000 (21:10 -0700)]
mon: only try to bump max if leader

I broke this in 4637752db6f8520abba160b4817323379c4a7fe0 when I
restructured this function.  Only try to increase the max if we are
the leader.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-disk-activate: identify cluster .conf by fsid
Sage Weil [Fri, 15 Mar 2013 04:05:07 +0000 (21:05 -0700)]
ceph-disk-activate: identify cluster .conf by fsid

Determine what cluster the disk belongs to by checking the fsid defined
in /etc/ceph/*.conf.  Previously we hard-coded 'ceph'.

Note that this has the nice side-effect that if we have a disk with a
bad/different fsid, we now fail to activate it.  Previously, we would
mount and start ceph-osd, but the daemon would fail to authenticate
because it was part of the wrong cluster.

Fixes: #3253
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodebian/control: Fix for moved file
Gary Lowell [Tue, 12 Mar 2013 23:59:42 +0000 (16:59 -0700)]
debian/control:  Fix for moved file

The ceph-mds.conf file moced from the ceph package to the
ceph-mds package.  Add replaces/breaks statements to the
control file to handle this on upgrade.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoceph-disk-activate: abort if target position is already mounted
Sage Weil [Thu, 14 Mar 2013 23:18:26 +0000 (16:18 -0700)]
ceph-disk-activate: abort if target position is already mounted

If the target position is already a mount point, fail to move our mount
over to it.  This usually indicates that a different osd.N from a
different cluster instances is in that position.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorados/test.sh fails in the nightly run
David Zafman [Thu, 14 Mar 2013 20:40:54 +0000 (13:40 -0700)]
rados/test.sh fails in the nightly run

Make test more robust by using my_snaps vector for snap IDs

Signed-off-by: David Zafman <david.zafman@inktank.com>
12 years agoMerge remote-tracking branch 'origin/wip-osd-addr-api'
Noah Watkins [Thu, 14 Mar 2013 20:27:27 +0000 (13:27 -0700)]
Merge remote-tracking branch 'origin/wip-osd-addr-api'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodebian: add start ceph-mds-all on ceph-mds install
Sage Weil [Thu, 14 Mar 2013 19:33:08 +0000 (12:33 -0700)]
debian: add start ceph-mds-all on ceph-mds install

This ensures that when we then start individual mds instances, we can
stop ceph-mds-all and they will get stopped.  We do the same already for
ceph-all.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 41897fcba168b409fd370d0b26016fe4d30c5a59)

12 years agodebian: add start ceph-mds-all on ceph-mds install
Sage Weil [Thu, 14 Mar 2013 19:33:08 +0000 (12:33 -0700)]
debian: add start ceph-mds-all on ceph-mds install

This ensures that when we then start individual mds instances, we can
stop ceph-mds-all and they will get stopped.  We do the same already for
ceph-all.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibcephfs: add ceph_get_osd_addr interface
Noah Watkins [Thu, 14 Mar 2013 19:15:41 +0000 (12:15 -0700)]
libcephfs: add ceph_get_osd_addr interface

Return the network address for an OSD by ID.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoRevert "ceph-disk-activate: rely on default/configured keyring path"
Sage Weil [Thu, 14 Mar 2013 19:05:52 +0000 (12:05 -0700)]
Revert "ceph-disk-activate: rely on default/configured keyring path"

This reverts commit 936b8f20af1d390976097c427b6e92da4b39b218.

This is necessary because we mount the osd in a temporary location.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoRevert "ceph-disk-activate: don't override default or configured osd journal path"
Sage Weil [Thu, 14 Mar 2013 19:04:44 +0000 (12:04 -0700)]
Revert "ceph-disk-activate: don't override default or configured osd journal path"

This reverts commit 813e9fe2b4291a1c1922ef78f031daa9b78fe53b.

We run --mkfs with the osd disk mounted in a temporary location, so it is
necessary to explicitly pass in these paths.

If we want to support journals in a different location, we need to make
ceph-disk-prepare update the journal symlink accordingly.. not control it via
the config option.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #109 from dalgaaf/wip-da-performance-1-v2
Sage Weil [Thu, 14 Mar 2013 18:41:04 +0000 (11:41 -0700)]
Merge pull request #109 from dalgaaf/wip-da-performance-1-v2

prefer prefix ++/--operator for e.g. iterators for performance reasons

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #108 from ceph/wip-refuse-last-mon-remove
Sage Weil [Thu, 14 Mar 2013 18:38:21 +0000 (11:38 -0700)]
Merge pull request #108 from ceph/wip-refuse-last-mon-remove

mon: refuse "mon remove" if only one mon left

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomonmaptool.cc: prefer prefix ++operator for iterators 109/head
Danny Al-Gaaf [Thu, 14 Mar 2013 17:13:55 +0000 (18:13 +0100)]
monmaptool.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/PGMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:13:31 +0000 (18:13 +0100)]
mon/PGMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/MonmapMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:13:00 +0000 (18:13 +0100)]
mon/MonmapMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/Monitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:12:36 +0000 (18:12 +0100)]
mon/Monitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/MonMap.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:12:16 +0000 (18:12 +0100)]
mon/MonMap.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/MDSMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:11:53 +0000 (18:11 +0100)]
mon/MDSMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/LogMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:11:02 +0000 (18:11 +0100)]
mon/LogMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/AuthMonitor.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:10:08 +0000 (18:10 +0100)]
mon/AuthMonitor.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/mdstypes.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:09:48 +0000 (18:09 +0100)]
mds/mdstypes.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/SnapServer.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 17:09:22 +0000 (18:09 +0100)]
mds/SnapServer.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/SnapServer.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:45:09 +0000 (17:45 +0100)]
mds/SnapServer.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/SnapServer.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:44:41 +0000 (17:44 +0100)]
mds/SnapServer.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Mutation.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:44:20 +0000 (17:44 +0100)]
mds/Mutation.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDSTableServer.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:43:58 +0000 (17:43 +0100)]
mds/MDSTableServer.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDSTableClient.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:43:36 +0000 (17:43 +0100)]
mds/MDSTableClient.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDSMap.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:43:12 +0000 (17:43 +0100)]
mds/MDSMap.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDS.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:42:53 +0000 (17:42 +0100)]
mds/MDS.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDLog.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:42:32 +0000 (17:42 +0100)]
mds/MDLog.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDCache.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:41:08 +0000 (17:41 +0100)]
mds/MDCache.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDBalancer.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 16:40:14 +0000 (17:40 +0100)]
mds/MDBalancer.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/Locker.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 14:19:35 +0000 (15:19 +0100)]
mds/Locker.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/MDCache.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 14:08:03 +0000 (15:08 +0100)]
mds/MDCache.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CInode.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 14:07:39 +0000 (15:07 +0100)]
mds/CInode.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/CDir.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 18:21:45 +0000 (19:21 +0100)]
mds/CDir.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/AnchorServer.h: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 14:02:20 +0000 (15:02 +0100)]
mds/AnchorServer.h: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/AnchorServer.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 14:01:03 +0000 (15:01 +0100)]
mds/AnchorServer.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomds/AnchorClient.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:59:44 +0000 (14:59 +0100)]
mds/AnchorClient.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrbd/internal.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:31:04 +0000 (14:31 +0100)]
librbd/internal.cc: prefer prefix ++operator for iterators

Prefer prefix ++operator for iterators, move iterator declaration into
the related for loop.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrbd/ImageCtx.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:26:41 +0000 (14:26 +0100)]
librbd/ImageCtx.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrados/RadosClient.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:24:49 +0000 (14:24 +0100)]
librados/RadosClient.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibrados/IoCtxImpl.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:23:37 +0000 (14:23 +0100)]
librados/IoCtxImpl.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agolibcephfs.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:21:35 +0000 (14:21 +0100)]
libcephfs.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agokv_flat_btree_async.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:20:04 +0000 (14:20 +0100)]
kv_flat_btree_async.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agokey_value_store/cls_kvs.cc: prefer prefix --operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:12:36 +0000 (14:12 +0100)]
key_value_store/cls_kvs.cc: prefer prefix --operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocrush/CrushWrapper.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:08:22 +0000 (14:08 +0100)]
crush/CrushWrapper.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocrush/CrushCompiler.cc: prefer prefix --operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:04:46 +0000 (14:04 +0100)]
crush/CrushCompiler.cc: prefer prefix --operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocommon/lockdep.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 13:02:56 +0000 (14:02 +0100)]
common/lockdep.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoclient/SyntheticClient.cc: prefer prefix ++operator for iterators
Danny Al-Gaaf [Thu, 14 Mar 2013 12:57:00 +0000 (13:57 +0100)]
client/SyntheticClient.cc: prefer prefix ++operator for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon: refuse "mon remove" if only one mon left 108/head
Dan Mick [Thu, 14 Mar 2013 18:02:12 +0000 (11:02 -0700)]
mon: refuse "mon remove" if only one mon left

Fixes: #4439
Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoosd: data loss: low space handling
David Zafman [Wed, 13 Mar 2013 03:49:25 +0000 (20:49 -0700)]
osd: data loss: low space handling

Add check whether to allow writing ops based on failsafe full percentage
Check for failsafe nearfull warning or full error message every heartbeat
Use clock to limit messages to every 30 secs (osd_op_complaint_time)

Feature: #4197

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoceph_common.sh: Fix sed regex in get_local_daemon_list
Gary Lowell [Thu, 14 Mar 2013 06:39:34 +0000 (23:39 -0700)]
ceph_common.sh:  Fix sed regex in get_local_daemon_list

In get_local_daemon_list() the sed expression trimming the cluster
name from the host name was trimming too much if the host name
contained hyphens.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoSimplify may_write()
David Zafman [Tue, 12 Mar 2013 23:47:36 +0000 (16:47 -0700)]
Simplify may_write()

CEPH_MDS_OP_CREATE has CEPH_MDS_OP_WRITE bit set so already checked

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge branch 'wip_omap_snaps'
Samuel Just [Thu, 14 Mar 2013 02:59:39 +0000 (19:59 -0700)]
Merge branch 'wip_omap_snaps'

Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoOSD: remove snap_mapper entries in RemoveWQ
Samuel Just [Wed, 6 Mar 2013 22:55:28 +0000 (14:55 -0800)]
OSD: remove snap_mapper entries in RemoveWQ

This is a somewhat ugly hack for now until we implement
pg resurrection.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: check and repair snap_mapper entries during scrub
Samuel Just [Mon, 4 Mar 2013 20:37:46 +0000 (12:37 -0800)]
PG: check and repair snap_mapper entries during scrub

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD,PG: add upgrade procedure for snap_mapper
Samuel Just [Mon, 4 Mar 2013 19:16:05 +0000 (11:16 -0800)]
OSD,PG: add upgrade procedure for snap_mapper

Also, sub_op_modify transactions currently carry the operations
for creating snap links in the shipped transaction.  To handle
ops shipped by unenlightened osds, transactions can now be
tagged with a tolerate_collection_add_enoent flag.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd/: Integrate SnapMapper with OSD
Samuel Just [Tue, 5 Mar 2013 22:34:47 +0000 (14:34 -0800)]
osd/: Integrate SnapMapper with OSD

- SnapTrimmer now uses SnapMapper to get the next object to trim
- Entries for a snap are implicitely removed from SnapMapper when
the last object is trimmed, so no need for the adjust_local_snaps
logic.
- Scrub now compares the object_info snaps set on the object attr
with the version stored in the SnapMapper.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMakefile: add SnapMapper to osd
Samuel Just [Wed, 27 Feb 2013 23:17:47 +0000 (15:17 -0800)]
Makefile: add SnapMapper to osd

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agotest/: add tests for map_cacher
Samuel Just [Wed, 27 Feb 2013 22:38:33 +0000 (14:38 -0800)]
test/: add tests for map_cacher

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd/: add SnapMapper
Samuel Just [Tue, 12 Mar 2013 23:28:19 +0000 (16:28 -0700)]
osd/: add SnapMapper

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agocommon/: add map_cacher
Samuel Just [Wed, 27 Feb 2013 22:37:33 +0000 (14:37 -0800)]
common/: add map_cacher

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agocommon/shared_ptr.hpp: add get_next and expose VPtr and WeakVPtr types
Samuel Just [Wed, 27 Feb 2013 21:41:23 +0000 (13:41 -0800)]
common/shared_ptr.hpp: add get_next and expose VPtr and WeakVPtr types

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agofilestore: add debug option to verify split results
Samuel Just [Sat, 9 Mar 2013 06:14:37 +0000 (22:14 -0800)]
filestore: add debug option to verify split results

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoDBObjectMap, hobject: add helpers for pgid bit matching
Samuel Just [Sat, 2 Mar 2013 00:04:04 +0000 (16:04 -0800)]
DBObjectMap, hobject: add helpers for pgid bit matching

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>