Skip to content

Commit 1002889

Browse files
committed
crimson/osd/pg_backend: needn't check if os.exist for
omap_get_vals_by_keys fix ./bin/ceph_test_cls_cmpomap error for noexist tests since the test case expect false value return, not error code. Signed-off-by: Chunmei Liu <[email protected]>
1 parent e5868d8 commit 1002889

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/crimson/osd/pg_backend.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,11 +1555,6 @@ PGBackend::omap_get_vals_by_keys(
15551555
OSDOp& osd_op,
15561556
object_stat_sum_t& delta_stats) const
15571557
{
1558-
if (!os.exists || os.oi.is_whiteout()) {
1559-
logger().debug("{}: object does not exist: {}", __func__, os.oi.soid);
1560-
return crimson::ct_error::enoent::make();
1561-
}
1562-
15631558
std::set<std::string> keys_to_get;
15641559
try {
15651560
auto p = osd_op.indata.cbegin();
@@ -1578,6 +1573,9 @@ PGBackend::omap_get_vals_by_keys(
15781573
crimson::ct_error::enodata::handle([&osd_op] {
15791574
uint32_t num = 0;
15801575
encode(num, osd_op.outdata);
1576+
// Although an error should be expected here since the object doesn't exist,
1577+
// we want to match classic's behavior as clients possibly rely on it.
1578+
// Return an empty, but successful return instead.
15811579
osd_op.rval = 0;
15821580
return ll_read_errorator::now();
15831581
}),

0 commit comments

Comments
 (0)