Commit Graph

25363 Commits

Author SHA1 Message Date
Samuel Just
170d4a3d79 FileJournal: start_seq is seq+1 if journalq.empty()
This is also the same as journaled_seq + 1 for writeahead
journaling, but not for parallel journaling.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-04-10 12:48:02 -07:00
Samuel Just
90c256d757 FileJournal: fix off by one error in committed_thru
journalq.front().first is the sequence number of the entry
at journalq.front().second.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-04-10 12:48:02 -07:00
Samuel Just
a4fa0a8200 Journal: commits may not include all journaled seqs
At one point, a commit had to drain the FileStore op
queue.  This is no longer the case.  Consequently, the
journal may have to wait more than one commit for the
filestore to create a stable commit point at a particular
sequence.  Handling this requires two changes:

1) We cannot transition to FULL_WAIT until we receive
a commit_start on a seq >= journaled_seq.
2) We cannot remove the journal completion plug until get
a committed_thru on a seq >= header.start_seq at least as
new as the oldest committed item in the journal.  If on
replay, the journal does not include fs_op_seq, we ignore
it, which is fine since we won't have reported those
entries committed!

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-04-10 12:48:01 -07:00
Samuel Just
13474b089b Journal: pass the sequence number to commit_start
A subsequent patch will need to see the committing seq.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-04-10 12:47:23 -07:00
Samuel Just
a48739d9ab FileJournal: clarify meaning of start_seq and fix initialization
Second guessing the first sequence number from the FileStore
was silly and broke tests which had the temerity to start at
1 instead of 2...

Fixes: #4687
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-09 10:46:03 -07:00
Greg Farnum
88ab8413de Revert "global: call config observers on global_init (and start logging!)"
This reverts commit a309177466. This commit
includes calls that involve Mutexes, Lockers, and lockdep -- which isn't
yet set up, so things break horribly. A more subtle approach is required.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-04-08 18:20:53 -07:00
Dan Mick
be801f6c50 mon: Use _daemon version of argparse functions
Allow argparse functions to fail if no argument given by using
special versions that avoid the default CLI behavior of "cerr/exit"

Fixes: #4678
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-04-08 17:49:15 -07:00
Dan Mick
c76bbc2e6d ceph_argparse: add _daemon versions of argparse calls
mon needs to call argparse for a couple of -- options, and the
argparse_witharg routines were attempting to cerr/exit on missing
arguments.  This is appropriate for the CLI usage, but not the daemon
usage.  Add a 'cli' flag that can be set false for the daemon usage
(and cause the parsing routine to return false instead of exit).

The daemon's parsing code due for a rewrite soon.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-04-08 17:49:15 -07:00
Samuel Just
d7b7acefc8 Pipe: call discard_requeued_up_to under pipe_lock
Fixes: #4627
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-08 17:02:45 -07:00
Gregory Farnum
1a3890a59f Merge pull request #202 from ceph/wip-log-boot
Fixes #4676.

Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-08 15:53:30 -07:00
Gregory Farnum
9c2d017d52 Merge pull request #206 from ceph/wip-4660
mds: Keep LogSegment ref for openc backtrace

Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-08 11:18:53 -07:00
Sam Lang
3cdc61eca2 mds: Keep LogSegment ref for openc backtrace
The MDRequest is destroyed once the client reply is sent, but
we need the reference to the LogSegment for updating the backtrace, so
store a temporary ref to the LogSegment for later.

Fixes #4660.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-08 12:45:54 -05:00
Sage Weil
a309177466 global: call config observers on global_init (and start logging!)
Currently we don't start logging on daemon startup unless the log_file
parameter was adjusted by ceph.conf.  Instead, we should call all config
observers so that the logging subsystem is fully configured and we log
even prior to the daemonize and common_init_finish (when we call observers
again).  This fixes logging for the initial period before we daemonize.
For some of the daemons (osd, mon), this includes significant work.  It
also fixes the problem where users don't see the 'ceph version ...' banner
on daemon start.

Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-07 09:07:21 -07:00
Sage Weil
1e7ddd9e9f global: flush log before stopping/starting on daemonize
Ensure that we push log data out before we restart logging.  This may not
be strictly necessary, but it avoids a whole class of possible pitfalls.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-07 09:07:21 -07:00
Sage Weil
f5ba0fbbe7 mon: make 'osd crush move ...' idempotent
If we don't need to move the item, return success.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-06 13:54:43 -07:00
Sage Weil
628e9ae26d librbd: fix DiffIterateStress again
- fix seed
- the array indices are points in time; no need to subtract one from i!
- pick a random seed and print it to stdout

I ran this with several different seeds without failure, so I am confident
we are in good shape.  And if we ever get a future failure, we'll have the
seed to reproduce.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-06 09:37:52 -07:00
Sage Weil
79b71441f8 librbd: fix DiffIterateStress test
If we write to an interval that didn't previously exist and then discard
it so that it again doesn't exist, all during the same interval, then we
should not include it in the 'written' set (or exists set, obviously).

Similarly, when we got to look at a merged diff, we can ignore extents
that were written (and possibly zeroed) if they neither existed before nor
after.

Bump up the iteration count to get more confidence that this is actually
correct.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-05 22:28:38 -07:00
Yehuda Sadeh
b083dece36 rgw: translate object marker to raw format
Fixes: #4600
Object marker should be treated as an object, so that name is formatted
correctly when getting the raw oid.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-04-05 10:27:40 -07:00
caleb miles
be6961bd28 Allow creation of buckets starting with underscore in RGW
Signed-off-by caleb miles <caleb.miles@inktank.com>
2013-04-05 10:26:29 -07:00
Gary Lowell
debce05510 Merge pull request #198 from dalgaaf/wip-da-spec
Fix some install and rpm SPEC issues

Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
2013-04-05 09:46:27 -07:00
Sage Weil
1f2d5bba5b Merge remote-tracking branch 'gh/next' 2013-04-04 22:22:43 -07:00
Samuel Just
6ef9d87a02 FileJournal: introduce start_seq header entry
FileStore::header_t::start_seq now encodes the op seq which may be
written at FileStore::header_t::start.  This way, FileStore::open()
can pass a valid sequence number to read_entry for validation.
Otherwise, read_entry has no way of knowing whether a failure of a
read at header.start indicates that the journal was empty, or that
the entry is corrupt.  With start_seq, read_entry can assume
corruption if start_seq <= committed_up_to.

Fixes: #4527
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-04-04 12:48:44 -07:00
Samuel Just
f12a5ed546 FileJournal: fill in committed_up_to for old headers
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-04-04 12:48:36 -07:00
Danny Al-Gaaf
e5cecd7656 debian/ceph-test.install: add installed but not packaged files
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:38:11 +02:00
Danny Al-Gaaf
a3a658dc53 ceph.spec.in: add installed but not packaged files to ceph-test
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:30:40 +02:00
Danny Al-Gaaf
8cf3319f5d ceph.spec.in: remove some twice created directories
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:27:13 +02:00
Danny Al-Gaaf
6bc14889be ceph.spec.in: fix udev rules.d files handling
Move 50-rbd.rules into the ceph base package since the related
ceph-rbdnamer binary is part of this package. Use correct install
pattern.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:23:40 +02:00
Danny Al-Gaaf
4b90a958d1 ceph.spec.in: use macros for standard directories
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:21:31 +02:00
Danny Al-Gaaf
a8362f5c9a ceph.spec.in: reorder and fix ceph file list
Reorder file list of ceph package. Fix handling of placeholder
directories, make use of directories marcros like %{_localstatedir}
for /var.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 18:18:30 +02:00
Sage Weil
5b4cb53781 Merge pull request #176 from dachary/wip-4597
fix nspace assignment in LFNIndex::lfn_parse_object_name

Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-04-04 08:52:56 -07:00
Danny Al-Gaaf
6b80296422 debian/ceph.install: no need to move files to usr/sbin/
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 16:00:18 +02:00
Danny Al-Gaaf
61a2be3bb6 ceph.spec.in: don't move ceph-disk* and ceph-create-keys around
Don't move these files around, they get installed now directly to
%{_sbindir}.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 15:58:12 +02:00
Danny Al-Gaaf
4d16f38f48 Makefile.am: install ceph-* python scripts to /usr/bin directly
Install ceph-* scripts directly to $(prefix)$(sbindir) (which
normaly would be /usr/sbin) instead of moving it around after
installation in SPEC file or debian files.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 15:54:31 +02:00
Danny Al-Gaaf
354c41e71d ceph.spec.in: use %{_sbindir} instead of /usr/sbin
Use %{_sbindir} macro which points to /usr/sbin instead of
hard coded path.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-04 12:52:55 +02:00
Sage Weil
2f0e31f31e Merge pull request #196 from ceph/wip-mon-crush2
Wip mon crush2

Reviewed-by: Dan Mick <dan.mick@inktank.com>
2013-04-03 15:46:11 -07:00
Sage Weil
29f9db1980 mon: fix crush unit tests for idempotency
Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-03 15:45:34 -07:00
Gregory Farnum
32aac00c70 Merge pull request #197 from ceph/wip-3266
mds: verify mds tell 'dumpcache <filename>' target does not exist

Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-03 15:42:22 -07:00
Sage Weil
336c4ae7ad mds: verify mds tell 'dumpcache <filename>' target does not exist
Open target with O_CREAT|O_EXCL to ensure we don't overwrite some other
important file (like, say, /etc/passwd).  This is irritating because there
is not c++ ofstream equivalent for O_EXCL; kludge around it using
ostringstream instead.

Fixes: #3266
Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-03 15:32:51 -07:00
Sage Weil
e6d4582a68 mon: make 'osd crush unlink ..' idempotent
Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-03 15:04:00 -07:00
Gregory Farnum
3c0debf99d Merge pull request #191 from ceph/wip-4582b
Fixes #4582.

Reviewed-by: Greg Farnum <greg@inktank.com>
2013-04-03 14:32:48 -07:00
Greg Farnum
0d6ddd9264 mds: do not go through handle_mds_failure for oneself
A standby MDS can attempt the handle_mds_failure paths for itself, if
it sees the transition from up to down. This leads it to insert itself
into the resolve_gather set, which is bad. So check if the failed MDS
is the same as whoami, and abort if so. This fixes #4637.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
2013-04-03 12:43:49 -07:00
Josh Durgin
2d19ebda06 Merge pull request #194 from ceph/wip-rbd-diff
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-04-03 12:16:50 -07:00
Sage Weil
17a38593d6 Merge pull request #195 from dalgaaf/wip-da-fix-make
Makefile.am: fix build of ceph_test_cors

Reviewed-by: Sage Weil <sage@inktank.com>
2013-04-03 11:34:05 -07:00
Danny Al-Gaaf
c8cbec2b48 Makefile.am: fix build of ceph_test_cors
Fix build of ceph_test_cors: use $(CRYPTO_LIBS) instead of -lcryptopp.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-04-03 20:04:02 +02:00
João Eduardo Luís
e8562218b6 Merge pull request #192 from ceph/wip-mon-disk-warn
mon: limit warnings about low mon disk space

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-04-03 10:59:00 -07:00
Dan Mick
a4c6e2eecb Merge pull request #193 from ceph/wip-mon-crush
mon: make 'osd crush rm|unlink ...' idempotent

Reviewed-by: Dan Mick dan.mick@inktank.com
2013-04-03 10:56:43 -07:00
Sage Weil
e2edb9c646 Merge remote-tracking branch 'gh/wip-4623' 2013-04-03 10:26:30 -07:00
Sam Lang
0ce09fad55 client: Kick waiters for max size
If the mds restarts without successfully logging a max size
cap update, the client waits indefinitely in Client::get_caps
on the waitfor_caps list.  So when the client gets an mds map
indicating a new active mds has replaced a down mds, we need to
kick the caps update request.  This patch mimics the behavior
in the kernel by setting the wanted_max_size
and requested_max_size to 0 and wakes up the waiters.

Fixes #4582.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-03 11:36:39 -05:00
Sam Lang
f9b7dff70a client: log inode when waiting on max size
Logging the specific inode that the get_caps()
is waiting for helps during debugging of stuck waiters.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2013-04-03 11:31:52 -05:00
Sage Weil
85a77dfda6 mon: limit warnings about low mon disk space
Only warn once per percentage point per epoch.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-03 08:37:50 -07:00