diff options
author | Samuel Just <sam.just@inktank.com> | 2013-04-30 15:48:10 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-05-01 10:43:39 -0700 |
commit | 8a8ae159f5bf3dd663b7524b41b5bad276a4f6de (patch) | |
tree | 610b73a1eb3271e3a74b0bfeb11d194dc3e1ec6e /src/osd/OSD.h | |
parent | fe68afe9d10bc5d49a05a8bafa644d57783447cf (diff) | |
download | ceph-8a8ae159f5bf3dd663b7524b41b5bad276a4f6de.tar.gz |
OSD: clean up in progress split state on pg removal
There are two cases: 1) The parent pg has not yet initiated the split 2) The
parent pg has initiated the split.
Previously in case 1), _remove_pg left the entry for its children in the
in_progress_splits map blocking subsequent peering attempts.
In case 1), we need to unblock requests on the child pgs for the parent on
parent removal. We don't need to bother waking requests since any requests
received prior to the remove_pg request are necessarily obsolete.
In case 2), we don't need to do anything: the child will complete the split on
its own anyway.
Thus, we now track pending_splits vs in_progress_splits. Children in
pending_splits are in state 1), in_progress_splits in state 2). split_pgs
bumps pgs from pending_splits to in_progress_splits atomically with respect to
_remove_pg since the parent pg lock is held in both places.
Fixes: #4813
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'src/osd/OSD.h')
-rw-r--r-- | src/osd/OSD.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 513bd43ec6c..f894768fbe5 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -386,16 +386,24 @@ public: // split Mutex in_progress_split_lock; - set<pg_t> in_progress_splits; - void _start_split(const set<pg_t> &pgs); - void start_split(const set<pg_t> &pgs) { + map<pg_t, pg_t> pending_splits; // child -> parent + map<pg_t, set<pg_t> > rev_pending_splits; // parent -> [children] + set<pg_t> in_progress_splits; // child + + void _start_split(pg_t parent, const set<pg_t> &children); + void start_split(pg_t parent, const set<pg_t> &children) { Mutex::Locker l(in_progress_split_lock); - return _start_split(pgs); + return _start_split(parent, children); } + void mark_split_in_progress(pg_t parent, const set<pg_t> &pgs); void complete_split(const set<pg_t> &pgs); + void cancel_pending_splits_for_parent(pg_t parent); bool splitting(pg_t pgid); void expand_pg_num(OSDMapRef old_map, OSDMapRef new_map); + void _maybe_split_pgid(OSDMapRef old_map, + OSDMapRef new_map, + pg_t pgid); // -- OSD Full Status -- Mutex full_status_lock; |