Commit Graph

17180 Commits

Author SHA1 Message Date
Sage Weil
4f39aaa7a9 keyring: don't print auid if it is the default
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:55:28 -08:00
Sage Weil
ee02a1e12b mon: implement 'fsid' command
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:55:06 -08:00
Sage Weil
5a3004e2c4 Merge branch 'stable' 2011-11-12 14:19:26 -08:00
Sage Weil
73f99a189f mon: fix 'osd crush add ..' weight
This was changed to floating point in commit 3f67893.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:08:02 -08:00
Sage Weil
1b843e0ef6 osdmap: build_simple with normal osd/host/rack/pool hierarchy
This will be useful in the general case where the cluster is created with
an empty map and useful crush hierarchy.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:05:15 -08:00
Sage Weil
ec97c852d7 mon: fix 'osd crush add ..' weight
This was changed to floating point in commit 3f67893.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:04:15 -08:00
Sage Weil
0349fa9625 vstart.sh: don't generate initial osdmap explicitly
This is simpler and exercises the monitors ability to start with a generic
osdmap and build it out as new osds are added to the cluster.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:42:38 -08:00
Sage Weil
30ddc85e54 mon: make initial osdmap optional
If an initial osdmap is not provided, we generate an empty one.  The user
add osds on their own after that.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:41:59 -08:00
Sage Weil
0d812252d7 osdmap: build_simple: create reasonable pools when numosd==0
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:41:05 -08:00
Sage Weil
8e150fb496 mon: add '--fsid foo' arg for setting generated monmap fsid
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:16:30 -08:00
Sage Weil
b51d817e23 mon: take '--fsid foo' arg with --mkfs
This will set the seed monmap's fsid.  This is useful if the monmap is
dynamically generated (e.g., based on ceph.conf or --mon-host list).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 21:04:58 -08:00
Sage Weil
0c731ed7a9 osd: fix warnings
osd/ReplicatedPG.cc: In member function 'virtual void ReplicatedPG::remove_watchers_and_notifies()':
osd/ReplicatedPG.cc:1167: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
osd/ReplicatedPG.cc:1176: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 21:04:56 -08:00
Sage Weil
73705f661b monmaptool: fix clitests
Initial map is epoch 0.  Modifications still bump epoch by one.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 20:52:28 -08:00
Sage Weil
36241da4b1 paxos: discard waiting_for_active events on reset
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:49:00 -08:00
Sage Weil
80ab65682a monclient: use blank fsid (instead of epoch==0) for monmap checks
We can safely mkfs with an epoch=0 monmap as long as the fsid is set.  And
that is what commit f31825cee5 changed.

Instead, use a zeroed fsid to tell if the monmap is valid/usable.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:48:59 -08:00
Sage Weil
2253c0168d use libuuid for fsid
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:48:59 -08:00
Sage Weil
07950bb8f0 crush: grammer: allow '.' in name token
These are now in the generated crush maps, so it seems appropriate to
recompile them :).

Reported-by: Martin Mailand <martin@tuxadero.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:59:38 -08:00
Sage Weil
cf0a53e1ed mon: fix seed monmap removal
Remove if we previous had no latest, not based on which map we now have.
It's possible we join when monmap epoch is something much larger than 1!

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:54:41 -08:00
Sage Weil
6d370f3bd6 mon: allow monitor to automagically join cluster
If a monitor starts up with the correct fsid and auth keys, it will now
add itself to the monmap (and subsequently try to join the quorum) if it
is not already in the monmap.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:52:44 -08:00
Sage Weil
d56485a8af osd: pass monclient::init errors up the stack
Fixes crash like

 ceph version 0.38-149-gbf254de (commit:bf254de5cf8a17ce9467d166d87f3ab93170ae13)
 1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x91d97b]
 2: ./ceph-osd() [0xa05baa]
 3: (()+0xef60) [0x7fb54c87ef60]
 4: (std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0xc) [0x8a4bc6]
 5: (std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0x18) [0x8a1d32]
 6: (void encode<unsigned int>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, ceph::buffer::list&)+0x1c) [0x8a0311]
 7: (MonClient::_reopen_session()+0x2c5) [0x89a425]
 8: (MonClient::authenticate(double)+0x24f) [0x898da7]
 9: (OSD::init()+0x112b) [0x807ca1]
 10: (main()+0x2c09) [0x73e406]
 11: (__libc_start_main()+0xfd) [0x7fb54b04ec4d]
 12: ./ceph-osd() [0x73b499]

due to auth_supported being NULL.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:52:24 -08:00
Sage Weil
bf254de5cf mon: verify fsid during probe and election
This will keep mismatched fsids out of the same quorum.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:37:07 -08:00
Sage Weil
f1a98fb8af mon: tolerate won election while active
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:37 -08:00
Sage Weil
cd736b9da0 mon: clean up logic a bit
More explicit.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:22 -08:00
Sage Weil
2633d71dbd mon: only re bootstrap if monmap actually changes
If we go thru here just to update latest, that's fine; no need to restart
the bootstrap process.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:09 -08:00
Sage Weil
622fbadd66 paxos: fix off-by-one in share_state
We hit this on adding a new monitor to an existing cluster.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:15:16 -08:00
Sage Weil
6c663d855e mon: fix monmap update
It's on the stack; update in place.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:05:01 -08:00
Sage Weil
1134fdfe78 mon: properly process monmaps even when i have the latest
We may get the latest monmap when we are doing our probing, but we still
need to process it in update_from_paxos().  Consider get_latest_version()
in addition to the active map.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:02:52 -08:00
Sage Weil
c097e63401 mon: fix up update_from_paxos() methods
Make sure they behave when the initial state is learned from paxos.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:55:34 -08:00
Sage Weil
f31825cee5 monmaptool: new maps get epoch 0
Just for consistency's sake.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:41:42 -08:00
Sage Weil
65f797ea47 mon: clean up mkfs seed data
And make sure the monmap/latest gets written properly.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:41:42 -08:00
Sage Weil
e545af2db5 mon: remove empty monstore dirs
This is sloppy, but it works well enough since we mkdir dirs as needed
too.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:41:42 -08:00
Sage Weil
aea7563f03 mon: create initial states after quorum is formed
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:41:42 -08:00
Sage Weil
1533f1c0ed mon: stage mkfs seed info in mkfs/ dir
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 10:45:27 -08:00
Sage Weil
9e941c4359 mon: eliminate PaxosService::init()
update_from_paxos() is sufficient

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 10:34:42 -08:00
Sage Weil
0a926ef576 mon: include monmap dump in mon_status and quorum_status
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 10:19:33 -08:00
Sage Weil
8c3d872ef0 mon: pull initial monmap from monmap/latest OR mkfs/monmap
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 10:15:23 -08:00
Sage Weil
0ecae9969e mon: take explicit initial monmap -or- generate one via MonClient
This will simplify bootstrapping a cluster via e.g. mon_host.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 10:05:36 -08:00
Sage Weil
dae6c95654 test_filestore_idempotent: detect commit cycles due to non-idempotent ops
If we do a non-idempotent op and it does a commit itself, we don't see
fs->is_committed() true ever.  Also count full commit cycles, and kill
ourselves after several of those have gone by.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
add04d15f4 filejournal: fix replay of non-idempotent ops
- start sync thread prior to replay, so that we can commit as we replay
  operations
- keep applied_seq accurate
- pass seq (not old op_seq) to do_transactions
- carry open_ops ref so that commit blocks until we have finished applying
  the full transaction

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
9f1673c15a test_filestore_idempotent: transactions are individually idempotent
Make individual transactions idempotent, but their interactions
non-idempotent.  I.e. A A A A is okay, but A B A is not.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
8df0cd3867 filestore: make trigger_commit() wake up sync; adjust locking
We need to wake up the sync thread (duh).

Also, we need to obey the FileJournal::lock -> journal_lock locking
order.

Also, lockdep is broken. :(

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
0981112097 filestore: document the btrfs_* fields
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
69cd362542 filestore: sync after non-idempotent operations
This is a big hammer to fix journal replay on non-btrfs fs backends (extN,
xfs, whatever).  The problem is that it is not safe to replay some journal
operations more than once, notably things like CLONE whose source data
may be changed by subsequent operations.

The simple fix is to initiate a full commit after any non-idempotent
operations prior to any subsequent operation within the same Sequencer.
This is done by calling trigger_commit() in _do_transactions(), which means
any potentially dependent operation that follows will get blocked because
a commit is about to start.

I made trigger_commit() a bit more robust to callers who are not holding
an open_ops ref to also succeeding if the given op_seq is already
committing.  For the current caller, that can't happen.

There are probably better performing solutions, but this one is at least
correct.

Fixes: #213
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-10 21:12:38 -08:00
Sage Weil
fa5047b377 Merge remote branch 'gh/stable' 2011-11-10 20:50:31 -08:00
Josh Durgin
5407fa70f8 workunits: add workunit for running rgw and rados python tests
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-11-10 17:03:12 -08:00
Yehuda Sadeh
2fb702979c rgw: remove warning 2011-11-10 17:10:41 -08:00
Josh Durgin
71bfe8974e test/pybind: add test_rgw
Forgot to add this in the previous commit.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-11-10 16:52:01 -08:00
Josh Durgin
ea42e02ca2 test/pybind: convert python rados and rgw tests to be runnable by nose
These tests can now be run automatically more easily.

Fixes: #1653
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-11-10 16:46:35 -08:00
Josh Durgin
25cde7f98a rados.py: fix Snap.get_timestamp
This now uses datetime, imports the right things, and calls the right function.

Fixes #1577
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-11-10 16:33:46 -08:00
Sage Weil
b600ec2ac7 v0.38 2011-11-10 15:07:05 -08:00