Commit Graph

14532 Commits

Author SHA1 Message Date
Colin Patrick McCabe
277dc66f64 dout: reopen log files on SIGHUP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-20 14:23:10 -07:00
Colin Patrick McCabe
960d2a36a5 Add SignalSafeQueue
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-20 12:39:56 -07:00
Sage Weil
74691e7cea osd: clean up old _from target cleanup; fix one case; share map
Clean up the code to mirror the _to case.

Previously we would not mark down an old _from that is still a _to but with
a new address.  Now we do.

Share a map while we're at it, just to be nice!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 11:29:05 -07:00
Sage Weil
0f1be62914 osd: mark down old _to targets
If a peer remains a _to target but their address changes, we still want
to mark down the old connection.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 11:25:27 -07:00
Sage Weil
3811d8bf1f osd: share map with old _to peers
Use new msgr hooks to do this cleanly.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 11:20:20 -07:00
Sage Weil
f87e1dd58e osd: clean up handle_osd_ping output
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 11:17:19 -07:00
Sage Weil
3a7931c749 osd: ignore stale requests for heartbeats
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 10:54:46 -07:00
Sage Weil
f9bea34034 osd: don't prioritize heartbeat requests
This could conceivably screw up ordering, and priority doesn't matter
anyway when this is the first message we send to this peer.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 10:43:12 -07:00
Sage Weil
7a574d88ae osd: do not clobber explicitly requested heartbeat_to target addresss
Consider peer P.

- P does down in, say, epoch 60, and back up in epoch 70
- P and requests a heartbeat, as_of 70
- We update to map 50, and coincidentally add the same peer as a target
- We set the heartbeat_to[P] = 50 and start sending to the _old_ address
- P marks us down because we stop sending to the new addr
- We eventually get map 70, but it's too late!

Make sure we preserve any _to targets _and_ their epoch+inst.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 10:42:16 -07:00
Sage Weil
e1830dbd09 osd: request proper log extent for missing
We can't blinding ask for everything since last_epoch_started because that
may mean we get some fragment of a backlog.  Look at the peer's log
ranges and request the correct thing.  Also, in fulfill_log, infer what
the primary should have asked for if they make a bad request.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 09:29:10 -07:00
Sage Weil
ff031ce810 osd: fix log bounds check
We weren't accounting for the case where we have

 (foo,foo]+backlog

i.e., everything is backlog, and rbegin().version != log.head.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 08:44:42 -07:00
Sage Weil
1dba8dd6e8 osd: osd# is in log entry header/prefix
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 08:35:44 -07:00
Sage Weil
d75f62378e osd: log broken pg state to monitor on startup, activate
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 08:33:07 -07:00
Sage Weil
b7b8127e0f osd: fix proc_replica_log when peer log is empty
If the peer log is empty, and we break out of the loop on the first pass,
then clearly last_update has not been adjusted.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 08:09:11 -07:00
Sage Weil
f400110859 osd: encode keyring as plaintext after --mkkey
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 07:25:24 -07:00
Sage Weil
93709f89f6 keyring: make encode_plaintext method
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 07:25:16 -07:00
Sage Weil
6995fd515c Merge branch 'wip_choose_acting' into stable 2011-05-20 00:41:31 -07:00
Sage Weil
bdc371e593 osd: take remote log when it is clearly superior
I'm hitting a case where the primary is compensating for a replica's
last_complete < log.tail by sending a log+backlog, but the replica
isn't smart enough to take advantage.  In this case,

      replica: log(781'26629,781'26631]
 from primary: log(781'26629,781'26631]+backlog
       result: log(781'26629,781'26631]

Doh!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 00:27:00 -07:00
Sage Weil
4c97cb5f34 osd: fix compensation for bad last_complete
If the peer has a last_complete below their tail, we can get by with our
log (without backlog) if our tail if _before_ their last_complete, not
after.  Otherwise, we need a backlog!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-20 00:14:24 -07:00
Sage Weil
332565f1f8 osd: remove some build_prior stringstream cruft
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 23:48:53 -07:00
Sage Weil
45e8627ce9 osd: remove useless debug print
We dump this (and more) at the end of the PgPriorSet constructor.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 23:46:19 -07:00
Sage Weil
a2cb690d8d osd: include past acting osds if they were up
This fixes a bug where we were excluding up (but not acting) nodes from
past intervals, which in turn was triggering a nasty choose_acting loop
(because we _do_ already include acting but !up from the current
interval).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 23:40:12 -07:00
Sage Weil
d4b44f9e5a osd: do not exclude me during build_prior
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 23:38:25 -07:00
Sage Weil
f7e6b1c1fe osd: show final build_prior result
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 23:25:32 -07:00
Sage Weil
6f8708baec mon: log mkfs as INFO with fs
The [ERR] log level is misleading.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 20:46:00 -07:00
Josh Durgin
dfe52d9e02 OSD, PG: ignore peering messages from before the last peering restart
Check them before entering the state machine so we can
safely enter the Crashed state on unexpected messages
from the current interval.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-19 18:02:55 -07:00
Josh Durgin
628665bcb9 OSD: decrement message refcount before returning
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-19 18:02:42 -07:00
Sage Weil
4404116b5a mds: kick linklock on revoke_stale_caps
Also use the eval() method and issue caps instead of calling the individual
eval methods.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 17:20:18 -07:00
Sage Weil
cef8eb9c95 debian: no shlibs:Depends for obsync either
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 16:15:59 -07:00
Sage Weil
4e2c1f457e debian: no shlibs:Depends for -dev packages
So says dpkg-gencontrol, at least:

warning: dpkg-gencontrol: Depends field of package librados-dev: unknown substitution variable ${shlibs:Depends}
...

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 16:15:26 -07:00
Sage Weil
94433898f2 librbd: don't need to link against crypto libs
All that is done by librados.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-19 16:13:34 -07:00
Samuel Just
a71981c00d PG: add_event, add_next_event: ignore prior_version on backlog events
We would not have the previous version if we are merging backlog events.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-19 15:59:40 -07:00
Brian Chrisman
922f7cc3e5 expanding testceph to test open/readdir/telldir
Signed-off-by: Brian Chrisman <brchrisman@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:24:58 -07:00
Brian Chrisman
3471d41b26 add ceph_readdir() to libceph
Signed-off-by: Brian Chrisman <brchrisman@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:24:58 -07:00
Colin Patrick McCabe
8f7d6c7ea1 librados: add python bindings for getxattrs
Add python bindings for getxattrs. Test getxattr, getxattrs, and
setxattr.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 14:49:50 -07:00
Sage Weil
3df86c38f8 client: hold FILE_BUFFER ref while waiting for dirty throttle
We may block in the write path because we've reached out dirty data limit.
Hold a reference to the FILE_BUFFER cap during that interval so we don't
lose the cap and put new dirty buffers into the objectcacher out of turn.

(We could also recheck our ability to take the ref after blocking, but I
think this is cleaner.)

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:04:31 -07:00
Sage Weil
838067d0ea client: clean up _flush callers
Have _flush return true if there are no dirty buffers.  Clean up some
redundant conditionals in the callers

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:04:31 -07:00
Sage Weil
510f2dd77a client: assert(in) on _flush
We should never arrive in _flush() and not have a reference to the inode
in question, because the presence of dirty buffers pins the inode.  This
condition was introduced forever ago; clean it out.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:04:31 -07:00
Sage Weil
67533e1443 client: be more careful with FILE_BUFFER cap refs
We should either hold a ref or not; whether we release one can't depend on
whether one is held because we can't assume the ref belongs to us.

This changes the fix in cf6b1de4 so that the ObjectCacher just calls the
flush callback if it happens to trim all dirty buffers.

We also drop the (bogus) assert about the number of refs held.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:04:31 -07:00
Sage Weil
3f43c78bb8 client: _flush should no-op if nothing to flush
If there are no FILE_BUFFER cap_refs, then we can bail out early.
Otherwise we will end up dropping refs we don't have.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 15:04:31 -07:00
Sage Weil
8549fc9afb Merge remote branch 'origin/stable' 2011-05-19 15:04:19 -07:00
Josh Durgin
bc2c31e070 PG: choose_log_location: prefer OSDs with a backlog
Without preferring an OSD with a backlog, PGs would get stuck in the
active state when acting != up and the backlog was on an OSD with the
same last_update but a lower number or log_tail.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-19 14:33:29 -07:00
Josh Durgin
fe298f6461 OSD: send a log in response to a log query when the pg dne
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-19 14:33:29 -07:00
Colin Patrick McCabe
57f423ba69 librados: add rados_getxattrs API for C bindings
Support getxattrs in the Rados C API.

Also add a test of getattrs to testrados.c

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 12:46:46 -07:00
Samuel Just
bcbcf30237 ReplicatedPG: wait_for_missing_object in _rollback_to
Previously, we failed if the relevant clone had not yet been recovered.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-19 12:24:36 -07:00
Colin Patrick McCabe
4043059515 testrados: retab with C-style tabs
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 11:49:50 -07:00
Colin Patrick McCabe
6a580bf2c8 testrados: more getxattr / setxattr tests
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 11:48:21 -07:00
Colin Patrick McCabe
1dd1743189 Remove libcrush from packaging
This removes libcrush from the packaging system, now that it's been
merged into libcommon.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 11:33:17 -07:00
Sage Weil
f16903d724 client: do not retake lock in sync_write_commit
We already hold the lock from a few frames up the stack (ms_dispatch).

Reported-by: Simon Tian <aixt2006@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-19 10:14:29 -07:00
Colin Patrick McCabe
ce7f78d093 ceph.spec.in: fix obsync description
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-19 10:13:20 -07:00