Commit Graph

84686 Commits

Author SHA1 Message Date
Sage Weil
540b1bc9e6 osd: clean up mutex naming for OSDShard
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
183e7d7bc2 common/tracked_int_ptr: fix operator= return value
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
3a0b197cd1 osd: fix pg removal vs _process race
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
7fb35ff961 osd: lookup_*pg must return PGRef
Otherwise it is fundamentally unsafe, as the PG might get destroyed out
from under us without a reference.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
1270b49fb5 osd: kill pass-through _open_pg
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
486faa482a osd: remove old min pg epoch tracking
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
bc9436bcb5 osd/PG: remove RecoveryCtx on_applied and on_commit
These were awkward and unnecessary.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
7a9153c4b3 osd/PG: register delete completion directly on Transaction
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:55 -05:00
Sage Weil
ed72f30db7 osd: register split completion directly on Transaction
No need to use wonky RecoveryCtx C_Contexts

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
2c2378c49e osd/PG: drop unused context list accessors for RecoveryCtx
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
45e07480df osd/PG: register recovery finish context directly on Transaction
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
643714ff96 osd/PG: drop unused activate() context list arg
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
a5494b815c osd/PG: register flush completions directly on the Transaction
No need to awkward list passed as an arg; all of these callbacks end up
on the Transaction anyway.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
6c52e5d1c7 osd: wait for pg epochs based on shard tracking
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
9895c9f1a9 osd: index pg (slots) by map epoch within each shard
This will replace the epoch tracking in OSDService shortly.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
e178a6d876 osd/PG: link back to pg slot
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:54 -05:00
Sage Weil
4c465fbfac osd: OSDShard::pg_slot -> OSDShardPGSlot
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
973836c70d osd: change pg_slots unordered_map to use unique_ptr<>
This avoids moving slots around in memory in the unordered_map... they can
be big!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
7aeebde3fd osd: remove some unused methods
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
8433941c94 osd: remove created_pgs tracking in RecoveryCtx
Not needed or used!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
3b2935951f osd: fix PG::ch init
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
2922b3be33 osd: use _attach_pg and _detach_pg helpers; keep PG::osd_shard ptr
Consolidate num_pgs updates (and fix a counting bug along the way).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
b7dc3d0fab osd: remove old split tracking machinery
This infrastructure is no longer used; simpler split tracking now lives in
the shards pg_slots directly.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
295dfe0372 osd: restructure consume_map in terms of shards
- new split primming machinery
- new primed split cleanup on pg removal
- cover the pg creation path

The old split tracking is now totally unused; will be removed in the next
patch.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:53 -05:00
Sage Weil
2a9c8d80ce osd: pass sdata into dequeue_peering_evt (and dequeue_delete)
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
e297b1e6ad osd: pass data into OpQueueItem::run()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
8ee13128fe osd: kill pg_map
Split doesn't work quite right; num_pgs count is probably off.  But, things
mostly work.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
eed90d4a8f osd: rename OSDShard waiting_for_pg_osdmap -> osdmap
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
4fc459829f osd: use _get_pgs() where possible; avoid touching pg_map directly
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
bffa62233e osd: get _get_pgs() and _get_pgids()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
c4960f03a2 osd: remove get_mapped_pools command
No in-tree users.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
0bf6ac893a osd: move ShardedOpWQ::ShardData -> OSDShard
Soon we will destroy pg_map!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:52 -05:00
Sage Weil
d3bd637171 osd: kill _open_lock_pg
Move lock call to caller.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
d9dcaa79b7 osd: kill _create_lock_pg
Unused.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
0766f5b40c osd: do not release recovery_ops_reserved on requeue
This doesn't make sense.. although it's the same behavior as
luminous.

The point of the releases here is that if we drop something that is in
the queue we drop the recovery_ops_reserved counter by that much.  However,
if something is in the queue and waiting, and we wake it back up, there
is no net change to _reserved... which is only decremented when we
actually dequeue something.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
987490db3d osd: debug recovery_ops_reserved
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
765e16e04e osd: move PG peering waiters into op wq
This resolves problems with a peering event being delivered triggering
advance_pg which triggers a requeue of waiting events that are requeued
*behind* the event we are processing.  It also reduces the number of
wait lists by one, yay!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
da47654c70 osd: store ec profile with final pool
We need this to reinstantiate semi-deleted ec backends.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
c5b3913919 osd/PG: ignore RecoveryDone in ReplicaActive too
This can be missed on a RepRecovering -> RepNotRecovering ->
RepWaitBackfillReserved transition.  Catch any straggler events in
ReplicaActive.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:51 -05:00
Sage Weil
68d89616cb osd/osd_types: include epoch_sent in pg_query_t operator<<
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
cea30e9e9e osd: restructure pg waiting more
Wait by epoch.  This is less kludgey than before!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
f1f0d30c35 osd: restructure pg waiting
Rethink the way we wait for PGs.  We need to order peering events relative to
each other; keep them in a separate queue in the pg_slot.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
c20251b949 osd: normal command uses slow dispatch (it can send messages)
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
560956572e osd/OSD,PG: get_osdmap()->get_epoch() -> get_osdmap_epoch()
Avoid wrangling shared_ptr!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
065829dc11 osd: misc fixes
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
3a331c8be2 osd: kill disk_tp, recovery_gen_wq
Progress!

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:50 -05:00
Sage Weil
e5c336851c osd: move recovery contexts to normal wq
We have a specific PGRecoveryContext type/event--even though we are just
calling a GenContext--so that we can distinguish the event type properly.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:49 -05:00
Sage Weil
26938d54d4 osd: remove _ookup_lock_pg_with_map_lock_held()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:49 -05:00
Sage Weil
60ea5e87b6 osd: new MOSDScrub2 message with spg_t, fast dispatch
Send new message to mimic+ OSDs.  Fast dispatch it at the OSD.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:49 -05:00
Sage Weil
62f79cae1b osd/PG: request scrub via a state machine event
Continuing effort to make PG interactions event based.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-04 08:26:49 -05:00