]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
14 years agosignals: handle_fatal_signal: use SA_NODEFER
Colin Patrick McCabe [Tue, 28 Dec 2010 02:04:17 +0000 (18:04 -0800)]
signals: handle_fatal_signal: use SA_NODEFER

SA_RESETHAND | SA_NODEFER allows the "re-trigger default signal handler"
trick to work for signals other than SIGSEGV.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agosignals: backtrace some more exotic fatal signals
Colin Patrick McCabe [Tue, 28 Dec 2010 01:49:57 +0000 (17:49 -0800)]
signals: backtrace some more exotic fatal signals

We're not likely to see these, but if we do, we want it in the logs!

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agosignals: test infinite_recursion
Colin Patrick McCabe [Tue, 28 Dec 2010 01:37:39 +0000 (17:37 -0800)]
signals: test infinite_recursion

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agocommon: make generic_usage a little prettier
Colin Patrick McCabe [Tue, 28 Dec 2010 01:18:58 +0000 (17:18 -0800)]
common: make generic_usage a little prettier

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agosignals: Handle SIGILL, SIGBUS, SIGFPE.
Colin Patrick McCabe [Tue, 28 Dec 2010 01:29:57 +0000 (17:29 -0800)]
signals: Handle SIGILL, SIGBUS, SIGFPE.

Print out a backtrace when we get SIGILL, SIGBUS, or SIGFPE. Fix a bug
where we failed to install a SIGABRT handler.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agotest: add TestSignalHandlers
Colin Patrick McCabe [Mon, 27 Dec 2010 21:34:01 +0000 (13:34 -0800)]
test: add TestSignalHandlers

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agorgw_admin: fix compile error in usage
Samuel Just [Tue, 21 Dec 2010 21:56:35 +0000 (13:56 -0800)]
rgw_admin: fix compile error in usage

generic_usage was changed in c4b5c33b123edfc7770e156b4b7f183f8b0af0c9
but this use was not updated.  Should call generic_client_usage.

14 years agolibrados: Fix compile error by adding std:: namespace
Greg Farnum [Tue, 21 Dec 2010 18:19:51 +0000 (10:19 -0800)]
librados: Fix compile error by adding std:: namespace

No idea how this got left out or passed any testing?

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
14 years agoobjectcacher: Fix erroneous reference to "lock" with "flock."
Greg Farnum [Mon, 20 Dec 2010 19:34:46 +0000 (11:34 -0800)]
objectcacher: Fix erroneous reference to "lock" with "flock."

This looks to be an old bug introduced years ago in
267679abc7e29e73655da7367d87e22a0a0d2375, and left
undiscovered due to code unuse.
Discovered by inspection while searching for clues to other issues.

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
14 years agomds: issue caps on regular files created via MKNOD
Sage Weil [Sat, 18 Dec 2010 00:51:32 +0000 (16:51 -0800)]
mds: issue caps on regular files created via MKNOD

Give the client some caps to write with.  This is similar to the current
MKDIR behavior, but with different bits.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: set a writeable client range on regular files created via MKNOD
Sage Weil [Sat, 18 Dec 2010 00:33:15 +0000 (16:33 -0800)]
mds: set a writeable client range on regular files created via MKNOD

If the client reexports ceph via nfs, file creations come through as
a MKNOD followed by OPEN.  If it's a MKNOD on a normal file, assume that
the client will probably write to it and set them up with the caps and
client_range to do so without asking us again first.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: set layout on files created by MKNOD instead of CREATE
Sage Weil [Sat, 18 Dec 2010 00:28:19 +0000 (16:28 -0800)]
mds: set layout on files created by MKNOD instead of CREATE

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agocephx: fix uninitialized value
Sage Weil [Sat, 18 Dec 2010 00:02:45 +0000 (16:02 -0800)]
cephx: fix uninitialized value

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoosd: refactor _get_pool / _put_pool a little bit
Colin Patrick McCabe [Fri, 17 Dec 2010 20:28:23 +0000 (12:28 -0800)]
osd: refactor _get_pool / _put_pool a little bit

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: OSD::_lookup_pool: avoid double lookup
Colin Patrick McCabe [Fri, 17 Dec 2010 20:00:13 +0000 (12:00 -0800)]
osd: OSD::_lookup_pool: avoid double lookup

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agotest: create test_pools.sh
Colin Patrick McCabe [Fri, 17 Dec 2010 19:52:01 +0000 (11:52 -0800)]
test: create test_pools.sh

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: eliminate out-of-range dout calls
Colin Patrick McCabe [Fri, 17 Dec 2010 07:55:08 +0000 (23:55 -0800)]
logging: eliminate out-of-range dout calls

Eliminate calls to dout that use non-existent log levels, like negative
levels less than -1. Also trigger a compiler error in the future if they
get re-added. -1 is the highest priority dout level; putting lower
priorities into the output buffer will just cause errors.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agocommon: more cerr -> derr conversions
Colin Patrick McCabe [Fri, 17 Dec 2010 00:25:29 +0000 (16:25 -0800)]
common: more cerr -> derr conversions

cmds: cerr -> derr

DoutStreambuf: primitive_log: just write to the stdout fd rather than cerr

assert: don't write output to stderr manually (dout will do that
automatically). Do _dout_lock.Lock rather than TryLock. Failing to wait
for the lock is potentially buggy and provides no benefit in that code.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agogceph,ceph: replace cerr->derr
Colin Patrick McCabe [Thu, 16 Dec 2010 22:57:35 +0000 (14:57 -0800)]
gceph,ceph: replace cerr->derr

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agocosd: replace cerr with derr
Colin Patrick McCabe [Thu, 16 Dec 2010 18:53:58 +0000 (10:53 -0800)]
cosd: replace cerr with derr

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: FileJournal: use derr
Colin Patrick McCabe [Thu, 16 Dec 2010 18:30:17 +0000 (10:30 -0800)]
osd: FileJournal: use derr

Use derr to announce errors in FileJournal.

Handle EINTR where necessary (still haven't fixed
read/write/pread/pwrite uses).

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: re-introduce derr
Colin Patrick McCabe [Thu, 16 Dec 2010 00:29:37 +0000 (16:29 -0800)]
logging: re-introduce derr

Re-introduce derr as a special log level (level -1) which will show up
in all logs, and on stderr. These messages are the only messages which
will show up on stderr.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: send notify message only to unexpired watchers
Yehuda Sadeh [Thu, 16 Dec 2010 00:33:02 +0000 (16:33 -0800)]
osd: send notify message only to unexpired watchers

14 years agoosd: timed out watcher is added to unconnected map
Yehuda Sadeh [Wed, 15 Dec 2010 23:37:32 +0000 (15:37 -0800)]
osd: timed out watcher is added to unconnected map

14 years agologging: close file when reloading global config
Colin Patrick McCabe [Thu, 16 Dec 2010 00:20:53 +0000 (16:20 -0800)]
logging: close file when reloading global config

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: fix watch timer, locking
Yehuda Sadeh [Wed, 15 Dec 2010 23:22:32 +0000 (15:22 -0800)]
osd: fix watch timer, locking

14 years agotools: don't start msgr thread before daemonize
Colin Patrick McCabe [Wed, 15 Dec 2010 20:28:27 +0000 (12:28 -0800)]
tools: don't start msgr thread before daemonize

Calling messenger->add_dispatcher_head() has the side-effect of starting
the messenger thread. So we must not do it before calling
messenger->start(), which sometimes calls daemonize.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoMerge branch 'objecter' into unstable
Sage Weil [Wed, 15 Dec 2010 19:02:19 +0000 (11:02 -0800)]
Merge branch 'objecter' into unstable

14 years agoobjecter: check for pg mapping changes in each incremental; refactor misc resubmissio...
Sage Weil [Wed, 15 Dec 2010 19:01:25 +0000 (11:01 -0800)]
objecter: check for pg mapping changes in each incremental; refactor misc resubmission code

We need to detect when a pg mapping changes but the primary stays the same.
That means we can't just look at the final osdmap and see what is says; we
have to look at each intervening map and check each request to see if
something switched and the osd has thrown our request out.

Also refactor and clean up the linger vs normal op stuff some more.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: add reopen_session helper
Sage Weil [Wed, 15 Dec 2010 02:04:03 +0000 (18:04 -0800)]
objecter: add reopen_session helper

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: cleanup: rename op maps
Sage Weil [Wed, 15 Dec 2010 00:18:55 +0000 (16:18 -0800)]
objecter: cleanup: rename op maps

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: track pending requests by osd, not pg
Sage Weil [Wed, 15 Dec 2010 00:15:04 +0000 (16:15 -0800)]
objecter: track pending requests by osd, not pg

This is a big cleanup.  Also
 - switch to keeping per-osd Connection *'s
 - make requests time out independently (not very efficiently yet)

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: fix inode ancestor attr encoding
Sage Weil [Tue, 14 Dec 2010 23:13:16 +0000 (15:13 -0800)]
mds: fix inode ancestor attr encoding

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomsgr: mark down by Connection*
Sage Weil [Tue, 14 Dec 2010 22:28:26 +0000 (14:28 -0800)]
msgr: mark down by Connection*

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoautomake: ignore rmdir errors during uninstall
Colin Patrick McCabe [Wed, 15 Dec 2010 18:15:49 +0000 (10:15 -0800)]
automake: ignore rmdir errors during uninstall

We don't want to fail "make distcheck" for a silly reason.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: send pending notification for reconnected watcher
Yehuda Sadeh [Wed, 15 Dec 2010 01:00:49 +0000 (17:00 -0800)]
osd: send pending notification for reconnected watcher

14 years agoautomake: add osd/Watch.h to noinst_HEADERS
Colin Patrick McCabe [Wed, 15 Dec 2010 00:28:39 +0000 (16:28 -0800)]
automake: add osd/Watch.h to noinst_HEADERS

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: use Mutex::Locker
Colin Patrick McCabe [Tue, 14 Dec 2010 14:56:27 +0000 (06:56 -0800)]
logging: use Mutex::Locker

Use Mutex::Locker to make logging exception-safe. That is, if you are
doing "dout() << foo() << dendl;" and foo throws an exception, the dout
mutex will not be left in a locked state.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologger: Fix DoutStreambuf::create_rank_symlink
Colin Patrick McCabe [Tue, 14 Dec 2010 14:20:23 +0000 (06:20 -0800)]
logger: Fix DoutStreambuf::create_rank_symlink

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agocephtool: rename tools files
Colin Patrick McCabe [Tue, 14 Dec 2010 12:59:05 +0000 (04:59 -0800)]
cephtool: rename tools files

Rename tools files to be more consistent. For example, the main()
function for ./ceph should be in ceph.cc.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoMerge branch 'sync2' into unstable
Sage Weil [Tue, 14 Dec 2010 20:47:40 +0000 (12:47 -0800)]
Merge branch 'sync2' into unstable

14 years agolibrados: drop watch_lock
Sage Weil [Tue, 14 Dec 2010 19:02:12 +0000 (11:02 -0800)]
librados: drop watch_lock

Use the existing lock to do protect all of this.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: drop linger_info_mutex
Sage Weil [Tue, 14 Dec 2010 19:00:19 +0000 (11:00 -0800)]
objecter: drop linger_info_mutex

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: simplify linger register
Sage Weil [Tue, 14 Dec 2010 18:48:57 +0000 (10:48 -0800)]
objecter: simplify linger register

Drop single-use helper; make unregister_linger part of the public
interface.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: fix up linger ack/commit to trigger first time only
Sage Weil [Tue, 14 Dec 2010 18:47:19 +0000 (10:47 -0800)]
objecter: fix up linger ack/commit to trigger first time only

We only want the user-provided ack/commit callbacks to trigger the first
time we register the lingering op.  Same goes for the eversion_t *objver.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: clean up linger interface
Sage Weil [Tue, 14 Dec 2010 18:35:40 +0000 (10:35 -0800)]
objecter: clean up linger interface

Put LingerOp on heap.  Use xlist to attach to PGs.  Add in/out bufferlists.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoMerge remote branch 'origin/unstable' into sync2
Sage Weil [Tue, 14 Dec 2010 17:55:21 +0000 (09:55 -0800)]
Merge remote branch 'origin/unstable' into sync2

Conflicts:
src/auth/Crypto.cc
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h
src/osd/osd_types.h

14 years agologging: Fix use-before-access in debug.cc
Vangelis Koukis [Tue, 14 Dec 2010 09:57:15 +0000 (01:57 -0800)]
logging: Fix use-before-access in debug.cc

Signed-off-by: Vangelis Koukis <vkoukis@cslab.ece.ntua.gr>
Signed-off-by: Constantinos Venetsanopoulos <cven@cslab.ece.ntua.gr>
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoosd: return ENOSPC for non-mds if full flag is set in osdmap
Sage Weil [Sat, 11 Dec 2010 21:58:47 +0000 (13:58 -0800)]
osd: return ENOSPC for non-mds if full flag is set in osdmap

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoMerge remote branch 'origin/syslog' into unstable
Sage Weil [Sat, 11 Dec 2010 16:09:17 +0000 (08:09 -0800)]
Merge remote branch 'origin/syslog' into unstable

Conflicts:
src/mon/Paxos.cc
src/osd/PG.cc

14 years agoMerge branch 'gceph' into unstable
Sage Weil [Sat, 11 Dec 2010 16:04:09 +0000 (08:04 -0800)]
Merge branch 'gceph' into unstable

14 years agogceph: Add gceph to rpm, deb
Colin Patrick McCabe [Sat, 11 Dec 2010 04:34:29 +0000 (20:34 -0800)]
gceph: Add gceph to rpm, deb

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agogceph: run shutdown functions at exit
Colin Patrick McCabe [Sat, 11 Dec 2010 04:30:57 +0000 (20:30 -0800)]
gceph: run shutdown functions at exit

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agogceph: fix compile
Colin Patrick McCabe [Sat, 11 Dec 2010 04:25:47 +0000 (20:25 -0800)]
gceph: fix compile

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agogceph: add -h argument
Colin Patrick McCabe [Sat, 11 Dec 2010 04:15:25 +0000 (20:15 -0800)]
gceph: add -h argument

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoceph tool: Create gceph
Colin Patrick McCabe [Sat, 11 Dec 2010 01:46:50 +0000 (17:46 -0800)]
ceph tool: Create gceph

Put the gui into a separate binary.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agolibrados, objecter: fix unwatch operation
Yehuda Sadeh [Thu, 9 Dec 2010 23:57:55 +0000 (15:57 -0800)]
librados, objecter: fix unwatch operation

14 years agorpm: update changelog
Colin Patrick McCabe [Thu, 9 Dec 2010 22:38:08 +0000 (14:38 -0800)]
rpm: update changelog

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agorpm: fix ceph.spec to work with gcephtool
Colin Patrick McCabe [Thu, 9 Dec 2010 19:46:28 +0000 (11:46 -0800)]
rpm: fix ceph.spec to work with gcephtool

Don't try to package gui_resources unless we are building the GUI.
Get GUI dependencies correct.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoobjecter: resend_linger copies ops
Yehuda Sadeh [Thu, 9 Dec 2010 21:55:45 +0000 (13:55 -0800)]
objecter: resend_linger copies ops

14 years agoFix overflow in FileJournal::_open_file()
Vangelis Koukis [Thu, 9 Dec 2010 18:53:22 +0000 (20:53 +0200)]
Fix overflow in FileJournal::_open_file()

[ The following text is in the "iso-8859-7" character set. ]
    [ Your display is set for the "iso-8859-1" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Running the unstable branch, mkcephfs fails when trying to create
a 3GB journal file on the OSDs.

Relevant messages from the osd logfile:

2010-12-09 19:03:54.419737 7fdde4d51720 journal _open_file: unable to extend journal to 18446744072560312320 bytes
2010-12-09 19:03:54.419789 7fdde4d51720 filestore(/osd) mkjournal error creating journal on /osd/journal

The problem is that the calculation of the journal size in bytes
overflows, in FileJournal::_open_file().

Signed-off-by: Vangelis Koukis <vkoukis@cslab.ece.ntua.gr>
Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoReplicatedPG.cc: Fixes a bug in snap_trimmer where a pointer to a stack
Samuel Just [Thu, 9 Dec 2010 18:25:39 +0000 (10:25 -0800)]
ReplicatedPG.cc: Fixes a bug in snap_trimmer where a pointer to a stack
Cond is left in the mode.waiting_cond list.

Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
14 years agoReplicatedPG: snap_trimmer now acquires a read lock on the osd map
Samuel Just [Thu, 9 Dec 2010 18:24:34 +0000 (10:24 -0800)]
ReplicatedPG: snap_trimmer now acquires a read lock on the osd map
before calling share_pg_info.

Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
14 years agorpm: don't try to package radosacl
Colin Patrick McCabe [Thu, 9 Dec 2010 18:59:57 +0000 (10:59 -0800)]
rpm: don't try to package radosacl

radosacl is just a test binary, so unless we build with --with-debug, we
won't get it.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agorpm: add pkgconfig to BuildRequires
Colin Patrick McCabe [Thu, 9 Dec 2010 18:39:34 +0000 (10:39 -0800)]
rpm: add pkgconfig to BuildRequires

You can't build without pkgconfig.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agorpm: set files-attr for radosgw
Colin Patrick McCabe [Thu, 9 Dec 2010 18:26:55 +0000 (10:26 -0800)]
rpm: set files-attr for radosgw

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agofilejournal: reset last_commited_seq if we find journal to be invalid
Sage Weil [Wed, 8 Dec 2010 23:53:13 +0000 (15:53 -0800)]
filejournal: reset last_commited_seq if we find journal to be invalid

If we read an event that's later than our expected entry, we set read_pos
to -1 and discard the journal.  If that happens we also need to reset
last_committed_seq to avoid a crash like

2010-12-08 17:04:39.246950 7f269d138910 journal commit_finish thru 16904
2010-12-08 17:04:39.246961 7f269d138910 journal committed_thru 16904 < last_committed_seq 37778589
os/FileJournal.cc: In function 'virtual void FileJournal::committed_thru(uint64_t)':
os/FileJournal.cc:854: FAILED assert(seq >= last_committed_seq)
 ceph version 0.24~rc (commit:fe10300317383ec29948d7dbe3cb31b3aa277e3c)
 1: (FileJournal::committed_thru(unsigned long)+0xad) [0x588e7d]
 2: (JournalingObjectStore::commit_finish()+0x8c) [0x57f2ec]
 3: (FileStore::sync_entry()+0xcff) [0x5764cf]
 4: (FileStore::SyncThread::entry()+0xd) [0x506d9d]
 5: (Thread::_entry_func(void*)+0xa) [0x4790ba]
 6: /lib/libpthread.so.0 [0x7f26a2f8373a]
 7: (clone()+0x6d) [0x7f26a1c2569d]

Fixes #631

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agoobjecter: create a new op for resending lingering requests
Yehuda Sadeh [Thu, 9 Dec 2010 00:02:52 +0000 (16:02 -0800)]
objecter: create a new op for resending lingering requests

14 years agologger: tweak cmon log output a bit
Colin Patrick McCabe [Wed, 8 Dec 2010 20:58:06 +0000 (12:58 -0800)]
logger: tweak cmon log output a bit

Make the output of cmon on stderr a little bit less verbose.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: DoutStreambuf: handle daemonizing better
Colin Patrick McCabe [Wed, 8 Dec 2010 19:50:15 +0000 (11:50 -0800)]
logging: DoutStreambuf: handle daemonizing better

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agoobjecter: a few lingering fixes
Yehuda Sadeh [Wed, 8 Dec 2010 19:36:18 +0000 (11:36 -0800)]
objecter: a few lingering fixes

14 years agomon: use helper for clock drift check; log relative instead of absolute time
Sage Weil [Wed, 8 Dec 2010 19:12:51 +0000 (11:12 -0800)]
mon: use helper for clock drift check; log relative instead of absolute time

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agologging: debug.h: use DoutStreambuf
Colin Patrick McCabe [Wed, 8 Dec 2010 07:53:12 +0000 (23:53 -0800)]
logging: debug.h: use DoutStreambuf

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: Remove _dout_check_log
Colin Patrick McCabe [Wed, 8 Dec 2010 06:59:18 +0000 (22:59 -0800)]
logging: Remove _dout_check_log

_dout_check_log is unneeded, since every invocation of dout makes the
same check.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: debug.h: minor cleanup
Colin Patrick McCabe [Wed, 8 Dec 2010 07:17:48 +0000 (23:17 -0800)]
logging: debug.h: minor cleanup

Don't put std::ostream into the global namespace. Copyright update.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: eliminate dbeginl
Colin Patrick McCabe [Wed, 8 Dec 2010 06:40:28 +0000 (22:40 -0800)]
logging: eliminate dbeginl

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: Implement rank symlinks
Colin Patrick McCabe [Wed, 8 Dec 2010 03:09:18 +0000 (19:09 -0800)]
logging: Implement rank symlinks

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: Support isym_path
Colin Patrick McCabe [Wed, 8 Dec 2010 02:54:03 +0000 (18:54 -0800)]
logging: Support isym_path

Support instance symlinks, which are activated when we are using
g_conf.log_per_instance.

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: rename_output_file -> handle_pid_change
Colin Patrick McCabe [Wed, 8 Dec 2010 02:51:35 +0000 (18:51 -0800)]
logging: rename_output_file -> handle_pid_change

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: _calculate_opath: use g_conf.log_dir
Colin Patrick McCabe [Wed, 8 Dec 2010 02:49:14 +0000 (18:49 -0800)]
logging: _calculate_opath: use g_conf.log_dir

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: DoutStreambuf: better debug output
Colin Patrick McCabe [Wed, 8 Dec 2010 02:47:28 +0000 (18:47 -0800)]
logging: DoutStreambuf: better debug output

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: create_symlink:sometimes use rel symlinks
Colin Patrick McCabe [Wed, 8 Dec 2010 02:45:21 +0000 (18:45 -0800)]
logging: create_symlink:sometimes use rel symlinks

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: implement get_dirname, move get_basename
Colin Patrick McCabe [Wed, 8 Dec 2010 02:43:49 +0000 (18:43 -0800)]
logging: implement get_dirname, move get_basename

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: fix normalize_relative
Colin Patrick McCabe [Wed, 8 Dec 2010 02:41:23 +0000 (18:41 -0800)]
logging: fix normalize_relative

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agomds: sync->mix replica state is sync->mix(2)
Sage Weil [Tue, 7 Dec 2010 21:31:01 +0000 (13:31 -0800)]
mds: sync->mix replica state is sync->mix(2)

When auth first moves to sync->mix,
 - auth sends AC_MIX to replicas
 - replicas go to sync->mix
 - replicas finish gather, send AC_SYNCACK, move to sync->mix(2)
 - auth gets all acks, sends AC_MIX again
 - replica moves to MIX

So any new replica should just get sync->mix(2), so that it is not confused
by the second AC_MIX.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: no not choose lock state on replicas
Sage Weil [Tue, 7 Dec 2010 20:50:15 +0000 (12:50 -0800)]
mds: no not choose lock state on replicas

The lock state has already been set during rejoin.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: small rejoin cleanup
Sage Weil [Tue, 7 Dec 2010 20:45:04 +0000 (12:45 -0800)]
mds: small rejoin cleanup

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: rev mds cluster internal protocol
Sage Weil [Tue, 7 Dec 2010 19:26:24 +0000 (11:26 -0800)]
mds: rev mds cluster internal protocol

The lock encoding changed with the dirty bit on scatterlocks.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: fix replay of already-journaled requests
Sage Weil [Tue, 7 Dec 2010 19:21:39 +0000 (11:21 -0800)]
mds: fix replay of already-journaled requests

Check for already-completed tids for both retried and replayed requests.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: open undef dirfrags during rejoin
Sage Weil [Tue, 7 Dec 2010 19:15:56 +0000 (11:15 -0800)]
mds: open undef dirfrags during rejoin

Any invented dirfrags have a version of 0.  This will cause problems later
if we pre_dirty() anything in that dir because the dir version won't be
in sync (it'll be way too small).  Also, we can do that at any point,
e.g. when flushing dirty caps, and aren't allowed to delay, so we need to
load those dirfrags now.

In theory we could read only the fnode and not all the dentries, but we
may as well.  We should be more careful about memory that this patch is,
though.

Fixes #15.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: add missing try_clear_more() to scatterlock
Sage Weil [Tue, 7 Dec 2010 18:47:58 +0000 (10:47 -0800)]
mds: add missing try_clear_more() to scatterlock

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: explicitly pass scatterlock dirty flag to auth on gather
Sage Weil [Tue, 7 Dec 2010 18:47:30 +0000 (10:47 -0800)]
mds: explicitly pass scatterlock dirty flag to auth on gather

This ensures that if the replica is thinks it is flushing something the
auth will always do a scatter_writebehind.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: send LOCKFLUSHED to trigger finish_flush on replicas
Sage Weil [Tue, 7 Dec 2010 17:06:47 +0000 (09:06 -0800)]
mds: send LOCKFLUSHED to trigger finish_flush on replicas

Since f741766a we have triggered start_flush and finish_flush on replicas.
The problem is that the finish_flush didn't always happen for the mix->lock
case: we sould start_flush when we sent the AC_LOCKACK, but could only
finish_flush if/when we got another SYNC or MIX.  If the primary stayed in
the LOCK state, we would keep our flushing flag.  That in turn causes
problems later when we try to eval_gather() (esp if we are auth at that
point?).

Fix this by sending an explicit AC_LOCKFLUSHED message to replicas after
we do a scatter_writebehind.  The replica will only set flushing if it
flushed dirty data, which forces scatter_writebehind, so we will always
get the LOCKFLUSHED to match.  Replicas that didn't flush will also get
it, but oh well.  We'd need to keep track which ones sent dirty data to
do that properly, though.

TODO: still need to verify that this is correct for rejoin.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: clear EXPORTINGCAPS on export_reverse
Sage Weil [Tue, 7 Dec 2010 15:58:01 +0000 (07:58 -0800)]
mds: clear EXPORTINGCAPS on export_reverse

We need to reverse the effects of encode_export_inode_caps(), which is just
the pin and state bit.

The original problem can be reproduced with
 - ceph tell mds 0 injectargs '--mds-kill-import-at 5'
 - restart mds
 - recovery completes successfully
 - wait for the subtree to be reexported
 - fail with bad EXPORTINGCAPS get in encode_export_inode_caps

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: fix LOOKUPHASH to avoid creating bogus replica CDir
Sage Weil [Tue, 7 Dec 2010 00:31:56 +0000 (16:31 -0800)]
mds: fix LOOKUPHASH to avoid creating bogus replica CDir

We can't create the CDir if we are non-auth.

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agomds: introduce rejoin_invent_dirfrag() helper
Sage Weil [Mon, 6 Dec 2010 22:34:36 +0000 (14:34 -0800)]
mds: introduce rejoin_invent_dirfrag() helper

Signed-off-by: Sage Weil <sage@newdream.net>
14 years agologging: Add symlink helper functions
Colin Patrick McCabe [Tue, 7 Dec 2010 23:47:24 +0000 (15:47 -0800)]
logging: Add symlink helper functions

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologger: fix EINTR handling
Colin Patrick McCabe [Tue, 7 Dec 2010 22:00:01 +0000 (14:00 -0800)]
logger: fix EINTR handling

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: rename_output_file: fix bug
Colin Patrick McCabe [Tue, 7 Dec 2010 21:57:38 +0000 (13:57 -0800)]
logging: rename_output_file: fix bug

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
14 years agologging: DoutStreambuf: Implement log-to-file
Colin Patrick McCabe [Tue, 7 Dec 2010 21:55:54 +0000 (13:55 -0800)]
logging: DoutStreambuf: Implement log-to-file

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>