From fbf4d4763084450c674e81aa2c7af876125619dd Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Mon, 13 Oct 2014 10:14:25 +0800 Subject: [PATCH] KeyValueStore: Make clone error message more friendly Signed-off-by: Haomai Wang --- src/os/KeyValueStore.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 0f8c4f7276823..daa8b059bcae3 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -1514,22 +1514,19 @@ unsigned KeyValueStore::_do_transaction(Transaction& transaction, if (r < 0) { bool ok = false; - if (r == -ENOENT && !(op == Transaction::OP_CLONERANGE || - op == Transaction::OP_CLONE || - op == Transaction::OP_CLONERANGE2)) - // -ENOENT is normally okay - // ...including on a replayed OP_RMCOLL with checkpoint mode - ok = true; if (r == -ENODATA) ok = true; if (!ok) { const char *msg = "unexpected error code"; - if (r == -ENOENT && (op == Transaction::OP_CLONERANGE || - op == Transaction::OP_CLONE || - op == Transaction::OP_CLONERANGE2)) - msg = "ENOENT on clone suggests osd bug"; + if (op == Transaction::OP_CLONERANGE || + op == Transaction::OP_CLONE || + op == Transaction::OP_CLONERANGE2) { + dout(0) << "BUG: clone failed will lead to paritial transaction applied" << dendl; + if (r == -ENOENT) + msg = "ENOENT on clone suggests osd bug"; + } if (r == -ENOSPC) // For now, if we hit _any_ ENOSPC, crash, before we do any damage -- 2.39.5