[Sheepdog] [PATCH] sheep: fix double node failure recovery

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Apr 5 11:16:11 CEST 2011


If the target epoch doesn't have the object on recovery, we must read
from its previous epoch.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/store.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/store.c b/sheep/store.c
index bca5846..8038629 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -1225,9 +1225,9 @@ next:
 			return 0;
 
 		if (errno == ENOENT) {
-			next_nr = epoch_log_read(tgt_epoch, buf, buf_len);
+			next_nr = epoch_log_read(tgt_epoch - 1, buf, buf_len);
 			if (next_nr <= 0) {
-				eprintf("no previous epoch, %"PRIu32"\n", tgt_epoch);
+				eprintf("no previous epoch, %"PRIu32"\n", tgt_epoch - 1);
 				return -1;
 			}
 			next_entry = (struct sheepdog_node_list_entry *)buf;
-- 
1.5.6.5




More information about the sheepdog mailing list