]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
13 years agotest/encoding/readable.sh: check all version
Sage Weil [Thu, 2 Feb 2012 21:56:55 +0000 (13:56 -0800)]
test/encoding/readable.sh: check all version

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoencoding: document ENCODE_DUMP throttling weirdness
Sage Weil [Thu, 2 Feb 2012 21:48:26 +0000 (13:48 -0800)]
encoding: document ENCODE_DUMP throttling weirdness

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoencoding: fix DECODE_START macro
Sage Weil [Thu, 2 Feb 2012 21:37:34 +0000 (13:37 -0800)]
encoding: fix DECODE_START macro

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoencoding: add DECODE_OLDEST macro
Sage Weil [Thu, 2 Feb 2012 21:36:45 +0000 (13:36 -0800)]
encoding: add DECODE_OLDEST macro

So we can (gracefully) fail to decode very old encoded versions we no
longer support.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agocheck-generated.sh: do self-decode test first
Sage Weil [Thu, 2 Feb 2012 20:50:04 +0000 (12:50 -0800)]
check-generated.sh: do self-decode test first

This way we get a helpful error instead of silent failure on later.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agocheck-generated.sh: nicer output
Sage Weil [Thu, 2 Feb 2012 20:47:58 +0000 (12:47 -0800)]
check-generated.sh: nicer output

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: print errors to stderr
Sage Weil [Thu, 2 Feb 2012 20:39:35 +0000 (12:39 -0800)]
ceph-dencoder: print errors to stderr

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoencoding: better DECODE_START_LEGACY_COMPAT_LEN
Sage Weil [Thu, 2 Feb 2012 01:11:29 +0000 (17:11 -0800)]
encoding: better DECODE_START_LEGACY_COMPAT_LEN

- let you specify whether to decode compat and/or len
- put the argument order in the macro name so you know when you get it
  wrong

This is useful for FileJournal::header_t.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agobuffer: iterator::get_remaining()
Sage Weil [Thu, 26 Jan 2012 00:00:08 +0000 (16:00 -0800)]
buffer: iterator::get_remaining()

It's helpful to know how much data is remaining.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge branch 'master' into wip-encoding
Sage Weil [Thu, 2 Feb 2012 18:41:00 +0000 (10:41 -0800)]
Merge branch 'master' into wip-encoding

Conflicts:
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

13 years agofilestore: remove obsolete fs type check
Sage Weil [Thu, 2 Feb 2012 18:03:28 +0000 (10:03 -0800)]
filestore: remove obsolete fs type check

This isn't a useful check.  xfs and ext4 work too.

Fixes: #1995
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agotest_filejournal: fix warnings
Sage Weil [Thu, 2 Feb 2012 17:01:15 +0000 (09:01 -0800)]
test_filejournal: fix warnings

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agodo_autogen.sh: -e <path> to dump encoded objects to a path
Sage Weil [Thu, 2 Feb 2012 00:34:00 +0000 (16:34 -0800)]
do_autogen.sh: -e <path> to dump encoded objects to a path

Make it easy to build with encode dumping enabled.  This is just a
convenient way to generate a large corpus of encoded objects.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agocheck-generated.sh: run on 'make check'
Sage Weil [Thu, 2 Feb 2012 00:13:19 +0000 (16:13 -0800)]
check-generated.sh: run on 'make check'

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: pg_stat_t: fix member initialization
Sage Weil [Wed, 1 Feb 2012 23:54:09 +0000 (15:54 -0800)]
osd: pg_stat_t: fix member initialization

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: fix PG::Interval member initialization
Sage Weil [Wed, 1 Feb 2012 23:51:57 +0000 (15:51 -0800)]
osd: fix PG::Interval member initialization

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: finalize crush after building simple map
Sage Weil [Wed, 1 Feb 2012 23:49:55 +0000 (15:49 -0800)]
osdmap: finalize crush after building simple map

This ensures that max_devices gets calculated (and thus encoded) properly.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: make test instnaces deterministic
Sage Weil [Wed, 1 Feb 2012 23:49:31 +0000 (15:49 -0800)]
osdmap: make test instnaces deterministic

current time can vary

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoimport-generated.sh: fix to use ceph-dencoder syntax
Sage Weil [Wed, 1 Feb 2012 23:41:34 +0000 (15:41 -0800)]
import-generated.sh: fix to use ceph-dencoder syntax

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: fix ctor
Sage Weil [Wed, 1 Feb 2012 23:41:12 +0000 (15:41 -0800)]
ceph-dencoder: fix ctor

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph_context: initialize member var
Sage Weil [Wed, 1 Feb 2012 23:31:52 +0000 (15:31 -0800)]
ceph_context: initialize member var

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PGLSResponse -> pg_ls_response_t
Sage Weil [Wed, 1 Feb 2012 22:53:16 +0000 (14:53 -0800)]
osd: PGLSResponse -> pg_ls_response_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Missing -> pg_missing_t
Sage Weil [Wed, 1 Feb 2012 22:45:05 +0000 (14:45 -0800)]
osd: PG::Missing -> pg_missing_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Log -> pg_log_t
Sage Weil [Wed, 1 Feb 2012 22:28:04 +0000 (14:28 -0800)]
osd: PG::Log -> pg_log_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Log::Entry -> pg_log_entry_t
Sage Weil [Wed, 1 Feb 2012 22:16:11 +0000 (14:16 -0800)]
osd: PG::Log::Entry -> pg_log_entry_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Query -> pg_query_t
Sage Weil [Wed, 1 Feb 2012 21:03:08 +0000 (13:03 -0800)]
osd: PG::Query -> pg_query_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agocls_rgw: update bucket index when deleting object (with pending)
Yehuda Sadeh [Wed, 1 Feb 2012 20:55:52 +0000 (12:55 -0800)]
cls_rgw: update bucket index when deleting object (with pending)

Bug #2012. Racing delete with other operations (update or another
delete) failed to update the bucket index.

Signed-off-by: Yehuda Sadeh <yehuda.sadeh@dreamhost.com>
13 years agoosd: PG::Info -> pg_info_t
Sage Weil [Wed, 1 Feb 2012 20:53:24 +0000 (12:53 -0800)]
osd: PG::Info -> pg_info_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Info::History -> pg_history_t
Sage Weil [Wed, 1 Feb 2012 20:43:17 +0000 (12:43 -0800)]
osd: PG::Info::History -> pg_history_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: PG::Info[::History] dump, test instances
Sage Weil [Wed, 1 Feb 2012 19:52:08 +0000 (11:52 -0800)]
osd: PG::Info[::History] dump, test instances

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: remove message type dups
Sage Weil [Wed, 1 Feb 2012 19:26:47 +0000 (11:26 -0800)]
ceph-dencoder: remove message type dups

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: generate test instances on heap
Sage Weil [Wed, 1 Feb 2012 19:25:30 +0000 (11:25 -0800)]
ceph-dencoder: generate test instances on heap

Some objects aren't copyable (OSDMap contains CrushWrapper), but we'd
still like to programmatically generate test instances.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge remote branch 'gh/wip-divergent-backfill'
Sage Weil [Wed, 1 Feb 2012 18:55:45 +0000 (10:55 -0800)]
Merge remote branch 'gh/wip-divergent-backfill'

Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoosd: dump, test instances for PG::Interval
Sage Weil [Wed, 1 Feb 2012 18:49:21 +0000 (10:49 -0800)]
osd: dump, test instances for PG::Interval

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: dump, instances for PG::OndiskLog
Sage Weil [Wed, 1 Feb 2012 18:46:10 +0000 (10:46 -0800)]
osd: dump, instances for PG::OndiskLog

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: use g_ceph_context
Sage Weil [Wed, 1 Feb 2012 18:41:53 +0000 (10:41 -0800)]
ceph-dencoder: use g_ceph_context

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: OSDMap and osd_info_t
Sage Weil [Wed, 1 Feb 2012 18:41:39 +0000 (10:41 -0800)]
ceph-dencoder: OSDMap and osd_info_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: test instances for osd_info_t
Sage Weil [Wed, 1 Feb 2012 18:41:24 +0000 (10:41 -0800)]
osdmap: test instances for osd_info_t

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: test instances
Sage Weil [Wed, 1 Feb 2012 18:40:08 +0000 (10:40 -0800)]
osdmap: test instances

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: normalist encode/decode
Sage Weil [Wed, 1 Feb 2012 18:34:26 +0000 (10:34 -0800)]
osdmap: normalist encode/decode

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-dencoder: add all message types
Sage Weil [Wed, 1 Feb 2012 06:48:30 +0000 (22:48 -0800)]
ceph-dencoder: add all message types

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: add missing #includes for messages
Sage Weil [Wed, 1 Feb 2012 06:48:14 +0000 (22:48 -0800)]
msg: add missing #includes for messages

And remove that unused max() macro.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: dump messages via build option
Sage Weil [Wed, 1 Feb 2012 06:39:43 +0000 (22:39 -0800)]
msg: dump messages via build option

Dump encoded messages to ENCODE_DUMP when it is defined, just as we do with
the regular encode function.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: fix assignment in PG::rewind_divergent_log()
Sage Weil [Wed, 1 Feb 2012 04:06:27 +0000 (20:06 -0800)]
osd: fix assignment in PG::rewind_divergent_log()

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge remote-tracking branch 'gh/wip-journal-crc'
Sage Weil [Wed, 1 Feb 2012 00:18:52 +0000 (16:18 -0800)]
Merge remote-tracking branch 'gh/wip-journal-crc'

Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoqa: test_backfill.sh: take osd.0 down
Sage Weil [Tue, 31 Jan 2012 21:00:45 +0000 (13:00 -0800)]
qa: test_backfill.sh: take osd.0 down

Mark this down to
1- trigger the WaitActingChange vs osd down race, and
2- help trigger a divergnet log when osd.2 is blackholed+restarted during
   backfill.  e.g.,

./ceph -- tell osd.1 injectargs '--filestore-blackhole' ; sleep 10 ; ./init-ceph restart osd.1

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: restart peering if requesting acting osd goes down
Sage Weil [Tue, 31 Jan 2012 17:53:32 +0000 (09:53 -0800)]
osd: restart peering if requesting acting osd goes down

If we request an acting set, we need to restart peering if one of the
requested nodes goes down.  This prevents a deadlock where we get stuck
in WaitActingChange because we have [a,b], want [a,b,c], but c is down and
our up and acting don't actually change.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: rename recovery event NeedNewMap -> NeedActingChange
Sage Weil [Tue, 31 Jan 2012 17:40:23 +0000 (09:40 -0800)]
osd: rename recovery event NeedNewMap -> NeedActingChange

This is more precise.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: use RecoveryContext transaction, finishers on recovery completion
Sage Weil [Tue, 31 Jan 2012 15:23:10 +0000 (07:23 -0800)]
osd: use RecoveryContext transaction, finishers on recovery completion

We should use the enclosing transaction and finisher list here.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoqa: test_backfill.sh: limit pg log length so we trigger backfill
Sage Weil [Tue, 31 Jan 2012 15:16:37 +0000 (07:16 -0800)]
qa: test_backfill.sh: limit pg log length so we trigger backfill

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: fix divergent backfill targets
Sage Weil [Tue, 31 Jan 2012 15:25:04 +0000 (07:25 -0800)]
osd: fix divergent backfill targets

During peering, a previous backfill target may have a slightly newer
last_update than the other options, but it will not be chosen because it
is incomplete.  That caused a failed assert during activate() (#1983).

To fix, we remove the bad assert, and then fix merge_log() so that the
replica/backfill target will trim its divergent entries when it gets the
activation MLogRec.  We also fix the handling of MInfoRec, as that can
trigger the same analogous condition.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilestore: implement filestore_blackhole hook
Sage Weil [Tue, 31 Jan 2012 01:39:23 +0000 (17:39 -0800)]
filestore: implement filestore_blackhole hook

If true, we'll drop any new transactions on the floor. Useful for
triggering failure conditions (e.g., prior to killing ceph-osd itself, to
ensure some operations don't reach the local disk).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agorgw: should remove bucket dir instead of sending intent
Yehuda Sadeh [Tue, 31 Jan 2012 01:00:37 +0000 (17:00 -0800)]
rgw: should remove bucket dir instead of sending intent

that was really useless, and also bucket cleanup was broken anyway.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
13 years agolibrados: fix a leak
Yehuda Sadeh [Tue, 31 Jan 2012 00:48:15 +0000 (16:48 -0800)]
librados: fix a leak

watch notification message was missing a ->put()

Signed-off-by: Yehuda Sadeh <yehuda.sadeh@dreamhost.com>
13 years agoosd: disable clone overlap for push/pull
Sage Weil [Mon, 30 Jan 2012 22:27:24 +0000 (14:27 -0800)]
osd: disable clone overlap for push/pull

There is a bug in the push/pull code.  Disable the recovery smarts by
default until we fix #2002.

There is currently a race (in the callers) where:
 - an adjacent clone is missing
 - we (calculate some clone overlap? and) start pulling
 - we get adjacent clone
 - we get push, calc a different overlap, and then get confused.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoMerge remote branch 'gh/wip-warnings'
Sage Weil [Mon, 30 Jan 2012 21:42:45 +0000 (13:42 -0800)]
Merge remote branch 'gh/wip-warnings'

13 years agomon: make 'osd [out|in|down]' succeed if already whatever
Sage Weil [Mon, 30 Jan 2012 05:46:53 +0000 (21:46 -0800)]
mon: make 'osd [out|in|down]' succeed if already whatever

If we want something out and it is already out, succeed.  This makes the
client command succeed if there is a transient error and it gets resent.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoceph-dencoder: handle messages
Sage Weil [Mon, 30 Jan 2012 21:29:37 +0000 (13:29 -0800)]
ceph-dencoder: handle messages

Dump for now uses the string rendering function, and that's it.  Maybe
we'll write proper dump methods for all of these messages someday.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: implement Message::dump()
Sage Weil [Mon, 30 Jan 2012 21:29:54 +0000 (13:29 -0800)]
msg: implement Message::dump()

Just wrap print() for now.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: go const-crazy on messages
Sage Weil [Mon, 30 Jan 2012 21:28:44 +0000 (13:28 -0800)]
msg: go const-crazy on messages

- get_type_name()
- print()
and all the random crap they call.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agopaxos: explicitly pass in send timestamp
Sage Weil [Mon, 30 Jan 2012 20:32:00 +0000 (12:32 -0800)]
paxos: explicitly pass in send timestamp

This is cleaner.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: no cct for decode_payload
Sage Weil [Mon, 30 Jan 2012 20:28:45 +0000 (12:28 -0800)]
msg: no cct for decode_payload

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: use absolute times for message encoding
Sage Weil [Mon, 30 Jan 2012 20:28:34 +0000 (12:28 -0800)]
msg: use absolute times for message encoding

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: make decode cct optional
Sage Weil [Mon, 30 Jan 2012 20:22:58 +0000 (12:22 -0800)]
msg: make decode cct optional

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: no cct needed for message encoding
Sage Weil [Mon, 30 Jan 2012 20:03:12 +0000 (12:03 -0800)]
msg: no cct needed for message encoding

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomdsmap: move member initialization to monitor create_initial()
Sage Weil [Mon, 30 Jan 2012 19:07:12 +0000 (11:07 -0800)]
mdsmap: move member initialization to monitor create_initial()

The dependence on cct/conf here was totally wrong.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: use explicit feature argument instead of Connection*
Sage Weil [Mon, 30 Jan 2012 18:33:54 +0000 (10:33 -0800)]
msg: use explicit feature argument instead of Connection*

Use the new argument.  Don't rely on Connection *connection being defined.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomsg: pass features explicitly into message encoders
Sage Weil [Mon, 30 Jan 2012 17:31:18 +0000 (09:31 -0800)]
msg: pass features explicitly into message encoders

Avoid using the connection reference; pass it in explicitly instead.  This
will make ceph-dencoder's life a bit easier.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge remote branch 'gh/master' into wip-encoding
Sage Weil [Mon, 30 Jan 2012 17:23:11 +0000 (09:23 -0800)]
Merge remote branch 'gh/master' into wip-encoding

13 years agoqa: encoding: silence warning
Sage Weil [Mon, 30 Jan 2012 05:05:08 +0000 (21:05 -0800)]
qa: encoding: silence warning

This is cheating, but we always use this class with int types, so it makes
this go away:

warning: test/encoding.cc:79:20: ‘*((void*)(& tu)+4).ConstructorCounter::data’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoqa: test/gather fix warning
Sage Weil [Mon, 30 Jan 2012 04:56:03 +0000 (20:56 -0800)]
qa: test/gather fix warning

warning: test/gather.cc:29:222: passing NULL to non-pointer argument 3 of ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, T2*) [with T1 = long int, T2 = C_Gather]’ [-Wconversion-null]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoqa: test/rados-api/list fix warning
Sage Weil [Mon, 30 Jan 2012 04:54:18 +0000 (20:54 -0800)]
qa: test/rados-api/list fix warning

warning: test/rados-api/list.cc:43:156: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agotest_ipaddr: reverse ASSERT_EQ order
Sage Weil [Mon, 30 Jan 2012 04:36:46 +0000 (20:36 -0800)]
test_ipaddr: reverse ASSERT_EQ order

Make these warnings go away:

warning: test/test_ipaddr.cc:217:156: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosd: remove unused var
Sage Weil [Mon, 30 Jan 2012 01:26:55 +0000 (17:26 -0800)]
osd: remove unused var

warning: osd/PG.cc:1331:20: variable 'plu' set but not used [-Wunused-but-set-variable]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoadmin_socket: fix uninit warning
Sage Weil [Mon, 30 Jan 2012 01:26:14 +0000 (17:26 -0800)]
admin_socket: fix uninit warning

warning: common/admin_socket_client.cc:166:19: 'socket_fd' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomon: trim old auth states
Sage Weil [Sun, 29 Jan 2012 17:26:28 +0000 (09:26 -0800)]
mon: trim old auth states

These aren't exposed outside the monitor, so we really only keep them
around to assist in mon recovery.  Give ourselves a healthy margin over
the max join drift for that.

Fixes: #2000
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilestore: fix rollback when current/ missing entirely
Sage Weil [Sun, 29 Jan 2012 16:48:22 +0000 (08:48 -0800)]
filestore: fix rollback when current/ missing entirely

This can happen when we are starting, rolling back, remove current/, and
then fail before we snapshot a snap_ into place.

Most of the logic was already in place for this; we tried to fix it in
cd2dedd7d190a43a6be50a7f18849fe0123c72bc but missed this piece.

Fixes: #1999
Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: reset pgstats timer when we reopen monitor session
Sage Weil [Sat, 28 Jan 2012 01:32:28 +0000 (17:32 -0800)]
osd: reset pgstats timer when we reopen monitor session

Otherwise we'll reopen every second from here on out, without giving the
new session a chance to start up and do it's thing.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoclock: ignore clock_offset if cct is NULL
Sage Weil [Sat, 28 Jan 2012 19:40:08 +0000 (11:40 -0800)]
clock: ignore clock_offset if cct is NULL

This is helpful e.g. from assert.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agofilejournal: add corruption test to check crc checking code
Sage Weil [Thu, 26 Jan 2012 01:35:49 +0000 (17:35 -0800)]
filejournal: add corruption test to check crc checking code

Verify that the journal replay rejects a corrupted journal entry.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: assume gibberish flags imply none
Sage Weil [Thu, 26 Jan 2012 00:37:34 +0000 (16:37 -0800)]
filejournal: assume gibberish flags imply none

Old journals didn't properly initialize the flags (oops).  Assume that
any bits besides the first 2 imply no flags.

Make note that this hack needs to be removed after some time has passed,
but well before these new flags are used.  Or, such use should be
accompanied by a full header format rev and incompatibility.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: include crc in entry header/footer
Sage Weil [Thu, 26 Jan 2012 00:36:17 +0000 (16:36 -0800)]
filejournal: include crc in entry header/footer

Use the unused flags field for this.  Previously it was always 0, so this
lets us skip old entries on old journals and only worry about missing one
out of 2^32 corruptions.  New journals get a flag that strictly enforces
the crc check.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoqa: test_filejournal: test lots of small writes too
Sage Weil [Mon, 23 Jan 2012 20:03:32 +0000 (12:03 -0800)]
qa: test_filejournal: test lots of small writes too

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoqa: add test_filejournal
Sage Weil [Sat, 28 Jan 2012 19:08:52 +0000 (11:08 -0800)]
qa: add test_filejournal

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: fix header initialization
Sage Weil [Thu, 26 Jan 2012 00:12:42 +0000 (16:12 -0800)]
filejournal: fix header initialization

Make sure it's zeros to start with.  Currently flags might be gibberish!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: clean up some errno checks
Sage Weil [Tue, 24 Jan 2012 01:00:28 +0000 (17:00 -0800)]
filejournal: clean up some errno checks

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: assert submit_entry gets >0 bytes
Sage Weil [Thu, 19 Jan 2012 00:24:52 +0000 (16:24 -0800)]
filejournal: assert submit_entry gets >0 bytes

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: initialize header before writing
Sage Weil [Thu, 19 Jan 2012 00:24:38 +0000 (16:24 -0800)]
filejournal: initialize header before writing

Avoid writing uninitialized crap.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilejournal: move zero_buf allocation
Sage Weil [Thu, 19 Jan 2012 00:21:35 +0000 (16:21 -0800)]
filejournal: move zero_buf allocation

We need header.alignment to be defined.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoclient: do not send release to down mds
Sage Weil [Sat, 28 Jan 2012 17:38:46 +0000 (09:38 -0800)]
client: do not send release to down mds

We can have a session with state where the mds is not up; don't blindly
send a message or we can get

./mds/MDSMap.h: In function 'const entity_inst_t MDSMap::get_inst(int)', in thread '0x7f092aad1910'
./mds/MDSMap.h: 465: FAILED assert(up.count(m))
 ceph version 0.35-6-g6eb8862 (commit:6eb8862e91d142451e256aaa02b34c81a4f21dea)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x70) [0x71f11a]
 2: (MDSMap::get_inst(int)+0x4b) [0x6dc191]
 3: (Client::flush_cap_releases()+0x94) [0x677e60]
 4: (Client::tick()+0x1f0) [0x690adc]
 5: (C_C_Tick::finish(int)+0x1c) [0x6f3fbe]
 6: (SafeTimer::timer_thread()+0x2c5) [0x6fbfe5]
 7: (SafeTimerThread::entry()+0x19) [0x6fe399]
 8: (Thread::_entry_func(void*)+0x20) [0x72e944]
 9: /lib/libpthread.so.0 [0x7f092dea573a]
 10: (clone()+0x6d) [0x7f092cba169d]

with a map like

$ ./ceph mds dump 85
2012-01-28 09:37:19.251946 mon <- [mds,dump,85]
2012-01-28 09:37:19.252618 mon.1 -> 'dumped mdsmap epoch 85' (0)
epoch   85
flags   0
created 2012-01-28 09:24:42.411202
modified        2012-01-28 09:28:45.093301
tableserver     0
root    0
session_timeout 60
session_autoclose       300
last_failure    0
last_failure_osd_epoch  18
compat  compat={},rocompat={},incompat={1=base v0.20,2=client writeable ranges,3=default file layouts on dirs,4=dir inode in separate object}
max_mds 1
in      0
up      {}
failed  0
stopped
data_pools      [0]
metadata_pool   1

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge branch 'stable'
Sage Weil [Sat, 28 Jan 2012 18:04:45 +0000 (10:04 -0800)]
Merge branch 'stable'

13 years agosignal: use _exit() on SIGTERM
Sage Weil [Sat, 28 Jan 2012 17:26:46 +0000 (09:26 -0800)]
signal: use _exit() on SIGTERM

No need to call onexit handlers, static dtors, whatever.

This may help with #1996 and #1549.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agotest: add script for checking admin socket 'objecter_requests' output
Josh Durgin [Fri, 27 Jan 2012 19:45:26 +0000 (11:45 -0800)]
test: add script for checking admin socket 'objecter_requests' output

Just a couple internal consistency checks for now. More specific ones
would depend on workload.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoobjecter: add an admin socket command to get in-flight requests
Josh Durgin [Mon, 23 Jan 2012 21:04:14 +0000 (13:04 -0800)]
objecter: add an admin socket command to get in-flight requests

Fixes: #1881
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoadmin socket: increase debug level for successful requests
Josh Durgin [Mon, 23 Jan 2012 23:04:17 +0000 (15:04 -0800)]
admin socket: increase debug level for successful requests

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoadmin socket: add include guard
Josh Durgin [Sat, 21 Jan 2012 01:02:52 +0000 (17:02 -0800)]
admin socket: add include guard

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoCephContext: add method for retrieving admin socket
Josh Durgin [Fri, 20 Jan 2012 23:58:37 +0000 (15:58 -0800)]
CephContext: add method for retrieving admin socket

This is needed to allow higher layers in the stack to add admin socket
commands.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agoMerge branch 'wip-pg-stale'
Sage Weil [Sat, 28 Jan 2012 00:40:53 +0000 (16:40 -0800)]
Merge branch 'wip-pg-stale'

13 years agomon: stale pgs -> HEALTH_WARN
Sage Weil [Fri, 27 Jan 2012 21:27:27 +0000 (13:27 -0800)]
mon: stale pgs -> HEALTH_WARN

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomon: mark pgs stale in pg_map if primary osd is down
Sage Weil [Fri, 27 Jan 2012 21:21:39 +0000 (13:21 -0800)]
mon: mark pgs stale in pg_map if primary osd is down

This alerts the administrator when all OSDs for a PG have failed and the
monitor doesn't receive any further updates.  Otherwise we may continue
to think a pg is active+clean when it is in fact offline.

Fixes: #1993
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>