Project

General

Profile

Actions

Bug #47352

open

rados ls improvements.

Added by David Zafman over 3 years ago. Updated over 3 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
David Zafman
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

"rados ls" should NOT include deleted head objects, with json output include snapshots but add snapid fields to output.

Actions #1

Updated by David Zafman over 3 years ago

  • Description updated (diff)
Actions #2

Updated by David Zafman over 3 years ago

There are 2 issues here. 1. This is making ls more expensive. 2. How do I create ghobject_t for all cases.

diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc
index f12e9080b5b..b52c1e29140 100644
--- a/src/osd/PrimaryLogPG.cc
+++ b/src/osd/PrimaryLogPG.cc
@@ -1330,6 +1330,22 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
          if (recovery_state.get_missing_loc().is_deleted(candidate))
            continue;

+         // XXX: This is unfortunate overhead for ls, but could be a deleted HEAD
+         {
+           bufferlist bv;
+           int r = osd->store->getattr(
+               ch,
+               ghobject_t(candidate),   // XXX: What about EC?
+               OI_ATTR,
+               bv);
+           if (r >= 0) {
+             object_info_t oi(bv);
+
+             if (oi.is_whiteout())
+               continue;
+           }
+         }
+
          // skip wrong namespace
          if (m->get_hobj().nspace != librados::all_nspaces &&
                candidate.get_namespace() != m->get_hobj().nspace)
Actions #3

Updated by David Zafman over 3 years ago

  • Status changed from New to In Progress
  • Assignee set to David Zafman
Actions

Also available in: Atom PDF