Similar to --add-item, except it will move, rename, or reweight the item if
it is already present in the map.
Signed-off-by: Sage Weil <sage@newdream.net>
This is similar to insert_item(), except it will succeed if the item is
already there, and will move an item to the specified location if it is
not. It returns 0 for no change, 1 if a chance was made. It also makes
sure the weight and name match.
Signed-off-by: Sage Weil <sage@newdream.net>
The check_item_loc() method will take an item and position and tell you if
it matches the items current location. The matching is identical to that
used for insert_item, in that a specific location constraint match means
success, even if a less specific one does not match (e.g., rack=wrongrack,
host=correcthost will return true).
Signed-off-by: Sage Weil <sage@newdream.net>
Fixes bug #2369. The problem was that sometimes we send the
notification with the un-normalized bucket/obj pair. We
should make sure that we use the caonical name before doing
any cache update.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Make the osd create command idempotent by providing a uuid. If you call it
multiple times with the same (or some other existing) uuid you'll get back
the osd id that is already using it.
Drop support for 'osd create <id>', which was mostly useless and
non-idempotent anyway.
Signed-off-by: Sage Weil <sage@newdream.net>
We may want to make this more strict, so that if it is defined it has to
match the map, and only fill it in when the map's uuid is still zeroed
(for legacy clusters)...
Signed-off-by: Sage Weil <sage@newdream.net>
Rev the extended section of the map to store it. Dump it when the osd
exists. Zero it out if an osd is destroyed. Provide some accessors to
identify an osd given a uuid (linear search).
Signed-off-by: Sage Weil <sage@newdream.net>
This only affects the decision to queue or do things inline, so it is safe
to change while the filestore is up and running.
Also adjust the #ifdef so that there we share a single path through the
code when sync_file_range() is missing.
Fixes: #2368
Signed-off-by: Sage Weil <sage@newdream.net>
If only want to include down osds if *all* of the prior acting osds are
down. If osd->whoami is one of them, then we're okay.
For example, if osd.13 is down, then the below should be satisfied that
osd.14 (osd->whoami) is alive:
2012-04-27 10:46:38.746681 7f5258a63700 15 osd.14 27 calc_priors_during 6.5 [9,25)
2012-04-27 10:46:38.746688 7f5258a63700 20 osd.14 27 6.5 in epoch 9 was [13,14]
2012-04-27 10:46:38.746695 7f5258a63700 20 osd.14 27 6.5 in epoch 10 was [13,14]
2012-04-27 10:46:38.746701 7f5258a63700 20 osd.14 27 6.5 in epoch 11 was [13,14]
2012-04-27 10:46:38.746709 7f5258a63700 20 osd.14 27 6.5 in epoch 12 was [13,14]
2012-04-27 10:46:38.746715 7f5258a63700 20 osd.14 27 6.5 in epoch 13 was [13,14]
2012-04-27 10:46:38.746722 7f5258a63700 20 osd.14 27 6.5 in epoch 14 was [13,14]
2012-04-27 10:46:38.746729 7f5258a63700 20 osd.14 27 6.5 in epoch 15 was [14]
2012-04-27 10:46:38.746735 7f5258a63700 20 osd.14 27 6.5 in epoch 16 was [14]
2012-04-27 10:46:38.746742 7f5258a63700 20 osd.14 27 6.5 in epoch 17 was [14]
2012-04-27 10:46:38.746748 7f5258a63700 20 osd.14 27 6.5 in epoch 18 was [13,14]
2012-04-27 10:46:38.746755 7f5258a63700 20 osd.14 27 6.5 in epoch 19 was [13,14]
2012-04-27 10:46:38.746762 7f5258a63700 20 osd.14 27 6.5 in epoch 20 was [13,14]
2012-04-27 10:46:38.746768 7f5258a63700 20 osd.14 27 6.5 in epoch 21 was [13,14]
2012-04-27 10:46:38.746775 7f5258a63700 20 osd.14 27 6.5 in epoch 22 was [14]
2012-04-27 10:46:38.746781 7f5258a63700 20 osd.14 27 6.5 in epoch 23 was [14]
2012-04-27 10:46:38.746788 7f5258a63700 20 osd.14 27 6.5 in epoch 24 was [14]
2012-04-27 10:46:38.746790 7f5258a63700 10 osd.14 27 calc_priors_during 6.5 [9,25) = 13
In that case, it wasn't, and the pg creation was blocked.
Fixes: #2355
Signed-off-by: Sage Weil <sage@newdream.net>
Create an is_unmanaged_snaps_mode() function to parallel
is_pool_snaps_mode(), and replace all the checks directly referencing
removed_snaps or snaps with calls to these functions.
Fixes#2345.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>