Skip to contentSkip to conversation

Introduce ceph_ectool

PATCH Alexandre Oliva 1 participant 1 message May 11, 2015

lore
Share & tools
lore
#0 lore raw

If a crush rule change wants to move shards of EC pools, and any file fails to read due to a bad block, the osd will crash, and to avoid further unexpected failures it must be kept down until other OSDs recover the PG.

With ceph_ectool, you can recompute the contents of the broken file out of the object proper, if the PG is active, or out of files extracted from other active shards, and replace the broken file, so that the OSD won't crash any more.

I'm aware of the jerasure example program that purports to do the same, but the erasures generated by it are not compatible with those generated by ceph, at least not for the cauchy_good erasures in my 4+4 setting. With ceph_ectool, I have managed to recover some severely degraded objects and recompute data and erasure codes of various files.

---
 src/tools/Makefile.am    |    6 +
 src/tools/ceph_ectool.cc |  247 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 253 insertions(+)
 create mode 100644 src/tools/ceph_ectool.cc
src/tools/Makefile.am +6 -0
index 1a73995..e4ea0d0 100644
@@ -102,6 +102,12 @@ ceph_mon_store_converter_SOURCES = tools/mon_store_converter.cc
 ceph_mon_store_converter_LDADD = $(LIBMON) $(LIBOS) $(CEPH_GLOBAL)
 bin_PROGRAMS += ceph_mon_store_converter
 
+ceph_ectool_SOURCES = tools/ceph_ectool.cc
+ceph_ectool_CXXFLAGS = ${AM_CXXFLAGS} \
+	-I$(top_srcdir)/src/erasure-code -I$(top_srcdir)/src/osd
+ceph_ectool_LDADD = $(LIBOS) $(LIBOSD_TYPES) $(CEPH_GLOBAL)
+bin_PROGRAMS += ceph_ectool
+
 noinst_HEADERS += \
 	tools/cephfs/JournalTool.h \
 	tools/cephfs/JournalScanner.h \
src/tools/ceph_ectool.cc new file +247 -0

247 lines not on this page · raw message

Signature · 4 lines
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer