From: Liu Yuan <tailai...@taobao.com> v3: - node events and disk events can supersede each other - add a new test 056 to test mixed events case - refactor md_exist a bit
v2: - add 054 only to md group - rework patch 3/6 - make iteration of WD more efficient This patch set mainly add md recovery support which unifies node recovery and disk recovery. I choose to take advantage of current node recovery mechanism because: 1. It supports multiple failure events 2. It provide nice race-free and wait queue mechanism for VM IO requests and recovery IO requests. 3. already-made logic that can recover objects from other nodes. This is very crutial to md recovery because we distribute objects across disks without extra copies. 4. Maintan one mechanism is always better than two So disk failure will simply be seen as a node recovery without epoch lifted and md recovery has all the merits of node recovery: 1. multiple disk failures handling 2. serve VM IO requests while in recovery 3. can hot-plug and hot-unplug the disks (missing part yet) Besides, another nice spin-off is that with unified recovery, both node and disk recovery can suspend and supersede each other. The missing parts will be implemented in later patch. Liu Yuan (8): sheep: prepare and cleanup err_to_stderr() for MD recovery work queue: don't call worker func if not assigned recovery: start tgt_epoch with rw->epoch instead of 'rw->epoch - 1' md: implement automatic recovery tests: modify _start_sheep helper with one more disk tests: add a test 055 for md md: try hard to link stale objects during node events tests: add 056 to test disk failure with node event change sheep/journal_file.c | 3 +- sheep/md.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++++-- sheep/object_cache.c | 3 +- sheep/plain_store.c | 47 +++++------ sheep/recovery.c | 4 +- sheep/sheep.c | 4 +- sheep/sheep_priv.h | 5 +- sheep/work.c | 3 +- tests/055 | 46 +++++++++++ tests/055.out | 24 ++++++ tests/056 | 46 +++++++++++ tests/056.out | 19 +++++ tests/common.rc | 2 +- tests/group | 2 + 14 files changed, 379 insertions(+), 41 deletions(-) create mode 100755 tests/055 create mode 100644 tests/055.out create mode 100755 tests/056 create mode 100644 tests/056.out -- 1.7.9.5 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog