Commit Graph

20230 Commits

Author SHA1 Message Date
Samuel Just
7f2354c76d doc/scripts/gen_state_diagram.py: make parser a bit more forgiving
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
9fc5db8c96 ReplicatedPG::op_applied: update last_update_applied iff !aborted
scrub state and last_update_applied will have been reset during
the interval change.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
4ce17cca2e test/encoding/types.h: disable pg_query_t encoding test
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
99c23b693f OSD: split notify|info|query messages for old clients
Old clients do not expect mixed epoch compound messages.  Thus, we
send each sub-message independently.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
193f18f2a9 FileStore: delete source collection if not replaying collection_rename
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
f0b2310f84 ReplicatedPG: RepModify track epoch_started and bail on interval change
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
7b5d8e8c37 ReplicatedPG: on_activate for a peer might happen before flush
We don't ensure for a peer that the flush completes before activation,
merely that we don't serve any ops until flush completes.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
87d1cdb5f4 OSD: _remove_pg not ruin iterator consistency
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:02 -07:00
Samuel Just
311a061e0d OSD: move watch into OSDService
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
442b5583bf PG: pass activate epoch with Activate event
This allows us to pass into activate() in which epoch the
message triggering activation occurred allowing us mark
the activate committed callback with the right query_epoch.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
f9282e6c6d Revert "osd: check against last_peering_reset in _activate_committed"
This reverts commit 86aa07d7a9.
2012-07-05 10:15:01 -07:00
Samuel Just
392df3b722 Revert "osd: reset last_peering_interval on replica activate"
This reverts commit 17114f266a.
2012-07-05 10:15:01 -07:00
Samuel Just
1b558fba0e OSD: write_info/log during process_peering_events, do_recovery
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
c6db1b2ee2 PG: delay ops in do_request, not queue_op
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
9b182d20e6 OSD: maybe_update_heartbeat_peers, don't print pg
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
0ee3d87f4f OSD: process_peering_event check for new map on each pg
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
c1f2a8026f OSD: peering_wq is now a BatchWorkQueue
process_peering_events now handles multiple pgs at once to better
batch up notifes, etc.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
d8a68e76ea OSD: do_(notifies|infos|queries) must now be passed a map
This removes the need to call them from within the osd lock.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
3ca6359ce5 common/WorkQueue.h: add BatchWorkQueue
Rather than dispatching one item at a time to process, etc,
BatchWorkQueue dispatches up to a configurable number of
items.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
5c0e8b465f OSD: bail out of do_recovery if no longer primary and active
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
5dc45f7728 PG: PG now store its own PGPool
Otherwise, we need to syncronize access to the shared PGPool objects.
The wasted memory is probably preferable to syncronization overhead.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:01 -07:00
Samuel Just
b242c565c0 OSD: on pg_removal, project_pg_history to get current interval
First, we don't really want to remove the pg if we can use it.  Second,
there might be messages in the pg peering queue for the next interval.
If one of those happens to be an info request or notify, we would lose
the peering message.

If the message falls in the current interval as determined by the
current osdmap, than we know that any messages currently queued must be
obsolete and can safetly be discarded.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
a67a874b15 CrushWrapper: add locking around crush_do_rule
crush_do_rule uses a cache on the bucket objects.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
c7581b69bd CrushWrapper: rmaps don't need to be mutable
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
73f5ce9481 OSD,PG: issue pg removals in line, remove remove_list
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
7c1dc90a60 OSD: don't advance_pg() if pg is up-to-date
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
8079a489bd OSD,PG: clean up _get_or_create_pg and set interval based on msg
Previously, we set last_peering_reset based on the epoch in which the pg
is created.  We now pass the map from the query_epoch to the creation
methods to set based on that.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
a5bf3d71a7 OSD: lock recovery_wq before debug output on finish_recovery_op
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
3dcce50e2a OSD: only do_(notify|info|query) for up osd
pg may have an older map and attempt to notify|info|query on a down
osd.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
040a22b692 OSD: map_cache should contain const OSDMap
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
4fec85f26d OSD: activate_map() in handle_osd_map only when active
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
2552a7f430 OSD,PG: _share_map_outgoing must not require osd_lock
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
35949c541c ReplicatedPG: explicitely block on not active for certain ops
Ops and some subops need to wait for active to ensure correct ordering
with respect to peering operations.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
e8d09d025e PG,OSD: prevent pg from completing peering until deletion is complete
hobject_t must now be globally unique in the filestore.  Thus, if we
start creating objects in a pg before the removal collections for the
previous incarnation are fully removed, we might end up a second
instance of the same hobject violating the filestore rules.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
b200710b96 OSD,PG: clean up pg removal
PG opsequencers will be used for removing a pg.  If the pg is recreated
before the removal is complete, we need the new pg incarnation to be
able to inherit the osr of its predecessor.

Previously, we queued the pg for removal and only rendered it unusable
after the contents were fully removed.  Now, we syncronously remove it
from the map and queue a transaction renaming the collections.  We then
asyncronously clean up those collections.  If the pg is recreated, it
will inherit the same osr until the cleanup is complete ensuring correct
op ordering with respect to the collection rename.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:15:00 -07:00
Samuel Just
9a4a9b9af9 PG: flush ops by the end of peering without osr.flush
Rather than explicitely flushing the filestore, send a noop through the
filestore at the beginning of peering and, at the end, wait for it to
finish by adding an extra state.

Also, delay ops until flushed is true.  Until we have finished flushing,
we cannot safetly read objects.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
33b985dcfe OSD,PG: added helper methods for creating and dispatching RecoveryCtxs
This is simpler than having to update all of the RecoveryCtx users
whenever we change the types in RecoveryCtx.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
b80b50053c OSD,PG: Move pg accesible methods, objects to OSDService
In order to clarify data structure locking, PGs will now access
OSDService rather the the OSD directly.  Over time, more structures will
be moved to the OSDService.  osd_lock can no longer be held while pg
locks are held.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
502c033511 PG, OSD: info_map shouldn't contain the MOSDPGInfo*
Rather, we will just pass the same type as the noties.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
f68f52ced6 OSD: queue_want_up_thru in process_peering_event
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
492e6351e5 OSD: do not drop osd_lock in handle_osd_map
PGs have their map updates done in a different thread.  Thus, we no
longer need to grab the pg locks.  activate_map no longer requires
the map_lock in order to allow us to queue events for the pgs.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
14381b38d7 OSD: get map read lock during queue_want_up_thru
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
10ec5bc5ee OSD: push_waiters is no longer used
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
90e3727e2c OSD: do not lock osd during dequeue_op
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
3d32712e41 OSD: don't assume pending pg removals have flushed
_create_lock_pg might encounter a preexisting pg collection simply
because the removal transaction had not yet completed.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
91355fb733 ReplicatedPG: change ReplicatedPG debug output to match PG
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
b6bf573699 ReplicatedPG: do not eval_repop if aborted
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
f6fc1b3031 OSD: remove superfluous pg get/put around enqueue_op
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:59 -07:00
Samuel Just
b0cb96bff6 PG,OSD: fix op checking in pg, take_waiters during ActMap
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:58 -07:00
Samuel Just
b5078bb2cd PG,OSD: add OSD::queue_for_op, use in PG::queue_op
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-07-05 10:14:58 -07:00