[sheepdog] [PATCH 2/2] farm: reset trunk state after purge_obj()

Liu Yuan namei.unix at gmail.com
Sun Jul 1 07:38:29 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

- also panic out when we can't purge objects.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/farm/farm.c |    1 +
 sheep/group.c     |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/farm/farm.c b/sheep/farm/farm.c
index bef821c..ef8a9f1 100644
--- a/sheep/farm/farm.c
+++ b/sheep/farm/farm.c
@@ -754,6 +754,7 @@ static int farm_purge_obj(void)
 {
 	if (cleanup_working_dir() < 0)
 		return SD_RES_EIO;
+	trunk_reset();
 
 	return SD_RES_SUCCESS;
 }
diff --git a/sheep/group.c b/sheep/group.c
index 8675439..b41e9c1 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -802,7 +802,7 @@ static void finish_join(struct join_message *msg, struct sd_node *joined,
 	if (msg->inc_epoch)
 		if (sd_store->purge_obj &&
 		    sd_store->purge_obj() != SD_RES_SUCCESS)
-			eprintf("WARN: may have stale objects\n");
+			panic("can't remove stale objects\n");
 
 	sockfd_cache_add_group(nodes, nr_nodes);
 }
-- 
1.7.10.2




More information about the sheepdog mailing list