Project

General

Profile

Actions

Bug #14100

open

the semantics of CEPH_OSD_OP_ZERO.

Added by jianpeng ma over 8 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Dev Interfaces
Target version:
-
% Done:

0%

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

Description

Now in ReplicatedPG::do_osd_ops, for CEPH_OSD_OP_ZERO, there are the following handle:

a)if object din't exist, the op became no-op.
b)if object existed

     if (offset + len >= ob.size)
          if (offset >= ob.size)
                 op became no-op
          else
               op became truncate and the ob.size became offset
     else
         zero(offset, len) like normal write opeartions

Those behaviors are ok for rbd. From the native semantics of zero, it write the data(off, len) w/ zero.Make later read data is zero.
For rbd, we know the object size. If non-exist or smaller, we will append zero data in the end.

rados has a api: rados_write_op_zero, it use zero as write which don't carry data from client to osd.
But for a normal object,
a)zero a non-exist object don't work
b)zero(offset >= ob.size) don't work(but write(offset >= ob.size can work)
c)zero(offset + len >= ob.size & offset < ob.size) don't work(zero become a truncate and ob.size=offset).Later read(offset, len) don't return any data.

In fact, for rbd, zero mean discard. But for rados, zero is a speical write.

Actions

Also available in: Atom PDF